Disable system default font for pre-21

This commit is contained in:
NekoInverter 2020-03-02 19:59:15 +08:00
parent 4a5887d96f
commit 64a26617a2
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
2 changed files with 4 additions and 4 deletions

View File

@ -1091,12 +1091,12 @@ public class AndroidUtilities {
public static Typeface getTypeface(String assetPath) {
synchronized (typefaceCache) {
if (NekoConfig.typeface == 1) {
if (NekoConfig.typeface == 1 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (assetPath.contains("medium") && assetPath.contains("italic")) {
return Typeface.create(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP ? "sans-serif-medium" : "sans-serif", Typeface.ITALIC);
return Typeface.create("sans-serif-medium", Typeface.ITALIC);
}
if (assetPath.contains("medium")) {
return Typeface.create(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP ? "sans-serif-medium" : "sans-serif", Typeface.NORMAL);
return Typeface.create("sans-serif-medium", Typeface.NORMAL);
}
if (assetPath.contains("italic")) {
return Typeface.create((Typeface) null, Typeface.ITALIC);

View File

@ -570,7 +570,7 @@ public class NekoSettingsActivity extends BaseFragment {
chat2Row = rowCount++;
settingsRow = rowCount++;
hidePhoneRow = rowCount++;
typefaceRow = rowCount++;
typefaceRow = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? rowCount++ : -1;
transparentStatusBarRow = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? rowCount++ : -1;
forceTabletRow = rowCount++;
openArchiveOnPullRow = rowCount++;