mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Polish back-to-home animation for 3-button-nav" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
3fa3085242
@@ -390,10 +390,11 @@ public class LauncherBackAnimationController {
|
||||
// Move the window along the Y axis.
|
||||
float top = (screenHeight - height) * 0.5f + deltaY;
|
||||
// Move the window along the X axis.
|
||||
float left = event.getSwipeEdge() == BackEvent.EDGE_RIGHT
|
||||
? progress * mWindowScaleMarginX
|
||||
: screenWidth - progress * mWindowScaleMarginX - width;
|
||||
|
||||
float left = switch (event.getSwipeEdge()) {
|
||||
case BackEvent.EDGE_RIGHT -> progress * mWindowScaleMarginX;
|
||||
case BackEvent.EDGE_LEFT -> screenWidth - progress * mWindowScaleMarginX - width;
|
||||
default -> (screenWidth - width) / 2;
|
||||
};
|
||||
mCurrentRect.set(left, top, left + width, top + height);
|
||||
float cornerRadius = Utilities.mapRange(
|
||||
progress, mWindowScaleStartCornerRadius, mWindowScaleEndCornerRadius);
|
||||
|
||||
Reference in New Issue
Block a user