Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ dependencies {

// Access settings & model data
implementation(project(":data:settings"))
implementation(project(":data:media"))
implementation(project(":core:settings:datastore-prefs"))
implementation(project(":core:settings"))
implementation(project(":core:model"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class JcaFilePathGenerator : FilePathGenerator {
private val RELATIVE_OUTPUT_PATH: String =
"${Environment.DIRECTORY_DCIM}${File.separator}Camera"
}

override val prefix: String = "JCA"

override val baseRelativePath: String = RELATIVE_OUTPUT_PATH

override val relativeImageOutputPath: String = RELATIVE_OUTPUT_PATH

override val relativeVideoOutputPath: String = RELATIVE_OUTPUT_PATH
Expand Down Expand Up @@ -64,7 +69,7 @@ class JcaFilePathGenerator : FilePathGenerator {

override fun generateImageFilename(suffixText: String?, fileExtension: String?): String {
return constructFilename(
"JCA-photo",
"$prefix-photo",
createTimestamp().toString(),
suffixText,
fileExtension
Expand All @@ -73,7 +78,7 @@ class JcaFilePathGenerator : FilePathGenerator {

override fun generateVideoFilename(suffixText: String?, fileExtension: String?): String {
return constructFilename(
"JCA-recording",
"$prefix-recording",
createTimestamp().toString(),
suffixText,
fileExtension
Expand Down
307 changes: 307 additions & 0 deletions build_err.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ package com.google.jetpackcamera.core.common
*/
interface FilePathGenerator {

/**
* The prefix used for generated filenames.
*/
val prefix: String

/**
* The base relative path where media is stored (e.g., "DCIM/Camera").
* Used for filtering in the MediaStore on API 29+.
*/
val baseRelativePath: String

/**
* Provides the relative output path for an image file, used for MediaStore.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class FakeFilePathGenerator : FilePathGenerator {
"${Environment.DIRECTORY_DCIM}${File.separator}Camera"
}

override val prefix: String = "JCA"

override val baseRelativePath: String = RELATIVE_OUTPUT_PATH

override val relativeImageOutputPath: String = RELATIVE_OUTPUT_PATH

override val relativeVideoOutputPath: String = RELATIVE_OUTPUT_PATH
Expand Down Expand Up @@ -63,7 +67,7 @@ class FakeFilePathGenerator : FilePathGenerator {

override fun generateImageFilename(suffixText: String?, fileExtension: String?): String {
return constructFilename(
"JCA-test-photo",
"$prefix-test-photo",
createTimestamp().toString(),
suffixText,
fileExtension
Expand All @@ -72,7 +76,7 @@ class FakeFilePathGenerator : FilePathGenerator {

override fun generateVideoFilename(suffixText: String?, fileExtension: String?): String {
return constructFilename(
"JCA-test-recording",
"$prefix-test-recording",
createTimestamp().toString(),
suffixText,
fileExtension
Expand Down
Loading
Loading