Skip to content

Commit 2cad84d

Browse files
Merge pull request #91 from MihaiCristianCondrea/codex/set-google-sans-code-as-default-font
feat: set Google Sans Code as default code font
2 parents f829874 + 6b0fa1b commit 2cad84d

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

app/src/main/java/com/d4rk/androidtutorials/java/utils/FontManager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@ public static Typeface getMonospaceFont(Context context, SharedPreferences prefs
1414
String key = context.getString(R.string.key_monospace_font);
1515
String font;
1616
try {
17-
font = prefs.getString(key, "0");
17+
font = prefs.getString(key, "6");
1818
} catch (ClassCastException e) {
1919
prefs.edit().remove(key).apply();
20-
font = "0";
20+
font = "6";
2121
}
2222
return switch (font) {
23+
case "0" -> ResourcesCompat.getFont(context, R.font.font_audiowide);
2324
case "1" -> ResourcesCompat.getFont(context, R.font.font_fira_code);
2425
case "2" -> ResourcesCompat.getFont(context, R.font.font_jetbrains_mono);
2526
case "3" -> ResourcesCompat.getFont(context, R.font.font_noto_sans_mono);
2627
case "4" -> ResourcesCompat.getFont(context, R.font.font_poppins);
2728
case "5" -> ResourcesCompat.getFont(context, R.font.font_roboto_mono);
28-
default -> ResourcesCompat.getFont(context, R.font.font_audiowide);
29+
case "6" -> ResourcesCompat.getFont(context, R.font.font_google_sans_code);
30+
default -> ResourcesCompat.getFont(context, R.font.font_google_sans_code);
2931
};
3032
}
3133
}

app/src/main/res/values/arrays.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<item>3</item>
7777
<item>4</item>
7878
<item>5</item>
79+
<item>6</item>
7980
</string-array>
8081
<string-array name="code_font_entries">
8182
<item>@string/audiowide</item>
@@ -84,6 +85,7 @@
8485
<item>@string/noto_sans_mono</item>
8586
<item>@string/poppins</item>
8687
<item>@string/roboto_mono</item>
88+
<item>@string/google_sans_code</item>
8789
</string-array>
8890
<string-array name="preference_bottom_navigation_bar_labels_entries">
8991
<item>@string/labeled</item>

app/src/main/res/values/untranslatable_strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<string name="noto_sans_mono" translatable="false">Noto Sans Mono</string>
4343
<string name="poppins" translatable="false">Poppins</string>
4444
<string name="roboto_mono" translatable="false">Roboto Mono</string>
45+
<string name="google_sans_code" translatable="false">Google Sans Code</string>
4546
<string name="arch" translatable="false">Arch:</string>
4647
<string name="copyright" translatable="false">Copyright ©2023-2025, D4rK</string>
4748
<string name="summary_preference_settings_license" translatable="false">General Public License-3.0</string>

app/src/main/res/xml/preferences_settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
app:title="@string/bottom_navigation_bar_labels"
2929
app:useSimpleSummaryProvider="true" />
3030
<androidx.preference.ListPreference
31-
app:defaultValue="0"
31+
app:defaultValue="6"
3232
app:entries="@array/code_font_entries"
3333
app:entryValues="@array/code_font_values"
3434
app:icon="@drawable/ic_font_download"

0 commit comments

Comments
 (0)