Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a preference to scale all UI text #3248

Merged
merged 7 commits into from
Jun 29, 2023
Merged

Provide a preference to scale all UI text #3248

merged 7 commits into from
Jun 29, 2023

Conversation

nikclayton
Copy link
Contributor

Font scaling is applied in addition to any scaling set in Android system preferences. So if the user set the Android font size to largest (a 1.3x increase) and then sets the preference to 120%, the total change is 1.56x.

Create SliderPreference to adjust the preference.

  • Use Slider, which supports float values and step sizes > 1
  • Display the selected value in the preference's summary
  • Provide buttons to increment / decrement the value

Restart the activity if the preference changes so that the user sees the impact of the change immediately. Fix a bug in PreferencesActivity where the "EXTRA_RESTART_ON_BACK" intent was never processed. Fix this to ensure that other activities are restarted so the new font scale takes effect.

Implement the scaling in BaseActivity by overriding onAttachBaseContext, and providing a wrapped context with the font scaling applied.

Fixes #2982, #2461

Nik Clayton added 2 commits January 31, 2023 15:32
Font scaling is applied in addition to any scaling set in Android system
preferences. So if the user set the Android font size to largest (a 1.3x
increase) and then sets the preference to 120%, the total change is 1.56x.

Create SliderPreference to adjust the preference.

- Use Slider, which supports float values and step sizes > 1
- Display the selected value in the preference's summary
- Provide buttons to increment / decrement the value

Restart the activity if the preference changes so that the user sees the
impact of the change immediately. Fix a bug in PreferencesActivity where the
"EXTRA_RESTART_ON_BACK" intent was never processed. Fix this to ensure that
other activities are restarted so the new font scale takes effect.

Implement the scaling in BaseActivity by overriding onAttachBaseContext, and
providing a wrapped context with the font scaling applied.

Fixes #2982, #2461
@nikclayton
Copy link
Contributor Author

Sample user request: https://mastodon.social/@KingShawn/109882568882452842

Nik Clayton added 3 commits June 15, 2023 16:03
# Conflicts:
#	app/src/main/res/values/attrs.xml
Prevents a horizontal line appearing between preferences.

Update comments with full package names so that links work.
@nikclayton nikclayton merged commit fe7b152 into tuskyapp:develop Jun 29, 2023
2 checks passed
@nikclayton nikclayton deleted the 2461-font-scale branch June 29, 2023 16:35
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.

Increasing the app font size does not increase menu font size
3 participants