mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Add navigation bar background for pre-Oreo bottom sheet
This commit is contained in:
@@ -52,4 +52,12 @@
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginBottom="40dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/nav_bar_bg"
|
||||
android:background="?attr/bottomSheetNavBarColor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:focusable="false" />
|
||||
|
||||
</com.google.android.apps.nexuslauncher.CustomBottomSheet>
|
||||
@@ -51,4 +51,12 @@
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginBottom="40dp"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/nav_bar_bg"
|
||||
android:background="?attr/bottomSheetNavBarColor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:focusable="false" />
|
||||
|
||||
</com.android.launcher3.widget.WidgetsBottomSheet>
|
||||
@@ -25,7 +25,4 @@
|
||||
<item name="android:statusBarColor">#00000000</item>
|
||||
<item name="android:navigationBarColor">#00000000</item>
|
||||
</style>
|
||||
<style name="WidgetContainerTheme.Dark" parent="LauncherThemeDark">
|
||||
<item name="android:colorPrimaryDark">#616161</item> <!-- Gray 700 -->
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
<style name="WidgetContainerTheme" parent="@android:style/Theme.Material.Settings">
|
||||
<item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
|
||||
<item name="android:colorAccent">@color/colorAccent</item>
|
||||
<item name="bottomSheetNavBarColor">#00000000</item>
|
||||
</style>
|
||||
<style name="WidgetContainerTheme.Dark" parent="LauncherThemeDark">
|
||||
<item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
|
||||
<item name="android:colorPrimaryDark">#616161</item> <!-- Gray 700 -->
|
||||
<item name="bottomSheetNavBarColor">#00000000</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -148,4 +148,7 @@
|
||||
<!-- Pixel -->
|
||||
<attr name="gIcon" format="reference" />
|
||||
<attr name="micIcon" format="reference" />
|
||||
|
||||
<!-- Custom -->
|
||||
<attr name="bottomSheetNavBarColor" format="color" />
|
||||
</resources>
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
<item name="android:colorEdgeEffect">?android:attr/textColorSecondaryInverse</item>
|
||||
<item name="android:textColorPrimary">?android:attr/textColorPrimaryInverse</item>
|
||||
<item name="android:textColorSecondary">?android:attr/textColorSecondaryInverse</item>
|
||||
<item name="bottomSheetNavBarColor">@color/all_apps_navbar_color</item>
|
||||
|
||||
<!-- Backports -->
|
||||
<item name="android:textColorPrimaryInverse">@color/textColorPrimaryInverse</item>
|
||||
@@ -97,7 +98,10 @@
|
||||
<item name="android:colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetContainerTheme.Dark" />
|
||||
<style name="WidgetContainerTheme.Dark" parent="LauncherThemeDark">
|
||||
<item name="android:colorPrimaryDark">#616161</item> <!-- Gray 700 -->
|
||||
<item name="bottomSheetNavBarColor">#00000000</item>
|
||||
</style>
|
||||
|
||||
<style name="FastScrollerPopup" >
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
|
||||
@@ -260,6 +260,15 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab
|
||||
int rightInset = insets.right - mInsets.right;
|
||||
int bottomInset = insets.bottom - mInsets.bottom;
|
||||
mInsets.set(insets);
|
||||
|
||||
if (!Utilities.ATLEAST_OREO && !mLauncher.getDeviceProfile().isVerticalBarLayout()) {
|
||||
View navBarBg = findViewById(R.id.nav_bar_bg);
|
||||
ViewGroup.LayoutParams navBarBgLp = navBarBg.getLayoutParams();
|
||||
navBarBgLp.height = bottomInset;
|
||||
navBarBg.setLayoutParams(navBarBgLp);
|
||||
bottomInset = 0;
|
||||
}
|
||||
|
||||
setPadding(getPaddingLeft() + leftInset, getPaddingTop(),
|
||||
getPaddingRight() + rightInset, getPaddingBottom() + bottomInset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user