Don't crash if getWidth is 0
Bug: 79203256 Change-Id: I3f91adbda40931e882c4f768794a0d803730805e
This commit is contained in:
parent
f325b19de3
commit
181968b87b
|
@ -780,7 +780,12 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
|
|||
int scrollForSecondTask = mRecentsView.getChildCount() > 1
|
||||
? mRecentsView.getScrollForPage(1) : scrollForFirstTask;
|
||||
int offsetFromFirstTask = scrollForFirstTask - scrollForSecondTask;
|
||||
float interpolation = offsetFromFirstTask / (mRecentsView.getWidth() / 2);
|
||||
final float interpolation;
|
||||
if (mRecentsView.getWidth() == 0) {
|
||||
interpolation = scrollForSecondTask == scrollForFirstTask ? 0 : 1;
|
||||
} else {
|
||||
interpolation = (float) offsetFromFirstTask / (mRecentsView.getWidth() / 2);
|
||||
}
|
||||
mClipAnimationHelper.offsetTarget(
|
||||
firstTask.getCurveScaleForInterpolation(interpolation), offsetFromFirstTask,
|
||||
mActivityControlHelper.getTranslationYForQuickScrub(mActivity));
|
||||
|
|
Loading…
Reference in New Issue