From f39ef9cbca90d28df3d8df3f2618430375744abd Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Sat, 14 Nov 2015 18:58:58 -0500 Subject: [PATCH] Added option for system font --- .../main/java/com/moez/QKSMS/common/FontManager.java | 2 +- .../java/com/moez/QKSMS/common/TypefaceManager.java | 10 ++++++---- QKSMS/src/main/res/values/strings.xml | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/QKSMS/src/main/java/com/moez/QKSMS/common/FontManager.java b/QKSMS/src/main/java/com/moez/QKSMS/common/FontManager.java index 4d6c867c..8c8c1fd5 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/common/FontManager.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/common/FontManager.java @@ -123,7 +123,7 @@ public class FontManager { // Otherwise, get the heavy font weight. if (fontWeight == TypefaceManager.TextWeight.LIGHT) { return TypefaceManager.TextWeight.NORMAL; - } else if (fontFamily == TypefaceManager.FontFamily.ROBOTO || fontFamily == TypefaceManager.FontFamily.LATO) { + } else if (fontFamily == TypefaceManager.FontFamily.ROBOTO) { return TypefaceManager.TextWeight.MEDIUM; } else { return TypefaceManager.TextWeight.BOLD; diff --git a/QKSMS/src/main/java/com/moez/QKSMS/common/TypefaceManager.java b/QKSMS/src/main/java/com/moez/QKSMS/common/TypefaceManager.java index 75330d56..609193ab 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/common/TypefaceManager.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/common/TypefaceManager.java @@ -23,8 +23,10 @@ public class TypefaceManager { public static android.graphics.Typeface obtainTypeface(int fontFamily, int textWeight) throws IllegalArgumentException { int typeface = Typefaces.ROBOTO_REGULAR; switch (fontFamily) { + case FontFamily.SYSTEM_FONT: + break; + case FontFamily.ROBOTO: - case FontFamily.LATO: switch (textWeight) { case TextWeight.NORMAL: typeface = Typefaces.ROBOTO_REGULAR; @@ -94,9 +96,9 @@ public class TypefaceManager { } public class FontFamily { - public static final int ROBOTO = 0; - public static final int ROBOTO_CONDENSED = 1; - public static final int LATO = 2; + public static final int SYSTEM_FONT = 0; + public static final int ROBOTO = 1; + public static final int ROBOTO_CONDENSED = 2; } public class TextWeight { diff --git a/QKSMS/src/main/res/values/strings.xml b/QKSMS/src/main/res/values/strings.xml index 23591ee8..4767ec1a 100644 --- a/QKSMS/src/main/res/values/strings.xml +++ b/QKSMS/src/main/res/values/strings.xml @@ -753,9 +753,9 @@ + System font Roboto Regular Roboto Condensed - Lato