Skip to content

Commit 93429b9

Browse files
committed
Improve WrapperAutoAdaptStrategy
1 parent 3df2736 commit 93429b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

autosize/src/main/java/me/jessyan/autosize/WrapperAutoAdaptStrategy.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* ================================================
2222
* {@link AutoAdaptStrategy} 的包装者, 用于给 {@link AutoAdaptStrategy} 的实现类增加一些额外的职责
23-
*
23+
* <p>
2424
* Created by JessYan on 2018/10/30 15:07
2525
* <a href="mailto:[email protected]">Contact me</a>
2626
* <a href="https://github.com/JessYanCoding">Follow me</a>
@@ -35,8 +35,15 @@ public WrapperAutoAdaptStrategy(AutoAdaptStrategy autoAdaptStrategy) {
3535

3636
@Override
3737
public void applyAdapt(Object target, Activity activity) {
38+
onAdaptListener onAdaptListener = AutoSizeConfig.getInstance().getOnAdaptListener();
39+
if (onAdaptListener != null){
40+
onAdaptListener.onAdaptBefore(target, activity);
41+
}
3842
if (mAutoAdaptStrategy != null) {
3943
mAutoAdaptStrategy.applyAdapt(target, activity);
4044
}
45+
if (onAdaptListener != null){
46+
onAdaptListener.onAdaptAfter(target, activity);
47+
}
4148
}
4249
}

0 commit comments

Comments
 (0)