Skip to content

Commit

Permalink
Add extra font sizes. (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeetay authored Jan 1, 2025
1 parent 76f4343 commit 3eb6784
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ abstract class AbstractLayer(protected val resources: Resources,

private val fontSizeScale = when( preferences.getString(ApplicationConstants.FONT_SIZE,
FONTSIZE.MEDIUM.name)?.let { FONTSIZE.valueOf(it) }) {
FONTSIZE.SMALL -> 0.5
FONTSIZE.LARGE -> 2.0
FONTSIZE.SMALL -> 0.75
FONTSIZE.LARGE -> 1.5
FONTSIZE.EXTRALARGE -> 2.0
else -> 1.0
}

Expand Down Expand Up @@ -79,7 +80,8 @@ abstract class AbstractLayer(protected val resources: Resources,
private enum class FONTSIZE {
SMALL,
MEDIUM,
LARGE
LARGE,
EXTRALARGE
}

/**
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<string-array name="font_size_texts">
<item translation_description="Smallest font size">Small</item>
<item translation_description="Normal font size">Medium</item>
<item translation_description="Largest font size">Large</item>
<item translation_description="Large font size">Large</item>
<item translation_description="Largest font size">Extra Large</item>
</string-array>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/notranslate-arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
<item translation_description="DO NOT TRANSLATE">SMALL</item>
<item translation_description="DO NOT TRANSLATE">MEDIUM</item>
<item translation_description="DO NOT TRANSLATE">LARGE</item>
<item translation_description="DO NOT TRANSLATE">EXTRALARGE</item>
</string-array>
</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<string name="font_size_preference"
translation_description="Change the font size">
Font size</string>
<string name="font_size_preference_description"
translation_description="help to go along with the change font size preference">Requires
app restart</string>
<string name="ecliptic">Ecliptic</string>
<string name="eclipse24">Eclipse path 2024-04-08</string>
<string name="malformed_loc_error">Latitude or longitude setting isn\'t a number.</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/xml/preference_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<ListPreference
android:key="font_size"
android:title="@string/font_size_preference"
android:summary="@string/font_size_preference_description"
android:entryValues="@array/font_size_enums"
android:entries="@array/font_size_texts"
android:defaultValue="MEDIUM" />
Expand Down

0 comments on commit 3eb6784

Please sign in to comment.