Merge "Avoid dividing 0 by 0 in StackScrollAlgorithm." into tm-qpr-dev am: 2ba952ac0c am: d076b96d73
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20069093 Change-Id: Ic02e5e80684d730b22d7c42d10cbd8c4e2014232 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -884,6 +884,9 @@ public class StackScrollAlgorithm {
|
||||
childViewState.zTranslation = baseZ;
|
||||
} else {
|
||||
float factor = (notificationEnd - shelfStart) / shelfHeight;
|
||||
if (Float.isNaN(factor)) { // Avoid problems when the above is 0/0.
|
||||
factor = 1.0f;
|
||||
}
|
||||
factor = Math.min(factor, 1.0f);
|
||||
childViewState.zTranslation = baseZ + factor * zDistanceBetweenElements;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user