|
|
@@ -7,17 +7,19 @@ import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.content.pm.PackageInfo;
|
|
|
import android.content.pm.PackageManager;
|
|
|
+import android.content.res.Configuration;
|
|
|
+import android.content.res.Resources;
|
|
|
import android.graphics.Bitmap;
|
|
|
import android.net.Uri;
|
|
|
import android.net.http.SslError;
|
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
-import android.support.v4.app.ActivityCompat;
|
|
|
-import android.support.v4.content.PermissionChecker;
|
|
|
-import android.support.v7.app.ActionBar;
|
|
|
-import android.support.v7.app.AlertDialog;
|
|
|
-import android.support.v7.app.AppCompatActivity;
|
|
|
+import androidx.core.app.ActivityCompat;
|
|
|
+import androidx.core.content.PermissionChecker;
|
|
|
+import androidx.appcompat.app.ActionBar;
|
|
|
+import androidx.appcompat.app.AlertDialog;
|
|
|
+import androidx.appcompat.app.AppCompatActivity;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
@@ -27,7 +29,6 @@ import android.webkit.SslErrorHandler;
|
|
|
import android.webkit.ValueCallback;
|
|
|
import android.webkit.WebResourceRequest;
|
|
|
import android.webkit.WebResourceResponse;
|
|
|
-import android.webkit.WebSettings;
|
|
|
import android.webkit.WebView;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.ProgressBar;
|
|
|
@@ -1431,6 +1432,38 @@ public void QueryLaunchNotification(String msg) {
|
|
|
return FileManager.base64StringFromFile(path);
|
|
|
}
|
|
|
|
|
|
+// @Override
|
|
|
+// public Resources getResources() {
|
|
|
+// Resources resources = super.getResources();
|
|
|
+// Configuration config = resources.getConfiguration();
|
|
|
+// if(config.fontScale != 1.0f) {
|
|
|
+// config.fontScale = 1.0f;
|
|
|
+// return self.createConfigurationContext(config).getResources();
|
|
|
+// } else {
|
|
|
+// return resources;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// endregion
|
|
|
|
|
|
// region Local Callback
|