Skip to content

Commit 5ee2e29

Browse files
committed
Update README.md
1 parent b6f2c2f commit 5ee2e29

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

README-zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
* 如果您在 **layout** 文件中使用 **mm** 作为单位进行布局 (需要通过 **AutoSizeConfig.getInstance().getUnitsManager().setSupportSubunits(Subunits.MM);** 打开对单位 **mm** 的支持),则可以根据公式 **(sqrt(纵向分辨率^2+横向分辨率^2))/25.4** 求出屏幕尺寸,然后创建模拟设备 (**只用填写屏幕尺寸和分辨率**)
115115
![mm](art/unit_mm.png)
116116

117-
## Advanced (以下用法看不懂?答应我,认真看 Demo 好不好?)
117+
## Advanced (以下用法看不懂?答应我,认真看 demo 好不好?)
118118

119119
### Activity
120120
* **当某个 Activity 的设计图尺寸与在 AndroidManifest 中填写的全局设计图尺寸不同时,可以实现 CustomAdapt 接口扩展适配参数**

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
implementation 'me.jessyan:autosize:0.9.1'
7676
```
7777

78-
## Usage (just one steps)
79-
### Step 1
78+
## Usage
79+
### Step 1 (just one steps)
8080
* **Initialize in AndroidManifest:**
8181
```xml
8282
<manifest>
@@ -108,15 +108,13 @@ public class CustomAdaptActivity extends AppCompatActivity implements CustomAdap
108108
return 667;
109109
}
110110
}
111-
112111
```
113112

114113
* **Cancel the adaptation of the Activity:**
115114
```java
116115
public class CancelAdaptActivity extends AppCompatActivity implements CancelAdapt {
117116

118117
}
119-
120118
```
121119

122120
### Fragment
@@ -139,15 +137,24 @@ public class CustomAdaptFragment extends Fragment implements CustomAdapt {
139137
return 667;
140138
}
141139
}
142-
143140
```
144141

145142
* **Cancel the adaptation of the Fragment:**
146143
```java
147144
public class CancelAdaptFragment extends Fragment implements CancelAdapt {
148145

149146
}
147+
```
150148

149+
### Subunits (see demo-subunits)
150+
* You can choose one of the three unpopular units of **pt, in, mm** as the subunits, the subunits is used to avoid the adverse effects caused by modifying **DisplayMetrics#density**, after using the subunits, you can write the pixel size on the design, you don't need to convert it to **dp**
151+
152+
153+
```java
154+
AutoSizeConfig.getInstance().getUnitsManager()
155+
.setSupportDP(false)
156+
.setSupportSP(false)
157+
.setSupportSubunits(Subunits.MM);
151158
```
152159

153160
## ProGuard

0 commit comments

Comments
 (0)