We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在华为mate10上使用该框架,日志显示改变了targetDensity 等参数,但在onResume页面打印,参数并未更改成功,页面布局也没有自动适配,android环境为 9.0.
com.sykj.iot.view.device.lamp.LampActivity has been adapted! LampActivity Info: isBaseOnWidth = false, designHeightInDp = 667.000000, designHeightInSubunits = 667.000000, targetDensity = 2.602699, targetScaledDensity = 2.602699, targetDensityDpi = 416, targetXdpi = 2.602699
12-24 14:53:39.347 24711-24711/com.sykj.iotdev I/LampActivity: dm.density=[3.0] dm.densityDpi=[480] 12-24 14:53:39.347 24711-24711/com.sykj.iotdev I/LampActivity: dm.widthPixels=[1080] dm.heightPixels=[1808]
12-24 14:53:39.337 24711-24711/com.sykj.iotdev D/AndroidAutoSize: com.sykj.iot.view.device.lamp.LampActivity onAdaptBefore! 12-24 14:53:39.337 24711-24711/com.sykj.iotdev D/AndroidAutoSize: com.sykj.iot.view.device.lamp.LampActivity used the global configuration. 12-24 14:53:39.339 24711-24711/com.sykj.iotdev D/AndroidAutoSize: The com.sykj.iot.view.device.lamp.LampActivity has been adapted! LampActivity Info: isBaseOnWidth = false, designHeightInDp = 667.000000, designHeightInSubunits = 667.000000, targetDensity = 2.602699, targetScaledDensity = 2.602699, targetDensityDpi = 416, targetXdpi = 2.602699
AutoSizeConfig.getInstance().setCustomFragment(true) //屏幕适配监听器 .setOnAdaptListener(new onAdaptListener() { @Override public void onAdaptBefore(Object target, Activity activity) { //使用以下代码, 可支持 Android 的分屏或缩放模式, 但前提是在分屏或缩放模式下当用户改变您 App 的窗口大小时 //系统会重绘当前的页面, 经测试在某些机型, 某些情况下系统不会重绘当前页面, ScreenUtils.getScreenSize(activity) 的参数一定要不要传 Application!!! // AutoSizeConfig.getInstance().setScreenWidth(ScreenUtils.getScreenSize(activity)[0]); // AutoSizeConfig.getInstance().setScreenHeight(ScreenUtils.getScreenSize(activity)[1]); LogUtils.d(String.format(Locale.ENGLISH, "%s onAdaptBefore!", target.getClass().getName())); } @Override public void onAdaptAfter(Object target, Activity activity) { LogUtils.d(String.format(Locale.ENGLISH, "%s onAdaptAfter!", target.getClass().getName())); } }).setUseDeviceSize(false).setBaseOnWidth(false);
The text was updated successfully, but these errors were encountered:
#13 (comment)
Sorry, something went wrong.
我也遇到了这个问题,华为手机好像就是诡异的事比较多==
No branches or pull requests
在华为mate10上使用该框架,日志显示改变了targetDensity 等参数,但在onResume页面打印,参数并未更改成功,页面布局也没有自动适配,android环境为 9.0.
com.sykj.iot.view.device.lamp.LampActivity has been adapted!
LampActivity Info: isBaseOnWidth = false, designHeightInDp = 667.000000, designHeightInSubunits = 667.000000, targetDensity = 2.602699, targetScaledDensity = 2.602699, targetDensityDpi = 416, targetXdpi = 2.602699
12-24 14:53:39.347 24711-24711/com.sykj.iotdev I/LampActivity: dm.density=[3.0] dm.densityDpi=[480]
12-24 14:53:39.347 24711-24711/com.sykj.iotdev I/LampActivity: dm.widthPixels=[1080] dm.heightPixels=[1808]
Environment
Bug Description:
Log:
Screenshot
Related Code:
Others:
The text was updated successfully, but these errors were encountered: