Upping to Material lib 1.4.0 beta

Which has tablet changes for the bottom sheets and makes it easier to do edge2edge for bottom sheets
This commit is contained in:
Jays2Kings 2021-05-22 23:10:39 -04:00
parent 1fba86886c
commit b3646b8f5f
3 changed files with 2 additions and 9 deletions

View File

@ -97,7 +97,7 @@ dependencies {
// Android X libraries // Android X libraries
implementation("androidx.appcompat:appcompat:1.3.0-rc01") implementation("androidx.appcompat:appcompat:1.3.0-rc01")
implementation("androidx.cardview:cardview:1.0.0") implementation("androidx.cardview:cardview:1.0.0")
implementation("com.google.android.material:material:1.3.0") implementation("com.google.android.material:material:1.4.0-beta01")
implementation("androidx.recyclerview:recyclerview:1.2.0") implementation("androidx.recyclerview:recyclerview:1.2.0")
implementation("androidx.preference:preference:1.1.1") implementation("androidx.preference:preference:1.1.1")
implementation("androidx.annotation:annotation:1.2.0") implementation("androidx.annotation:annotation:1.2.0")

View File

@ -31,20 +31,12 @@ abstract class E2EBottomSheetDialog<VB : ViewBinding>(activity: Activity) :
val contentView = binding.root val contentView = binding.root
window?.setBackgroundDrawable(null)
window?.navigationBarColor = activity.window.navigationBarColor window?.navigationBarColor = activity.window.navigationBarColor
val isLight = (activity.window?.decorView?.systemUiVisibility ?: 0) and View val isLight = (activity.window?.decorView?.systemUiVisibility ?: 0) and View
.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR == View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR == View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isLight) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isLight) {
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
} }
window?.findViewById<View>(com.google.android.material.R.id.container)?.fitsSystemWindows =
false
window?.findViewById<View>(com.google.android.material.R.id.coordinator)?.fitsSystemWindows =
false
contentView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View
.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
val insets = activity.window.decorView.rootWindowInsets val insets = activity.window.decorView.rootWindowInsets
(contentView.parent as View).background = null (contentView.parent as View).background = null
contentView.post { contentView.post {

View File

@ -185,6 +185,7 @@
<item name="android:windowIsFloating">false</item> <item name="android:windowIsFloating">false</item>
<item name="android:colorBackground">@android:color/transparent</item> <item name="android:colorBackground">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="enableEdgeToEdge">true</item>
</style> </style>
<style name="OverflowDialogTheme" parent="BottomSheetDialogTheme"> <style name="OverflowDialogTheme" parent="BottomSheetDialogTheme">