|
|
@@ -3,6 +3,8 @@ package com.sheep.jiuyan.samllsheep;
|
|
|
import android.app.Activity;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
+import android.content.res.Configuration;
|
|
|
+import android.content.res.Resources;
|
|
|
import android.net.Uri;
|
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
@@ -222,6 +224,27 @@ public class SheepApp extends MultiDexApplication {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ //设置字体为默认大小,不随系统字体大小改而改变
|
|
|
+ @Override
|
|
|
+ public void onConfigurationChanged(Configuration newConfig) {
|
|
|
+ if (newConfig.fontScale != 1)//非默认值
|
|
|
+ getResources();
|
|
|
+ super.onConfigurationChanged(newConfig);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Resources getResources() {
|
|
|
+ Resources res = super.getResources();
|
|
|
+ if (res.getConfiguration().fontScale != 1) {//非默认值
|
|
|
+ Configuration newConfig = new Configuration();
|
|
|
+ newConfig.setToDefaults();//设置默认
|
|
|
+ res.updateConfiguration(newConfig, res.getDisplayMetrics());
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 为webView设置目录后缀
|
|
|
*
|