| | |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.support.v4.app.FragmentActivity; |
| | | import android.view.View; |
| | | import android.view.Window; |
| | | import android.view.WindowManager; |
| | | import android.widget.LinearLayout; |
| | | |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | |
| | |
| | | @Override |
| | | public Resources getResources() { |
| | | Resources res = super.getResources(); |
| | | // if (res.getConfiguration().fontScale != 1) {//非默认值 |
| | | Configuration newConfig = new Configuration(); |
| | | newConfig.setToDefaults();//设置默认 |
| | | newConfig.fontScale = 1.0f; |
| | | res.updateConfiguration(newConfig, res.getDisplayMetrics()); |
| | | // } |
| | | |
| | | try { |
| | | if (Build.BRAND.toLowerCase().equalsIgnoreCase("xiaomi")) { |
| | | if (res.getConfiguration().fontScale != 1.1) { |
| | | newConfig.fontScale = 1.1f; |
| | | res.updateConfiguration(newConfig, res.getDisplayMetrics()); |
| | | } |
| | | } else { |
| | | if (res.getConfiguration().fontScale != 1) { |
| | | newConfig.fontScale = 1.0f; |
| | | res.updateConfiguration(newConfig, res.getDisplayMetrics()); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | res.updateConfiguration(newConfig, res.getDisplayMetrics()); |
| | | } |
| | | return res; |
| | | } |
| | | |