Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ public static Typeface getMonospaceFont(Context context, SharedPreferences prefs
String key = context.getString(R.string.key_monospace_font);
String font;
try {
font = prefs.getString(key, "0");
font = prefs.getString(key, "6");
} catch (ClassCastException e) {
prefs.edit().remove(key).apply();
font = "0";
font = "6";
}
return switch (font) {
case "0" -> ResourcesCompat.getFont(context, R.font.font_audiowide);
case "1" -> ResourcesCompat.getFont(context, R.font.font_fira_code);
case "2" -> ResourcesCompat.getFont(context, R.font.font_jetbrains_mono);
case "3" -> ResourcesCompat.getFont(context, R.font.font_noto_sans_mono);
case "4" -> ResourcesCompat.getFont(context, R.font.font_poppins);
case "5" -> ResourcesCompat.getFont(context, R.font.font_roboto_mono);
default -> ResourcesCompat.getFont(context, R.font.font_audiowide);
case "6" -> ResourcesCompat.getFont(context, R.font.font_google_sans_code);
default -> ResourcesCompat.getFont(context, R.font.font_google_sans_code);
};
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="code_font_entries">
<item>@string/audiowide</item>
Expand All @@ -84,6 +85,7 @@
<item>@string/noto_sans_mono</item>
<item>@string/poppins</item>
<item>@string/roboto_mono</item>
<item>@string/google_sans_code</item>
</string-array>
<string-array name="preference_bottom_navigation_bar_labels_entries">
<item>@string/labeled</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/untranslatable_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<string name="noto_sans_mono" translatable="false">Noto Sans Mono</string>
<string name="poppins" translatable="false">Poppins</string>
<string name="roboto_mono" translatable="false">Roboto Mono</string>
<string name="google_sans_code" translatable="false">Google Sans Code</string>
<string name="arch" translatable="false">Arch:</string>
<string name="copyright" translatable="false">Copyright ©2023-2025, D4rK</string>
<string name="summary_preference_settings_license" translatable="false">General Public License-3.0</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/preferences_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
app:title="@string/bottom_navigation_bar_labels"
app:useSimpleSummaryProvider="true" />
<androidx.preference.ListPreference
app:defaultValue="0"
app:defaultValue="6"
app:entries="@array/code_font_entries"
app:entryValues="@array/code_font_values"
app:icon="@drawable/ic_font_download"
Expand Down