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
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
})

}
Expand Down
18 changes: 11 additions & 7 deletions app/src/main/res/layout/fragment_camera.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
~ limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

Expand Down Expand Up @@ -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" />

<Button
android:id="@+id/buttonKill"
Expand All @@ -101,7 +106,6 @@
android:layout_marginTop="0pt"
android:layout_marginBottom="4pt"
android:background="#FFAA00"
android:importantForAccessibility="no"
android:paddingTop="5pt" />

</TableRow>
Expand Down Expand Up @@ -158,7 +162,6 @@
android:layout_height="wrap_content"
android:labelFor="@+id/spinnerEncoding"
android:text="@string/encoding_label"
android:labelFor="@+id/spinnerEncoding"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

<Spinner
Expand All @@ -182,7 +185,6 @@
android:layout_height="wrap_content"
android:labelFor="@+id/spinnerCam"
android:text="@string/sensor_label"
android:labelFor="@+id/spinnerCam"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

<Spinner
Expand All @@ -205,7 +207,6 @@
android:layout_height="wrap_content"
android:labelFor="@+id/spinnerRes"
android:text="@string/resolution_label"
android:labelFor="@+id/spinnerRes"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

<Spinner
Expand All @@ -230,7 +231,6 @@
android:layout_gravity="center_vertical"
android:labelFor="@+id/spinnerQua"
android:text="@string/quality_label"
android:labelFor="@+id/spinnerQua"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

<LinearLayout
Expand All @@ -249,7 +249,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorPrimary"
android:textSize="12sp" />
android:textSize="12sp"
android:focusable="true"
android:longClickable="true"
android:tooltipText="@string/bitrate_tooltip"
tools:text=" 500kB/s" />
</LinearLayout>

</TableRow>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@
<string name="stop_confirmation_message">This will stop the camera stream and close the application.</string>
<string name="stop_confirmation_positive">Stop</string>
<string name="stop_confirmation_negative">Cancel</string>

<!-- Tooltips -->
<string name="bitrate_tooltip">Current streaming bitrate</string>
<string name="frametime_tooltip">Frame processing latency</string>
</resources>