Fix overview grid scroll problem
- This can be reproduced ocassionally without any obvious pattern, when this happen the page scroll and min/max scroll is messed up - When this happen, onLayout happens before the first setGridProgress call from animations - The fix is to request a relayout at the end of state transition Bug: 174464863 Test: manual Change-Id: I12683c49d7ed72349a4b9cb3b4d3871741e3e22e
This commit is contained in:
1 parent
d10382995f
commit
ae53cb246f
4 files changed
+46
-20
No files matched your search
@@ -938,31 +938,31 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
mNonRtlVisibleOffset = nonRtlVisibleOffset;
|
||||
}
|
||||
|
||||
public float getScrollAdjustment() {
|
||||
public float getScrollAdjustment(boolean fullscreenEnabled, boolean gridEnabled) {
|
||||
float scrollAdjustment = 0;
|
||||
if (mFullscreenProgress > 0) {
|
||||
if (fullscreenEnabled) {
|
||||
scrollAdjustment += mFullscreenTranslationX + mAccumulatedFullscreenTranslationX;
|
||||
}
|
||||
if (mGridProgress > 0) {
|
||||
if (gridEnabled) {
|
||||
scrollAdjustment += mGridTranslationX;
|
||||
}
|
||||
return scrollAdjustment;
|
||||
}
|
||||
|
||||
public float getOffsetAdjustment() {
|
||||
float offsetAdjustment = getScrollAdjustment();
|
||||
if (mGridProgress > 0) {
|
||||
public float getOffsetAdjustment(boolean fullscreenEnabled, boolean gridEnabled) {
|
||||
float offsetAdjustment = getScrollAdjustment(fullscreenEnabled, gridEnabled);
|
||||
if (gridEnabled) {
|
||||
offsetAdjustment += mGridOffsetTranslationX + mNonRtlVisibleOffset;
|
||||
}
|
||||
return offsetAdjustment;
|
||||
}
|
||||
|
||||
public float getSizeAdjustment() {
|
||||
public float getSizeAdjustment(boolean fullscreenEnabled, boolean gridEnabled) {
|
||||
float sizeAdjustment = 1;
|
||||
if (mFullscreenProgress > 0) {
|
||||
if (fullscreenEnabled) {
|
||||
sizeAdjustment *= mFullscreenScale;
|
||||
}
|
||||
if (mGridProgress > 0) {
|
||||
if (gridEnabled) {
|
||||
sizeAdjustment *= mGridScale;
|
||||
}
|
||||
return sizeAdjustment;
|
||||
|
||||
Reference in new issue
Block a user