🟡 Details table: fix RTL alignment + Western digits for Design Capacity (#96)#97
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).layoutDirectiontoLOCALEso columns mirror right-to-left in Arabic.Western digits for Design Capacity
design_capacity_valueused%1$d, which renders Eastern Arabic numerals (٤٠٠٠) under thearlocale, while cycles/days already usedString.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+assembleDebuggreen; installed on the Mate 10 Pro.Please verify on device (Arabic + English):
4000, not٤٠٠٠.Alignment is hard to tune blind — if anything still looks off, tell me what you see and I'll iterate.
Closes #96