From 1898d16ee0e0172a177fd8c6c06f4352f7b901c4 Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Thu, 9 Mar 2023 11:26:55 -0800 Subject: [PATCH] [Predictive Back] Fix small bottom gap in widget to home animation The bug was caused by a math problem. The extrat bottom offset should be offset = (H / 0.9 - H) / 2 Fix: b/269393854 Test: manual Change-Id: Ia4d6b3f2ecb53b82d6779cd385ce4d7ca3c16113 --- src/com/android/launcher3/views/AbstractSlideInView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java index e2f1c04ced..ebae00d223 100644 --- a/src/com/android/launcher3/views/AbstractSlideInView.java +++ b/src/com/android/launcher3/views/AbstractSlideInView.java @@ -236,8 +236,8 @@ public abstract class AbstractSlideInView /** Return extra space revealed during predictive back animation. */ @Px protected int getBottomOffsetPx() { - return (int) (getMeasuredHeight() - * (1 - PREDICTIVE_BACK_MIN_SCALE) / 2); + final int height = getMeasuredHeight(); + return (int) ((height / PREDICTIVE_BACK_MIN_SCALE - height) / 2); } /**