mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Implement swipe gesture for staged split in landscape
* Maintain task split percentages when swiping up. * Split percentages not maintained in GroupedTaskView, however. That is a TODO. Bug: 181704764, 181705607 Test: Swiped up in landscape with home rotation on/off. Portrait still works. Change-Id: Iec62abae34f6ccadf98e2afdc9409cf3160f8223
This commit is contained in:
@@ -89,12 +89,24 @@ public final class SplitConfigurationOptions {
|
||||
public final Rect mLeftTopBounds;
|
||||
public final Rect mRightBottomBounds;
|
||||
public final Rect mDividerBounds;
|
||||
// This class is orientation-agnostic, so we compute both for later use
|
||||
public final float mTopTaskPercent;
|
||||
public final float mLeftTaskPercent;
|
||||
|
||||
|
||||
public StagedSplitBounds(Rect leftTopBounds, Rect rightBottomBounds, Rect dividerBounds) {
|
||||
mLeftTopBounds = leftTopBounds;
|
||||
mRightBottomBounds = rightBottomBounds;
|
||||
mDividerBounds = dividerBounds;
|
||||
float totalHeight = mLeftTopBounds.height()
|
||||
+ mRightBottomBounds.height()
|
||||
+ mDividerBounds.height();
|
||||
float totalWidth = mLeftTopBounds.width()
|
||||
+ mRightBottomBounds.width()
|
||||
+ mDividerBounds.width();
|
||||
|
||||
mLeftTaskPercent = mLeftTopBounds.width() / totalWidth;
|
||||
mTopTaskPercent = mLeftTopBounds.height() / totalHeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user