Merge "Take account of IME insets" into tm-qpr-dev am: 8693d0a52f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19193075 Change-Id: I29b9b5db1f0ccadfa317234f52d31beeca868be5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -22,13 +22,11 @@ import static android.view.MotionEvent.ACTION_UP;
|
||||
|
||||
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Property;
|
||||
import android.view.MotionEvent;
|
||||
@@ -550,18 +548,24 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
|
||||
}
|
||||
|
||||
@Override
|
||||
@TargetApi(Build.VERSION_CODES.Q)
|
||||
public WindowInsets dispatchApplyWindowInsets(WindowInsets insets) {
|
||||
if (Utilities.ATLEAST_Q) {
|
||||
Insets gestureInsets = insets.getMandatorySystemGestureInsets();
|
||||
int gestureInsetBottom = gestureInsets.bottom;
|
||||
Insets imeInset = Utilities.ATLEAST_R
|
||||
? insets.getInsets(WindowInsets.Type.ime())
|
||||
: Insets.NONE;
|
||||
DeviceProfile dp = mActivity.getDeviceProfile();
|
||||
if (dp.isTaskbarPresent) {
|
||||
// Ignore taskbar gesture insets to avoid interfering with TouchControllers.
|
||||
gestureInsetBottom = Math.max(0, gestureInsetBottom - dp.taskbarSize);
|
||||
}
|
||||
mSystemGestureRegion.set(gestureInsets.left, gestureInsets.top,
|
||||
gestureInsets.right, gestureInsetBottom);
|
||||
mSystemGestureRegion.set(
|
||||
Math.max(gestureInsets.left, imeInset.left),
|
||||
Math.max(gestureInsets.top, imeInset.top),
|
||||
Math.max(gestureInsets.right, imeInset.right),
|
||||
Math.max(gestureInsetBottom, imeInset.bottom)
|
||||
);
|
||||
}
|
||||
return super.dispatchApplyWindowInsets(insets);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user