|
23 | 23 | import android.content.pm.PackageManager; |
24 | 24 | import android.content.res.Configuration; |
25 | 25 | import android.content.res.Resources; |
| 26 | +import android.support.v4.app.Fragment; |
26 | 27 | import android.util.DisplayMetrics; |
27 | 28 |
|
28 | 29 | import me.jessyan.autosize.external.ExternalAdaptManager; |
@@ -102,6 +103,10 @@ public final class AutoSizeConfig { |
102 | 103 | * @see #restart() |
103 | 104 | */ |
104 | 105 | private boolean isStop; |
| 106 | + /** |
| 107 | + * 是否让框架支持自定义 {@link Fragment} 的适配参数, 由于这个需求是比较少见的, 所以须要使用者手动开启 |
| 108 | + */ |
| 109 | + private boolean isCustomFragment; |
105 | 110 |
|
106 | 111 | public static AutoSizeConfig getInstance() { |
107 | 112 | if (sInstance == null) { |
@@ -266,6 +271,34 @@ public AutoSizeConfig setLog(boolean log) { |
266 | 271 | return this; |
267 | 272 | } |
268 | 273 |
|
| 274 | + /** |
| 275 | + * 是否让框架支持自定义 {@link Fragment} 的适配参数, 由于这个需求是比较少见的, 所以须要使用者手动开启 |
| 276 | + * |
| 277 | + * @param customFragment {@code true} 为支持 |
| 278 | + */ |
| 279 | + public AutoSizeConfig setCustomFragment(boolean customFragment) { |
| 280 | + isCustomFragment = customFragment; |
| 281 | + return this; |
| 282 | + } |
| 283 | + |
| 284 | + /** |
| 285 | + * 框架是否已经开启支持自定义 {@link Fragment} 的适配参数 |
| 286 | + * |
| 287 | + * @return {@code true} 为支持 |
| 288 | + */ |
| 289 | + public boolean isCustomFragment() { |
| 290 | + return isCustomFragment; |
| 291 | + } |
| 292 | + |
| 293 | + /** |
| 294 | + * 框架是否已经停止运行 |
| 295 | + * |
| 296 | + * @return {@code false} 框架正在运行, {@code true} 框架已经停止运行 |
| 297 | + */ |
| 298 | + public boolean isStop() { |
| 299 | + return isStop; |
| 300 | + } |
| 301 | + |
269 | 302 | /** |
270 | 303 | * {@link ExternalAdaptManager} 用来管理外部三方库 {@link Activity} 的适配 |
271 | 304 | * |
|
0 commit comments