ThemePicker: Apply window insets to quick affordance fragment
Change-Id: Ia53e574c9b8cf034327183448292cd0c14858c52
diff --git a/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt b/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt
index d5f0d33..f205a1a 100644
--- a/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt
+++ b/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt
@@ -21,6 +21,7 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.view.WindowInsets
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.get
import com.android.customization.module.ThemePickerInjector
@@ -54,6 +55,18 @@
false,
)
setUpToolbar(view)
+
+ // For nav bar edge-to-edge effect.
+ view.setOnApplyWindowInsetsListener { v: View, windowInsets: WindowInsets ->
+ v.setPadding(
+ v.paddingLeft,
+ v.paddingTop,
+ v.paddingRight,
+ windowInsets.systemWindowInsetBottom
+ )
+ windowInsets.consumeSystemWindowInsets()
+ }
+
val injector = InjectorProvider.getInjector() as ThemePickerInjector
val viewModel: KeyguardQuickAffordancePickerViewModel =
ViewModelProvider(