From 8cdc03aadbcb2b5f3c940d749d20dc4a0e455e6a Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Fri, 13 Mar 2026 20:23:06 +0000
Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20visual=20focus?=
=?UTF-8?q?=20indicators=20to=20interactive=20elements?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adds explicit `state_focused` styling to the custom STOP button (`btn_ios_background.xml`) using a white stroke. Also adds `?attr/selectableItemBackground` to the focusable `ftFeedback` and `qual_feedback` TextViews in `fragment_camera.xml`. This improves keyboard and directional pad navigation by making it visually clear which element has focus. Fixes `UnsafeImplicitIntentLaunch` lint error in `CameraFragment.kt` by explicitly setting the intent package name.
Co-authored-by: manupawickramasinghe <73810867+manupawickramasinghe@users.noreply.github.com>
---
.Jules/palette.md | 4 ++++
.../com/samsung/android/scan3d/fragments/CameraFragment.kt | 1 +
app/src/main/res/drawable/btn_ios_background.xml | 7 +++++++
app/src/main/res/layout/fragment_camera.xml | 2 ++
4 files changed, 14 insertions(+)
diff --git a/.Jules/palette.md b/.Jules/palette.md
index 33dd6d1..b399f58 100644
--- a/.Jules/palette.md
+++ b/.Jules/palette.md
@@ -41,3 +41,7 @@
## 2025-10-21 - Localization of Interactive Feedback
**Learning:** Found a hardcoded string `"Copied to clipboard"` used in a Toast message for interactive feedback. Hardcoded strings cannot be localized and are not accessible to non-English screen readers.
**Action:** Always use string resources (`R.string.*`) for all user-facing text, including Toast messages and Snackbars, to ensure proper localization and accessibility support.
+
+## 2025-10-22 - Missing Visual Focus Indicators on Custom and Interactive Elements
+**Learning:** Focusable `TextView` elements that display tooltips, and custom button background selectors, often lack explicit focus states (`android:state_focused="true"` or `?attr/selectableItemBackground`). This makes keyboard and directional pad navigation extremely difficult for users with mobility issues, as they cannot see which element is currently focused.
+**Action:** Always ensure that any element marked `android:focusable="true"` has a defined visual focus state. For standard interactive `TextView`s, use `android:background="?attr/selectableItemBackground"`. For custom button background selectors, add a specific `- ` with clear visual styling (e.g., a thick ``) to indicate focus clearly.
diff --git a/app/src/main/java/com/samsung/android/scan3d/fragments/CameraFragment.kt b/app/src/main/java/com/samsung/android/scan3d/fragments/CameraFragment.kt
index 0dd2b8b..729eab8 100644
--- a/app/src/main/java/com/samsung/android/scan3d/fragments/CameraFragment.kt
+++ b/app/src/main/java/com/samsung/android/scan3d/fragments/CameraFragment.kt
@@ -334,6 +334,7 @@ class CameraFragment : Fragment() {
.setPositiveButton(R.string.stop_confirmation_positive) { _, _ ->
Log.i("CameraFrag", "KILL")
val intent = Intent("KILL") //FILTER is a string to identify this intent
+ intent.setPackage(context?.packageName)
context?.sendBroadcast(intent)
}
.setNegativeButton(R.string.stop_confirmation_negative, null)
diff --git a/app/src/main/res/drawable/btn_ios_background.xml b/app/src/main/res/drawable/btn_ios_background.xml
index 45737d3..204e80b 100644
--- a/app/src/main/res/drawable/btn_ios_background.xml
+++ b/app/src/main/res/drawable/btn_ios_background.xml
@@ -6,6 +6,13 @@
+ -
+
+
+
+
+
+
-
diff --git a/app/src/main/res/layout/fragment_camera.xml b/app/src/main/res/layout/fragment_camera.xml
index 84acb43..b9359a7 100644
--- a/app/src/main/res/layout/fragment_camera.xml
+++ b/app/src/main/res/layout/fragment_camera.xml
@@ -77,6 +77,7 @@
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
+ android:background="?attr/selectableItemBackground"
android:focusable="true"
android:tooltipText="@string/frame_time_tooltip" />
@@ -251,6 +252,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:background="?attr/selectableItemBackground"
android:focusable="true"
android:textColor="@color/colorPrimary"
android:textSize="12sp"