Skip to content

Commit ff8752c

Browse files
hmtheboy154neobuddy89
authored andcommitted
Launcher3: Update meminfo margin when using taskbar
On tablet, when meminfo is at the bottom, the margin only set to 15dp, so you can't be able to see it when you are using a tablet with taskbar enabled. @neobuddy89: * Keep dimens only for transient taskbar * Tune dimens for 3-button navbar Change-Id: Id5968736b44628cf69fed0fe76fd3ee47e621a00 Signed-off-by: hmtheboy154 <[email protected]> Signed-off-by: Pranav Vashi <[email protected]>
1 parent e9d5c06 commit ff8752c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

quickstep/src/com/android/quickstep/views/MemInfoView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.android.quickstep.views;
1818

19+
import static com.android.launcher3.util.NavigationMode.TWO_BUTTONS;
1920
import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
2021

2122
import android.app.ActivityManager;
@@ -118,8 +119,10 @@ public void updateVerticalMargin(NavigationMode mode) {
118119
LayoutParams lp = (LayoutParams)getLayoutParams();
119120
int bottomMargin;
120121

121-
if (mode == THREE_BUTTONS)
122+
if (!mDp.isTaskbarPresent && ((mode == THREE_BUTTONS) || (mode == TWO_BUTTONS)))
122123
bottomMargin = mDp.memInfoMarginThreeButtonPx;
124+
else if (mDp.isTaskbarPresent && !((mode == THREE_BUTTONS) || (mode == TWO_BUTTONS)))
125+
bottomMargin = mDp.memInfoMarginTransientTaskbarPx;
123126
else
124127
bottomMargin = mDp.memInfoMarginGesturePx;
125128

res/values/cr_dimens.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818

1919
<!-- Meminfo in overview -->
2020
<dimen name="meminfo_bottom_margin_gesture">15dp</dimen>
21+
<dimen name="meminfo_bottom_margin_transient_taskbar">96dp</dimen>
2122
<dimen name="meminfo_bottom_margin_three_button">15dp</dimen>
23+
<dimen name="meminfo_top_margin">12dp</dimen>
2224
</resources>

src/com/android/launcher3/DeviceProfile.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ public class DeviceProfile {
323323

324324
// Meminfo in overview
325325
public int memInfoMarginGesturePx;
326+
public int memInfoMarginTransientTaskbarPx;
326327
public int memInfoMarginThreeButtonPx;
327328

328329
/** TODO: Once we fully migrate to staged split, remove "isMultiWindowMode" */
@@ -740,6 +741,8 @@ public class DeviceProfile {
740741

741742
memInfoMarginGesturePx = res.getDimensionPixelSize(
742743
R.dimen.meminfo_bottom_margin_gesture);
744+
memInfoMarginTransientTaskbarPx = res.getDimensionPixelSize(
745+
R.dimen.meminfo_bottom_margin_transient_taskbar);
743746
memInfoMarginThreeButtonPx = res.getDimensionPixelSize(
744747
R.dimen.meminfo_bottom_margin_three_button);
745748

0 commit comments

Comments
 (0)