[SetupWizardLib] Post checkScroll in BottomScrollView
In BottomScrollView, post the checkScroll instead of running it immediately from onLayout, so that views that change within the callbacks will be re-laid-out. Bug: 19635676 Change-Id: I0c8b47abd8c40c0c44da8498e1397b1940cce0b3
This commit is contained in:
parent
250655b0b7
commit
4afdb145d4
|
@ -37,6 +37,13 @@ public class BottomScrollView extends ScrollView {
|
||||||
private int mScrollThreshold;
|
private int mScrollThreshold;
|
||||||
private boolean mRequiringScroll = false;
|
private boolean mRequiringScroll = false;
|
||||||
|
|
||||||
|
private final Runnable mCheckScrollRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
checkScroll();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public BottomScrollView(Context context) {
|
public BottomScrollView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +69,10 @@ public class BottomScrollView extends ScrollView {
|
||||||
- getPaddingBottom());
|
- getPaddingBottom());
|
||||||
}
|
}
|
||||||
if (b - t > 0) {
|
if (b - t > 0) {
|
||||||
checkScroll();
|
// Post check scroll in the next run loop, so that the callback methods will be invoked
|
||||||
|
// after the layout pass. This way a new layout pass will be scheduled if view
|
||||||
|
// properties are changed in the callbacks.
|
||||||
|
post(mCheckScrollRunnable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue