@@ -85,7 +85,7 @@ values 目录下的 dimens.xml
8585
8686## 第二种适配方式 - DisplayMetrics.densityDpi 属性修改
8787插件版本:
88- [ ![ Download] ( https://api.bintray.com/packages/bugyun/maven/screen-helper/images/download.svg?version=1.0.1 ) ] ( https://bintray.com/bugyun/maven/screen-helper/1.0.1 /link )
88+ [ ![ Download] ( https://api.bintray.com/packages/bugyun/maven/screen-helper/images/download.svg?version=1.0.2 ) ] ( https://bintray.com/bugyun/maven/screen-helper/1.0.2 /link )
8989
9090在项目的根 build.gradle 中添加 jcenter 仓库
9191``` java
@@ -107,7 +107,7 @@ allprojects {
107107然后在子项目中的 build.gradle 文件中添加
108108``` java
109109dependencies {
110- implementation ' vip.ruoyun.helper:screen-helper:1.0.1 '
110+ implementation ' vip.ruoyun.helper:screen-helper:1.0.2 '
111111}
112112```
113113
@@ -116,7 +116,7 @@ dependencies {
116116public class MainActivity extends AppCompatActivity {
117117 @Override
118118 public Resources getResources () {
119- return ScreenHelper . applyAdapt(super . getResources(), 450f , ScreenHelper . ScreenMode . WIDTH_DP );
119+ return ScreenHelper . applyAdapt(super . getResources(), 450f , ScreenHelper . WIDTH_DP );
120120 }
121121}
122122```
@@ -127,17 +127,18 @@ public class MainActivity extends AppCompatActivity {
127127public class App extends Application {
128128 @Override
129129 public Resources getResources () {
130- return ScreenHelper . applyAdapt(super . getResources(), 450f , ScreenHelper . ScreenMode . WIDTH_DP );
130+ return ScreenHelper . applyAdapt(super . getResources(), 450f , ScreenHelper . WIDTH_DP );
131131 }
132132}
133133```
134134
135135#### 类型
136- - ScreenHelper.ScreenMode. WIDTH_DP 以 dp 来适配,在 xml 中使用 dp 单位
137- - ScreenHelper.ScreenMode. WIDTH_PT 以 pt 来适配,在 xml 中使用 pt 单位
138- - ScreenHelper.ScreenMode. HEIGHT_PT 以 pt 来适配,在 xml 中使用 pt 单位
136+ - ScreenHelper.WIDTH_DP 以 dp 来适配,在 xml 中使用 dp 单位
137+ - ScreenHelper.WIDTH_PT 以 pt 来适配,在 xml 中使用 pt 单位
138+ - ScreenHelper.HEIGHT_PT 以 pt 来适配,在 xml 中使用 pt 单位
139139
140140
141141#### 版本变化
142+ - 1.0.2 :优化传递 ScreenMode 的参数传递,去除不必要的 log
142143- 1.0.1 :优化 Resources.getSystem() 变量获取,由于此方法是 synchronized ,如果频繁调用会影响性能
143144- 1.0.0 :正式发版
0 commit comments