Skip to content

Commit 48e74a3

Browse files
committed
Font Settings
1 parent 1283a13 commit 48e74a3

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/BgGraphBuilder.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,17 @@ private double bgScale() {
271271

272272

273273
static public boolean isXLargeTablet(Context context) {
274-
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
274+
if (Pref.getBooleanDefaultFalse("enlarge_fonts_on_large_screens")) {
275+
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
276+
}
277+
return false;
275278
}
276279

277280
static public boolean isLargeTablet(Context context) {
278-
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
281+
if (Pref.getBooleanDefaultFalse("enlarge_fonts_on_large_screens")) {
282+
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
283+
}
284+
return false;
279285
}
280286

281287
public static double mmolConvert(double mgdl) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@
339339
<string name="pebble_and_android_wear_options">Options for different Watches</string>
340340
<string name="customize_colours">Customize Colors</string>
341341
<string name="xdrip_plus_color_settings">xDrip+ Color Settings</string>
342+
<string name="summary_font_settings">Customize Fonts</string>
343+
<string name="title_font_settings">Font Settings</string>
344+
<string name="summary_enlarge_fonts_on_large_screens">Automatically enlarge the font size on large screens, such as tablets</string>
345+
<string name="title_enlarge_fonts_on_large_screens">Enlarge fonts on larger displays</string>
342346
<string name="glucose_values_and_lines">Glucose Values and Lines</string>
343347
<string name="high_glucose_values">High Glucose Values</string>
344348
<string name="in_range_glucose_values">In-range Glucose Values</string>

app/src/main/res/xml/xdrip_plus_prefs.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,17 @@
309309
</PreferenceCategory>
310310
</PreferenceScreen>
311311

312+
<PreferenceScreen
313+
android:key="xdrip_font_settings"
314+
android:summary="@string/summary_font_settings"
315+
android:title="@string/title_font_settings">
316+
<CheckBoxPreference
317+
android:defaultValue="true"
318+
android:key="enlarge_fonts_on_large_screens"
319+
android:summary="@string/summary_enlarge_fonts_on_large_screens"
320+
android:title="@string/title_enlarge_fonts_on_large_screens" />
321+
</PreferenceScreen>
322+
312323
<SwitchPreference
313324
android:defaultValue="false"
314325
android:key="force_english"

0 commit comments

Comments
 (0)