mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Change TaskIconMenu to lay out vertically
Still lays out horizontally when in phone landscape. TODO(b/186583656), need to center view. Also have all layout be dynamic instead of having some cases be in XML and some in code. Bug: 181704764 Test: Task menu visible with all options in portrait/landscape tablet portrait phone fake/real landscape phone Change-Id: I3632eeb174f3e4baf2c9d69d51c1815c3c512e59
This commit is contained in:
@@ -253,14 +253,34 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTaskMenuLayoutOrientation(boolean canRecentsActivityRotate,
|
||||
public void setTaskMenuLayoutOrientation(DeviceProfile deviceProfile,
|
||||
LinearLayout taskMenuLayout) {
|
||||
return canRecentsActivityRotate ? taskMenuLayout.getOrientation() : LinearLayout.VERTICAL;
|
||||
if (deviceProfile.isLandscape && !deviceProfile.isTablet) {
|
||||
// Phone landscape
|
||||
taskMenuLayout.setOrientation(LinearLayout.HORIZONTAL);
|
||||
} else {
|
||||
// Phone Portrait, LargeScreen Landscape/Portrait
|
||||
taskMenuLayout.setOrientation(LinearLayout.VERTICAL);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayoutParamsForTaskMenuOptionItem(LinearLayout.LayoutParams lp) {
|
||||
// no-op, defaults are fine
|
||||
public void setLayoutParamsForTaskMenuOptionItem(LinearLayout.LayoutParams lp,
|
||||
LinearLayout viewGroup, DeviceProfile deviceProfile) {
|
||||
if (deviceProfile.isLandscape && !deviceProfile.isTablet) {
|
||||
// Phone landscape
|
||||
viewGroup.setOrientation(LinearLayout.VERTICAL);
|
||||
lp.width = 0;
|
||||
lp.weight = 1;
|
||||
Utilities.setStartMarginForView(viewGroup.findViewById(R.id.text), 0);
|
||||
Utilities.setStartMarginForView(viewGroup.findViewById(R.id.icon), 0);
|
||||
} else {
|
||||
// Phone Portrait, LargeScreen Landscape/Portrait
|
||||
viewGroup.setOrientation(LinearLayout.HORIZONTAL);
|
||||
lp.width = LinearLayout.LayoutParams.WRAP_CONTENT;
|
||||
}
|
||||
|
||||
lp.height = LinearLayout.LayoutParams.WRAP_CONTENT;
|
||||
}
|
||||
|
||||
/* ---------- The following are only used by TaskViewTouchHandler. ---------- */
|
||||
|
||||
Reference in New Issue
Block a user