Place split selection placeholder view based on option selected

* Add first split app's choosen icon inside the view

TODO: Update animation of where selected app goes.

Bug: 181704764
Test: Tested tablet + phone, real and fake landscape
Change-Id: Ia3c635b056f2ac3812a0df001bbbb38bde26f6af
This commit is contained in:
Vinit Nayak
2021-04-20 13:01:29 -07:00
parent 70938389d6
commit 0e16272049
5 changed files with 68 additions and 12 deletions

View File

@@ -311,21 +311,31 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
@Override
public List<SplitPositionOption> getSplitPositionOptions(DeviceProfile dp) {
List<SplitPositionOption> options = new ArrayList<>(1);
// Add both left and right options if we're in tablet mode
// TODO: Add in correct icons
if (dp.isSeascape()) { // or seascape
// Add left/right options
if (dp.isTablet && dp.isLandscape) {
options.add(new SplitPositionOption(
R.drawable.ic_split_screen, R.string.split_screen_position_right,
STAGE_POSITION_TOP_OR_LEFT, STAGE_TYPE_MAIN));
} else if (dp.isLandscape) {
STAGE_POSITION_BOTTOM_OR_RIGHT, STAGE_TYPE_MAIN));
options.add(new SplitPositionOption(
R.drawable.ic_split_screen, R.string.split_screen_position_left,
STAGE_POSITION_TOP_OR_LEFT, STAGE_TYPE_MAIN));
} else {
// Only add top option
options.add(new SplitPositionOption(
R.drawable.ic_split_screen, R.string.split_screen_position_top,
STAGE_POSITION_TOP_OR_LEFT, STAGE_TYPE_MAIN));
if (dp.isSeascape()) {
// Add left/right options
options.add(new SplitPositionOption(
R.drawable.ic_split_screen, R.string.split_screen_position_right,
STAGE_POSITION_BOTTOM_OR_RIGHT, STAGE_TYPE_MAIN));
} else if (dp.isLandscape) {
options.add(new SplitPositionOption(
R.drawable.ic_split_screen, R.string.split_screen_position_left,
STAGE_POSITION_TOP_OR_LEFT, STAGE_TYPE_MAIN));
} else {
// Only add top option
options.add(new SplitPositionOption(
R.drawable.ic_split_screen, R.string.split_screen_position_top,
STAGE_POSITION_TOP_OR_LEFT, STAGE_TYPE_MAIN));
}
}
return options;
}