From 220be83bdbb5bb1fea5505aacd0edad96cc84b48 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 20:43:39 +0000 Subject: [PATCH] feat(ux): add tooltips and accessibility labels for camera metrics - Added tooltips for bitrate and frame time metrics. - Implemented dynamic content descriptions for accessibility. - Fixed duplicate XML attributes in `fragment_camera.xml` causing build failures. - Made metric text views focusable and long-clickable. Co-authored-by: manupawickramasinghe <73810867+manupawickramasinghe@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ .../android/scan3d/fragments/CameraFragment.kt | 5 +++++ app/src/main/res/layout/fragment_camera.xml | 18 +++++++++++------- app/src/main/res/values/strings.xml | 4 ++++ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index a34c9ff..9f78102 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -20,3 +20,7 @@ ## 2025-10-21 - Destructive Action Confirmation **Learning:** The "STOP" button terminated the camera stream and app immediately without confirmation, posing a risk of accidental interruption. **Action:** Always wrap destructive actions (like stopping a server or deleting data) in a confirmation dialog (e.g., `AlertDialog`) to prevent data loss or unintended service stoppage. + +## 2025-10-22 - Dynamic Technical Metrics +**Learning:** Displaying raw numbers (bitrate/frametime) is meaningless to many users and inaccessible if announced only as numbers by screen readers. +**Action:** Always provide `tooltipText` for technical metrics to explain them, and use dynamic `contentDescription` updates (e.g., "Bitrate: X KB/s") to provide full context to screen reader users instead of just reading the raw text. 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 2385d99..bedf985 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 @@ -108,8 +108,13 @@ class CameraFragment : Fragment() { // Stuff that updates the UI fragmentCameraBinding.qualFeedback?.text = " " + this.rateKbs + "kB/sec" + fragmentCameraBinding.qualFeedback?.contentDescription = + "Bitrate: " + this.rateKbs + " kilobytes per second" + fragmentCameraBinding.ftFeedback?.text = " " + this.ms + "ms" + fragmentCameraBinding.ftFeedback?.contentDescription = + "Frame time: " + this.ms + " milliseconds" }) } diff --git a/app/src/main/res/layout/fragment_camera.xml b/app/src/main/res/layout/fragment_camera.xml index 7eeaa62..e510973 100644 --- a/app/src/main/res/layout/fragment_camera.xml +++ b/app/src/main/res/layout/fragment_camera.xml @@ -14,6 +14,7 @@ ~ limitations under the License. --> @@ -74,7 +75,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="start|center_vertical" - android:layout_weight="1" /> + android:layout_weight="1" + android:focusable="true" + android:longClickable="true" + android:tooltipText="@string/frametime_tooltip" + tools:text=" 33ms" />