File tree Expand file tree Collapse file tree 4 files changed +63
-9
lines changed Expand file tree Collapse file tree 4 files changed +63
-9
lines changed Original file line number Diff line number Diff line change 22
33<p align =" center " >
44 <a href =" https://bintray.com/jessyancoding/maven/autosize/_latestVersion " >
5- <img src="https://img.shields.io/badge/Jcenter-v0.7 .0-brightgreen.svg?style=flat-square" alt="Latest Stable Version" />
5+ <img src="https://img.shields.io/badge/Jcenter-v0.8 .0-brightgreen.svg?style=flat-square" alt="Latest Stable Version" />
66 </a >
77 <a href =" https://travis-ci.org/JessYanCoding/AndroidAutoSize " >
88 <img src="https://travis-ci.org/JessYanCoding/AndroidAutoSize.svg?branch=master" alt="Build Status" />
7070
7171## Download
7272``` gradle
73- implementation 'me.jessyan:autosize:0.7 .0'
73+ implementation 'me.jessyan:autosize:0.8 .0'
7474```
7575
7676## Usage
9191
9292## Advanced (以下用法看不懂?答应我,认真看 Demo 好不好?)
9393
94- * ** 当某个页面的设计图尺寸与在 AndroidManifest 中填写的全局设计图尺寸不同时,可以实现 CustomAdapt 接口扩展适配参数**
94+ ### Activity
95+ * ** 当某个 Activity 的设计图尺寸与在 AndroidManifest 中填写的全局设计图尺寸不同时,可以实现 CustomAdapt 接口扩展适配参数**
9596``` java
9697public class CustomAdaptActivity extends AppCompatActivity implements CustomAdapt {
9798
@@ -108,14 +109,40 @@ public class CustomAdaptActivity extends AppCompatActivity implements CustomAdap
108109
109110```
110111
111- * ** 当某个页面想放弃适配 ,请实现 CancelAdapt 接口**
112+ * ** 当某个 Activity 想放弃适配 ,请实现 CancelAdapt 接口**
112113``` java
113114public class CancelAdaptActivity extends AppCompatActivity implements CancelAdapt {
114115
115116}
116117
117118```
118119
120+ ### Fragment
121+ * ** 当某个 Fragment 的设计图尺寸与在 AndroidManifest 中填写的全局设计图尺寸不同时,可以实现 CustomAdapt 接口扩展适配参数**
122+ ``` java
123+ public class CustomAdaptFragment extends Fragment implements CustomAdapt {
124+
125+ @Override
126+ public boolean isBaseOnWidth () {
127+ return false ;
128+ }
129+
130+ @Override
131+ public float getSizeInDp () {
132+ return 667 ;
133+ }
134+ }
135+
136+ ```
137+
138+ * ** 当某个 Fragment 想放弃适配,请实现 CancelAdapt 接口**
139+ ``` java
140+ public class CancelAdaptFragment extends Fragment implements CancelAdapt {
141+
142+ }
143+
144+ ```
145+
119146## ProGuard
120147```
121148 -keep class me.jessyan.autosize.** { *; }
Original file line number Diff line number Diff line change 22
33<p align =" center " >
44 <a href =" https://bintray.com/jessyancoding/maven/autosize/_latestVersion " >
5- <img src="https://img.shields.io/badge/Jcenter-v0.7 .0-brightgreen.svg?style=flat-square" alt="Latest Stable Version" />
5+ <img src="https://img.shields.io/badge/Jcenter-v0.8 .0-brightgreen.svg?style=flat-square" alt="Latest Stable Version" />
66 </a >
77 <a href =" https://travis-ci.org/JessYanCoding/AndroidAutoSize " >
88 <img src="https://travis-ci.org/JessYanCoding/AndroidAutoSize.svg?branch=master" alt="Build Status" />
7272
7373## Download
7474``` gradle
75- implementation 'me.jessyan:autosize:0.7 .0'
75+ implementation 'me.jessyan:autosize:0.8 .0'
7676```
7777
7878## Usage (just one steps)
9393
9494## Advance (see demo)
9595
96+ ### Activity
9697* ** Customize the adaptation parameters of the Activity:**
9798``` java
9899public class CustomAdaptActivity extends AppCompatActivity implements CustomAdapt {
@@ -118,6 +119,32 @@ public class CancelAdaptActivity extends AppCompatActivity implements CancelAdap
118119
119120```
120121
122+ ### Fragment
123+ * ** Customize the adaptation parameters of the Fragment:**
124+ ``` java
125+ public class CustomAdaptFragment extends Fragment implements CustomAdapt {
126+
127+ @Override
128+ public boolean isBaseOnWidth () {
129+ return false ;
130+ }
131+
132+ @Override
133+ public float getSizeInDp () {
134+ return 667 ;
135+ }
136+ }
137+
138+ ```
139+
140+ * ** Cancel the adaptation of the Fragment:**
141+ ``` java
142+ public class CancelAdaptFragment extends Fragment implements CancelAdapt {
143+
144+ }
145+
146+ ```
147+
121148## ProGuard
122149```
123150 -keep class me.jessyan.autosize.** { *; }
Original file line number Diff line number Diff line change 2929 targetSdkVersion = 27
3030 compileSdkVersion = 27
3131 buildToolsVersion = " 27.0.3"
32- versionCode = 15
33- versionName = " 0.7 .0"
32+ versionCode = 18
33+ versionName = " 0.8 .0"
3434}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ android {
2121}
2222
2323dependencies {
24- // implementation 'me.jessyan:autosize:0.7 .0'
24+ // implementation 'me.jessyan:autosize:0.8 .0'
2525 implementation project(' :autosize' )
2626 implementation ' com.android.support:appcompat-v7:27.1.1'
2727 implementation ' cat.ereza:customactivityoncrash:2.2.0'
You can’t perform that action at this time.
0 commit comments