Skip to content

Comments

fix: adjust deck picker footer font automatically to fit in one line#18159

Closed
sddzhyc wants to merge 1 commit intoankidroid:mainfrom
sddzhyc:fix_string_overflow
Closed

fix: adjust deck picker footer font automatically to fit in one line#18159
sddzhyc wants to merge 1 commit intoankidroid:mainfrom
sddzhyc:fix_string_overflow

Conversation

@sddzhyc
Copy link

@sddzhyc sddzhyc commented Mar 25, 2025

Purpose / Description

The purpose of this change is to fix the string overflowing problem on deck picker footer, while keeping the text in a single line.

Fixes

Approach

  • The autoSizeTextType attribute is added to allow adjust font automatically
  • The maxLines="1" is added to force the text shown in a single line
  • The autoSizeMaxTextSize, autoSizeMinTextSize and autoSizeStepGranularity attribute is added to control a range of minimum and maximum text sizes and a dimension that specifies the size of each step

How Has This Been Tested?

This change has been tested using different font sizes and languages.

Screenshot

As shown in these images, with changing length and language of the text, the font size can adjust automatically to keep showing fully in a single line.

1-Screenshot_20250325_193051
1-Screenshot_20250325_204627
Screenshot_20250325_204918
1-Screenshot_20250325_204952
Screenshot_20250325_205149

Checklist

Please, go through these checks before submitting the PR.

  • [ x ] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [ x ] You have commented your code, particularly in hard-to-understand areas
  • [ x ] You have performed a self-review of your own code
  • [ x ] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@welcome
Copy link

welcome bot commented Mar 25, 2025

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

@sddzhyc sddzhyc changed the title fix: adjust deck picker footer font to fit in one line automatically fix: adjust deck picker footer font automatically to fit in one line Mar 25, 2025
Copy link
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested increasing the font size in the system settings?

@BrayanDSO BrayanDSO added the Needs Author Reply Waiting for a reply from the original author label Mar 25, 2025
@sddzhyc
Copy link
Author

sddzhyc commented Mar 26, 2025

Yes, the above screenshots are tested in the largest font size in the system settings.

Copy link
Contributor

@criticalAY criticalAY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I tested it on two devices works fine thanks!

@criticalAY criticalAY added Needs Review and removed Needs Author Reply Waiting for a reply from the original author labels Mar 28, 2025
Copy link
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a regression and now the footer overflows instead of wrapping the result in two lines.

image

@BrayanDSO
Copy link
Member

I'm closing the original issue as solved, so I'll close this PR as well. Sorry for the time spent here.

@BrayanDSO BrayanDSO closed this Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: String of review count at bottom of deck picker screen overflows

3 participants