|
@@ -1,5 +1,7 @@
|
|
|
package com.sheep.gamegroup.absBase;
|
|
package com.sheep.gamegroup.absBase;
|
|
|
|
|
|
|
|
|
|
+import android.content.res.Configuration;
|
|
|
|
|
+import android.content.res.Resources;
|
|
|
import android.graphics.Color;
|
|
import android.graphics.Color;
|
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
@@ -116,6 +118,25 @@ public abstract class BaseActivity extends RxAppCompatActivity implements BackHa
|
|
|
EventBus.getDefault().register(this);
|
|
EventBus.getDefault().register(this);
|
|
|
initSlidr();
|
|
initSlidr();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @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;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
protected boolean showWhiteStatusBar(){return false;}
|
|
protected boolean showWhiteStatusBar(){return false;}
|
|
|
protected int getTitleLayoutId(){
|
|
protected int getTitleLayoutId(){
|
|
|
return R.layout.title;
|
|
return R.layout.title;
|