Fix cropped folder name text in arabic

Centralize the folder name within folder footer using gravity property
instead of adding padding to the folder name view. Padding as calculated
was cropping the folder name to the text line height, which was
insuficient in some cases, as eveidenced by the linked bug.

Bug: b/358006967
Test: Open a folder on home screen with arabic system language.
      Verify that the folder name displays correctly.
Flag: EXEMPT bugfix

Change-Id: I4436c224f7f6541f447e3a5354ff870cf4d50698
This commit is contained in:
Toni Barzic committed 2024-09-26 04:57:45 +00:00
1 parent bb87ff95e8
commit 2c72b9bd1a
3 files changed
+6 -9

No files matched your search

@@ -373,8 +373,9 @@ public class FolderPagedView extends PagedView<PageIndicatorDots> implements Cli
// Update footer
mPageIndicator.setVisibility(getPageCount() > 1 ? View.VISIBLE : View.GONE);
// Set the gravity as LEFT or RIGHT instead of START, as START depends on the actual text.
mFolder.getFolderName().setGravity(getPageCount() > 1
? (mIsRtl ? Gravity.RIGHT : Gravity.LEFT) : Gravity.CENTER_HORIZONTAL);
int horizontalGravity = getPageCount() > 1
? (mIsRtl ? Gravity.RIGHT : Gravity.LEFT) : Gravity.CENTER_HORIZONTAL;
mFolder.getFolderName().setGravity(horizontalGravity | Gravity.CENTER_VERTICAL);
}
public int getDesiredWidth() {