File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
demo/src/main/java/me/jessyan/autosize/demo Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1919import android .app .Application ;
2020import android .util .DisplayMetrics ;
2121
22+ import java .util .Locale ;
23+
2224import cat .ereza .customactivityoncrash .activity .DefaultErrorActivity ;
2325import me .jessyan .autosize .AutoSize ;
2426import me .jessyan .autosize .AutoSizeConfig ;
2527import me .jessyan .autosize .external .ExternalAdaptInfo ;
2628import me .jessyan .autosize .external .ExternalAdaptManager ;
2729import me .jessyan .autosize .internal .CustomAdapt ;
30+ import me .jessyan .autosize .onAdaptListener ;
31+ import me .jessyan .autosize .utils .LogUtils ;
2832
2933/**
3034 * ================================================
@@ -58,6 +62,19 @@ public void onCreate() {
5862 //如果没有这个需求建议不开启
5963 .setCustomFragment (true )
6064
65+ //屏幕适配监听器
66+ .setOnAdaptListener (new onAdaptListener () {
67+ @ Override
68+ public void onAdaptBefore (Object target , Activity activity ) {
69+ LogUtils .d (String .format (Locale .ENGLISH , "%s onAdaptBefore!" , target .getClass ().getName ()));
70+ }
71+
72+ @ Override
73+ public void onAdaptAfter (Object target , Activity activity ) {
74+ LogUtils .d (String .format (Locale .ENGLISH , "%s onAdaptAfter!" , target .getClass ().getName ()));
75+ }
76+ })
77+
6178 //是否打印 AutoSize 的内部日志, 默认为 true, 如果您不想 AutoSize 打印日志, 则请设置为 false
6279// .setLog(false)
6380
You can’t perform that action at this time.
0 commit comments