-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Conversation
This file contains 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
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
Lakoja
reviewed
Feb 5, 2023
app/src/main/java/com/keylesspalace/tusky/util/FontScaleContextWrapper.kt
Outdated
Show resolved
Hide resolved
Lakoja
reviewed
Feb 7, 2023
connyduck
reviewed
Feb 20, 2023
app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesActivity.kt
Outdated
Show resolved
Hide resolved
Sample user request: https://mastodon.social/@KingShawn/109882568882452842 |
# 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.
connyduck
reviewed
Jun 26, 2023
app/src/main/java/com/keylesspalace/tusky/util/FontScaleContextWrapper.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/view/SliderPreference.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/keylesspalace/tusky/components/preference/PreferencesActivity.kt
Outdated
Show resolved
Hide resolved
connyduck
approved these changes
Jun 29, 2023
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.
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.
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