Launcher3: add qsb hotseat top margin config
Change-Id: I0afa0aa919fc6c937dacfdbcb2928b70ecab003a
diff --git a/res/values/custom_dimens.xml b/res/values/custom_dimens.xml
new file mode 100644
index 0000000..ddf8791
--- /dev/null
+++ b/res/values/custom_dimens.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 The OmniROM Project
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <dimen name="hotseat_qsb_margin_top">8dp</dimen>
+
+</resources>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index a403544..dc37cba 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -232,6 +232,7 @@
public final int hotseatQsbHeight;
public final int hotseatQsbVisualHeight;
private final int hotseatQsbShadowHeight;
+ private final int hotseatQsbMarginTop;
public int hotseatBorderSpace;
private final int mMinHotseatIconSpacePx;
private final int mMinHotseatQsbWidthPx;
@@ -544,6 +545,7 @@
hotseatQsbHeight = Utilities.showHotseatQsbWidget(context) ? res.getDimensionPixelSize(R.dimen.qsb_widget_height) : 0;
hotseatQsbShadowHeight = res.getDimensionPixelSize(R.dimen.qsb_shadow_height);
hotseatQsbVisualHeight = hotseatQsbHeight - 2 * hotseatQsbShadowHeight;
+ hotseatQsbMarginTop = res.getDimensionPixelSize(R.dimen.hotseat_qsb_margin_top);
// Whether QSB might be inline in appropriate orientation (e.g. landscape).
boolean canQsbInline = (isTwoPanels ? inv.inlineQsb[INDEX_TWO_PANEL_PORTRAIT]
@@ -1927,7 +1929,7 @@
} else if (isTaskbarPresent) { // QSB on top
return hotseatBarSizePx - hotseatQsbHeight + hotseatQsbShadowHeight;
} else {
- return hotseatBarBottomSpacePx - hotseatQsbShadowHeight;
+ return hotseatBarBottomSpacePx - hotseatQsbShadowHeight - hotseatQsbMarginTop;
}
}