Add funtional animation for SplitSelect from Grid.

Long ways to go to final UI - TODO(b/186800707)
Add comments to grid layout code,
no functional changes at all.

Bug: 181705607
Test: Enter split screen from overview task menu
in grid and carousel. Able to select all items
and enter split.

Change-Id: Ib62f1b286acf0781ec47862fa31b670e6ff1892a
This commit is contained in:
Vinit Nayak
2021-04-29 18:37:48 -07:00
parent 13e4618b57
commit 2dbdddb4ba
9 changed files with 255 additions and 75 deletions

View File

@@ -155,6 +155,25 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
return VIEW_TRANSLATE_Y;
}
@Override
public int getSplitTaskViewDismissDirection(SplitPositionOption splitPosition,
DeviceProfile dp) {
if (splitPosition.mStagePosition == STAGE_POSITION_TOP_OR_LEFT) {
if (dp.isLandscape) {
// Left side
return SPLIT_TRANSLATE_PRIMARY_NEGATIVE;
} else {
// Top side
return SPLIT_TRANSLATE_SECONDARY_NEGATIVE;
}
} else if (splitPosition.mStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
// We don't have a bottom option, so should be right
return SPLIT_TRANSLATE_PRIMARY_POSITIVE;
}
throw new IllegalStateException("Invalid split stage position: " +
splitPosition.mStagePosition);
}
@Override
public int getPrimaryScroll(View view) {
return view.getScrollX();