Skip to content
Merged
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ dependencies {
androidTestImplementation(libs.truth)
androidTestImplementation(libs.testParameterInjector)
androidTestImplementation(project(":ui:components:capture"))
androidTestImplementation(project(":ui:debug"))
androidTestUtil(libs.androidx.orchestrator)

implementation(libs.androidx.core.ktx)
Expand Down Expand Up @@ -169,6 +170,7 @@ dependencies {

// capture components
implementation(project(":ui:components:capture"))
implementation(project(":ui:debug"))

// Low Light implementations
implementation(project(":core:camera:low-light-playservices"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import androidx.test.uiautomator.UiDevice
import com.google.common.truth.Truth.assertThat
import com.google.jetpackcamera.ui.components.capture.AMPLITUDE_HOT_TAG
import com.google.jetpackcamera.ui.components.capture.AMPLITUDE_NONE_TAG
import com.google.jetpackcamera.ui.components.capture.BTN_DEBUG_HIDE_COMPONENTS_TAG
import com.google.jetpackcamera.ui.components.capture.CAPTURE_BUTTON
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_BUTTON
import com.google.jetpackcamera.ui.components.capture.FLIP_CAMERA_BUTTON
import com.google.jetpackcamera.ui.components.capture.LOGICAL_CAMERA_ID_TAG
import com.google.jetpackcamera.ui.components.capture.PHYSICAL_CAMERA_ID_TAG
import com.google.jetpackcamera.ui.components.capture.ZOOM_BUTTON_ROW_TAG
import com.google.jetpackcamera.ui.components.capture.ZOOM_RATIO_TAG
import com.google.jetpackcamera.ui.debug.BTN_DEBUG_HIDE_COMPONENTS_TAG
import com.google.jetpackcamera.ui.debug.DEBUG_OVERLAY_BUTTON
import com.google.jetpackcamera.ui.debug.LOGICAL_CAMERA_ID_TAG
import com.google.jetpackcamera.ui.debug.PHYSICAL_CAMERA_ID_TAG
import com.google.jetpackcamera.ui.debug.ZOOM_RATIO_TAG
import com.google.jetpackcamera.utils.TEST_REQUIRED_PERMISSIONS
import com.google.jetpackcamera.utils.debugExtra
import com.google.jetpackcamera.utils.runMainActivityScenarioTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performTouchInput
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.GrantPermissionRule
import com.google.jetpackcamera.ui.components.capture.BTN_DEBUG_HIDE_COMPONENTS_TAG
import com.google.jetpackcamera.ui.components.capture.CAPTURE_BUTTON
import com.google.jetpackcamera.ui.components.capture.FOCUS_METERING_INDICATOR_TAG
import com.google.jetpackcamera.ui.components.capture.PREVIEW_DISPLAY
import com.google.jetpackcamera.ui.debug.BTN_DEBUG_HIDE_COMPONENTS_TAG
import com.google.jetpackcamera.utils.FOCUS_METERING_INDICATOR_TIMEOUT_MILLIS
import com.google.jetpackcamera.utils.TEST_REQUIRED_PERMISSIONS
import com.google.jetpackcamera.utils.debugExtra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.compose.ui.test.isDisplayed
import androidx.compose.ui.test.isEnabled
import androidx.compose.ui.test.isNotDisplayed
import androidx.compose.ui.test.junit4.ComposeTestRule
import androidx.compose.ui.test.onAllNodesWithTag
import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
Expand Down
2 changes: 1 addition & 1 deletion feature/preview/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ dependencies {
implementation(project(":ui:uistate:capture"))
implementation(project(":ui:uistateadapter"))
implementation(project(":ui:uistateadapter:capture"))

implementation(project(":ui:debug"))
}

// Allow references to generated code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ import com.google.jetpackcamera.ui.components.capture.VideoQualityIcon
import com.google.jetpackcamera.ui.components.capture.ZoomButtonRow
import com.google.jetpackcamera.ui.components.capture.ZoomStateManager
import com.google.jetpackcamera.ui.components.capture.debouncedOrientationFlow
import com.google.jetpackcamera.ui.components.capture.debug.DebugOverlay
import com.google.jetpackcamera.ui.components.capture.quicksettings.QuickSettingsBottomSheet
import com.google.jetpackcamera.ui.components.capture.quicksettings.ui.FlashModeIndicator
import com.google.jetpackcamera.ui.components.capture.quicksettings.ui.HdrIndicator
Expand All @@ -101,13 +100,14 @@ import com.google.jetpackcamera.ui.controller.CaptureController
import com.google.jetpackcamera.ui.controller.ImageWellController
import com.google.jetpackcamera.ui.controller.ScreenFlashController
import com.google.jetpackcamera.ui.controller.SnackBarController
import com.google.jetpackcamera.ui.controller.debug.DebugController
import com.google.jetpackcamera.ui.controller.quicksettings.QuickSettingsController
import com.google.jetpackcamera.ui.debug.DebugController
import com.google.jetpackcamera.ui.debug.DebugOverlay
import com.google.jetpackcamera.ui.debug.DebugUiState
import com.google.jetpackcamera.ui.uistate.SnackBarUiState
import com.google.jetpackcamera.ui.uistate.capture.AudioUiState
import com.google.jetpackcamera.ui.uistate.capture.CaptureButtonUiState
import com.google.jetpackcamera.ui.uistate.capture.CaptureModeToggleUiState
import com.google.jetpackcamera.ui.uistate.capture.DebugUiState
import com.google.jetpackcamera.ui.uistate.capture.FlipLensUiState
import com.google.jetpackcamera.ui.uistate.capture.ImageWellUiState
import com.google.jetpackcamera.ui.uistate.capture.ScreenFlashUiState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ import com.google.jetpackcamera.ui.controller.ImageWellController
import com.google.jetpackcamera.ui.controller.ScreenFlashController
import com.google.jetpackcamera.ui.controller.SnackBarController
import com.google.jetpackcamera.ui.controller.ZoomController
import com.google.jetpackcamera.ui.controller.debug.DebugController
import com.google.jetpackcamera.ui.controller.impl.CameraControllerImpl
import com.google.jetpackcamera.ui.controller.impl.CaptureControllerImpl
import com.google.jetpackcamera.ui.controller.impl.DebugControllerImpl
import com.google.jetpackcamera.ui.controller.impl.ImageWellControllerImpl
import com.google.jetpackcamera.ui.controller.impl.QuickSettingsControllerImpl
import com.google.jetpackcamera.ui.controller.impl.ScreenFlashControllerImpl
import com.google.jetpackcamera.ui.controller.impl.SnackBarControllerImpl
import com.google.jetpackcamera.ui.controller.impl.ZoomControllerImpl
import com.google.jetpackcamera.ui.controller.quicksettings.QuickSettingsController
import com.google.jetpackcamera.ui.debug.DebugController
import com.google.jetpackcamera.ui.debug.DebugControllerImpl
import com.google.jetpackcamera.ui.debug.DebugUiState
import com.google.jetpackcamera.ui.debug.debugUiState
import com.google.jetpackcamera.ui.uistate.SnackBarUiState
import com.google.jetpackcamera.ui.uistate.SnackbarData
import com.google.jetpackcamera.ui.uistate.capture.DebugUiState
import com.google.jetpackcamera.ui.uistate.capture.TrackedCaptureUiState
import com.google.jetpackcamera.ui.uistate.capture.compound.CaptureUiState
import com.google.jetpackcamera.ui.uistateadapter.capture.compound.captureUiState
import com.google.jetpackcamera.ui.uistateadapter.capture.debugUiState
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
import kotlinx.coroutines.Deferred
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ include(":core:camera:postprocess")
include(":ui:controller")
include(":ui:controller:impl")
include(":ui:controller:testing")
include(":ui:debug")
include(":ui:debug:testing")

Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,8 @@ const val ZOOM_BUTTON_5_TAG = "ZoomButton5Tag"

// debug component tags

const val ZOOM_RATIO_TAG = "ZoomRatioTag"
const val LOGICAL_CAMERA_ID_TAG = "LogicalCameraIdTag"
const val PHYSICAL_CAMERA_ID_TAG = "PhysicalCameraIdTag"
const val ELAPSED_TIME_TAG = "ElapsedTimeTag"
const val VIDEO_QUALITY_TAG = "VideoQualityTag"
const val DEBUG_OVERLAY_BUTTON = "DebugOverlayButton"

const val BTN_DEBUG_HIDE_COMPONENTS_TAG = "btn_debug_hide_components"
const val DEBUG_OVERLAY_SHOW_CAMERA_PROPERTIES_BUTTON = "DebugOverlayShowCameraPropertiesButton"
const val DEBUG_OVERLAY_SET_ZOOM_RATIO_BUTTON = "DebugOverlaySetZoomRatioButton"
const val DEBUG_OVERLAY_CAMERA_PROPERTIES_TAG = "DebugOverlayCameraPropertiesTag"
const val DEBUG_OVERLAY_SET_ZOOM_RATIO_TEXT_FIELD = "DebugOverlaySetZoomRatioTextField"
const val DEBUG_OVERLAY_SET_ZOOM_RATIO_SET_BUTTON = "DebugOverlaySetZoomRatioSetButton"
const val DEBUG_OVERLAY_VIDEO_RESOLUTION_TAG = "DebugOverlayVideoResolutionTag"

// quick settings tags
// todo(kc): rename quick_settings_drop_down to something more appropriate?
Expand Down
6 changes: 0 additions & 6 deletions ui/components/capture/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@

<string name="zoom_ratio_text">%1$.2fx</string>

<!-- Debug Overlay Text -->

<string name="debug_text_physical_camera_id_prefix">Physical ID: </string>
<string name="debug_text_logical_camera_id_prefix">Logical ID: </string>
<string name="debug_overlay_toggle_btn_text">Debug</string>
<string name="debug_hide_components_desc">Hiding components</string>
<string name="debug_show_components_desc">Displaying components</string>


<!-- Notification Text -->
Expand Down
91 changes: 91 additions & 0 deletions ui/debug/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright (C) 2026 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.compose.compiler)
}

android {
namespace = "com.google.jetpackcamera.ui.debug"
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
testOptions.targetSdk = libs.versions.targetSdk.get().toInt()
lint.targetSdk = libs.versions.targetSdk.get().toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

flavorDimensions += "flavor"
productFlavors {
create("stable") {
dimension = "flavor"
isDefault = true
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
buildFeatures {
buildConfig = true
compose = true
}
}

dependencies {
// Compose
val composeBom = platform(libs.compose.bom)
implementation(composeBom)

// Compose - Material Design 3
implementation(libs.compose.material3)

// Compose - Android Studio Preview support
implementation(libs.compose.ui.tooling.preview)
debugImplementation(libs.compose.ui.tooling)

// CameraX
implementation(libs.camera.core)

// Testing
testImplementation(libs.junit)
testImplementation(libs.truth)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.androidx.junit)

implementation(libs.androidx.activity.compose)

implementation(project(":core:camera"))
implementation(project(":core:model"))
implementation(project(":core:common"))
implementation(project(":data:settings"))
implementation(project(":ui:uistate:capture"))
implementation(project(":ui:controller"))
}

// Allow references to generated code
kapt {
correctErrorTypes = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.jetpackcamera.ui.controller.debug
package com.google.jetpackcamera.ui.debug

import com.google.jetpackcamera.model.TestPattern

/**
* Interface for controlling debug features.
* Interface contract for managing interactions with debug settings.
*/
interface DebugController {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.jetpackcamera.ui.controller.impl
package com.google.jetpackcamera.ui.debug

import com.google.jetpackcamera.core.camera.CameraSystem
import com.google.jetpackcamera.model.TestPattern
import com.google.jetpackcamera.ui.controller.debug.DebugController
import com.google.jetpackcamera.ui.uistate.capture.TrackedCaptureUiState
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.jetpackcamera.ui.components.capture.debug
package com.google.jetpackcamera.ui.debug

import android.util.Log
import androidx.activity.compose.BackHandler
Expand Down Expand Up @@ -63,20 +63,6 @@ import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.google.jetpackcamera.model.TestPattern
import com.google.jetpackcamera.ui.components.capture.BTN_DEBUG_HIDE_COMPONENTS_TAG
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_BUTTON
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_CAMERA_PROPERTIES_TAG
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_SET_ZOOM_RATIO_BUTTON
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_SET_ZOOM_RATIO_SET_BUTTON
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_SET_ZOOM_RATIO_TEXT_FIELD
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_SHOW_CAMERA_PROPERTIES_BUTTON
import com.google.jetpackcamera.ui.components.capture.DEBUG_OVERLAY_VIDEO_RESOLUTION_TAG
import com.google.jetpackcamera.ui.components.capture.LOGICAL_CAMERA_ID_TAG
import com.google.jetpackcamera.ui.components.capture.PHYSICAL_CAMERA_ID_TAG
import com.google.jetpackcamera.ui.components.capture.R
import com.google.jetpackcamera.ui.components.capture.ZOOM_RATIO_TAG
import com.google.jetpackcamera.ui.controller.debug.DebugController
import com.google.jetpackcamera.ui.uistate.capture.DebugUiState
import kotlin.math.abs

private const val TAG = "DebugOverlayComponents"
Expand Down Expand Up @@ -113,7 +99,7 @@ private fun ZoomRatioText(modifier: Modifier = Modifier, primaryZoomRatio: Float
DebugTextBar(
modifier = modifier,
title = "Zoom Ratio: ",
value = stringResource(id = R.string.zoom_ratio_text, primaryZoomRatio ?: 1f),
value = stringResource(id = R.string.debug_zoom_ratio_text, primaryZoomRatio ?: 1f),
tag = ZOOM_RATIO_TAG
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.jetpackcamera.ui.uistate.capture
package com.google.jetpackcamera.ui.debug

import android.util.Size
import com.google.jetpackcamera.model.TestPattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.jetpackcamera.ui.uistateadapter.capture
package com.google.jetpackcamera.ui.debug

import android.util.Size
import com.google.jetpackcamera.core.camera.CameraState
Expand All @@ -25,7 +25,6 @@ import com.google.jetpackcamera.settings.ConstraintsRepository
import com.google.jetpackcamera.settings.model.CameraAppSettings
import com.google.jetpackcamera.settings.model.CameraSystemConstraints
import com.google.jetpackcamera.settings.model.forCurrentLens
import com.google.jetpackcamera.ui.uistate.capture.DebugUiState
import com.google.jetpackcamera.ui.uistate.capture.TrackedCaptureUiState
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
Expand Down
Comment thread
davidjiagoogle marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (C) 2026 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.jetpackcamera.ui.debug

const val ZOOM_RATIO_TAG = "ZoomRatioTag"
const val LOGICAL_CAMERA_ID_TAG = "LogicalCameraIdTag"
const val PHYSICAL_CAMERA_ID_TAG = "PhysicalCameraIdTag"
const val DEBUG_OVERLAY_BUTTON = "DebugOverlayButton"

const val BTN_DEBUG_HIDE_COMPONENTS_TAG = "btn_debug_hide_components"
const val DEBUG_OVERLAY_SHOW_CAMERA_PROPERTIES_BUTTON = "DebugOverlayShowCameraPropertiesButton"
const val DEBUG_OVERLAY_SET_ZOOM_RATIO_BUTTON = "DebugOverlaySetZoomRatioButton"
const val DEBUG_OVERLAY_CAMERA_PROPERTIES_TAG = "DebugOverlayCameraPropertiesTag"
const val DEBUG_OVERLAY_SET_ZOOM_RATIO_TEXT_FIELD = "DebugOverlaySetZoomRatioTextField"
const val DEBUG_OVERLAY_SET_ZOOM_RATIO_SET_BUTTON = "DebugOverlaySetZoomRatioSetButton"
const val DEBUG_OVERLAY_VIDEO_RESOLUTION_TAG = "DebugOverlayVideoResolutionTag"
Comment thread
davidjiagoogle marked this conversation as resolved.
Loading
Loading