[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:
Maurice Lam 2015-03-10 13:07:09 -07:00
parent 250655b0b7
commit 4afdb145d4

View file

@ -37,6 +37,13 @@ public class BottomScrollView extends ScrollView {
private int mScrollThreshold;
private boolean mRequiringScroll = false;
private final Runnable mCheckScrollRunnable = new Runnable() {
@Override
public void run() {
checkScroll();
}
};
public BottomScrollView(Context context) {
super(context);
}
@ -62,7 +69,10 @@ public class BottomScrollView extends ScrollView {
- getPaddingBottom());
}
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);
}
}