-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Description
I have tried to apply a custom color to the bottom navigation bar but failed.
I tried this:
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:navigationBarColor">@color/white</item>
<item name="android:windowTranslucentNavigation">false</item>
It works for usual DialogFragment but not for the BottomSheetDialogFragment.
I tried this also:
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
dialog.setOnShowListener { dialogInterface ->
val d = dialogInterface as BottomSheetDialog
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
d.window?.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
d.window?.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
d.window?.navigationBarColor = ContextCompat.getColor(requireContext(), R.color.white)
}
}
return dialog
}
How can I change the nagivation bar color to custom? Right now it is always transparent.
touficbatache, laurencedawson, fraggjkee, guyca, mykola-dev and 7 moregit-jithinjosegit-jithinjosegit-jithinjosegit-jithinjose and dg-technologygit-jithinjosegit-jithinjosegit-jithinjose
Metadata
Metadata
Assignees
Labels
No labels