Skip to content

🟡 Details table: fix RTL alignment + Western digits for Design Capacity (#96)#97

Merged
almothafar merged 3 commits into
masterfrom
fix/96-table-rtl-digits
Jul 7, 2026
Merged

🟡 Details table: fix RTL alignment + Western digits for Design Capacity (#96)#97
almothafar merged 3 commits into
masterfrom
fix/96-table-rtl-digits

Conversation

@almothafar

Copy link
Copy Markdown
Owner

What

Two details-screen fixes split out from the #94 review.

Table alignment (RTL "chaos")

The details table used setStretchAllColumns(true), so the colon column stretched to a third of the width and scattered label / colon / value with big uneven gaps. RTL column order is governed by the TableLayout's own layout direction, which wasn't being set (only the rows were).

  • Stretch only the label (0) and value (2) columns; the colon column keeps its natural width, so rows cluster neatly around the colon.
  • Set the TableLayout's layoutDirection to LOCALE so columns mirror right-to-left in Arabic.
  • Value column is shrinkable so long values wrap instead of overflowing.

Western digits for Design Capacity

design_capacity_value used %1$d, which renders Eastern Arabic numerals (٤٠٠٠) under the ar locale, while cycles/days already used String.valueOf (Western). Now formatted via %1$s + String.valueOf, so Design Capacity shows Western digits (0-9) everywhere — on both the home details table and the Battery Insights screen.

Test

testDebugUnitTest + assembleDebug green; installed on the Mate 10 Pro.

Please verify on device (Arabic + English):

  • Rows line up cleanly around the colon (no scattered gaps), labels/values on the correct sides in RTL.
  • Design Capacity shows 4000, not ٤٠٠٠.

Alignment is hard to tune blind — if anything still looks off, tell me what you see and I'll iterate.

Closes #96

almothafar and others added 3 commits July 7, 2026 00:39
- Table: stretch only the label and value columns so the colon column
  keeps its natural width — rows now cluster around the colon instead of
  scattering across three equal thirds. Set the TableLayout's own layout
  direction to LOCALE so columns mirror correctly in RTL/Arabic, and let
  long values wrap.
- Design Capacity: format via %1$s + String.valueOf so the number renders
  in Western digits (0-9) in every locale, matching the cycles/days
  figures (was Eastern Arabic digits via %1$d under the ar locale).

Closes #96

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-up to the on-device #96 review:
- Fix the RTL "touching"/misalignment: use setPaddingRelative (not the
  physical setPadding) so the colon gap lands on the correct side, and set
  each cell's textDirection to LOCALE so numeric (Latin) values align with
  the Arabic text values instead of jumping to the far edge.
- Colon-aligned columns: the label column is end-aligned and only the value
  column stretches, so colons line up and values sit right after the colon.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Stretch both the label and value columns (not just the value) so they
share the row width evenly and the end-aligned colons land near the
horizontal centre in both LTR and RTL — instead of wherever the widest
label happened to end, which sat off toward the edge in Arabic.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@almothafar almothafar merged commit e94893a into master Jul 7, 2026
2 checks passed
@almothafar almothafar deleted the fix/96-table-rtl-digits branch July 7, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Battery details table: fix RTL alignment + use Western digits for numbers

1 participant