For #16422: Handle theme for tab history bottom sheet.

upstream-sync
mcarare 4 years ago committed by Mihai Adrian Carare
parent 574eac4636
commit a59195e2ee

@ -19,6 +19,7 @@ import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.mapNotNull
import mozilla.components.browser.state.selector.findCustomTabOrSelectedTab
import mozilla.components.lib.state.ext.flowScoped
import mozilla.components.support.ktx.android.content.getColorFromAttr
import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.components
@ -26,11 +27,6 @@ import org.mozilla.fenix.ext.requireComponents
class TabHistoryDialogFragment : BottomSheetDialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NO_TITLE, R.style.BottomSheet)
}
var customTabSessionId: String? = null
override fun onCreateView(
@ -43,6 +39,8 @@ class TabHistoryDialogFragment : BottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.setBackgroundColor(view.context.getColorFromAttr(R.attr.foundation))
customTabSessionId = requireArguments().getString(EXTRA_SESSION_ID)
val controller = DefaultTabHistoryController(

@ -560,16 +560,12 @@
<style name="BottomSheet" parent="@style/BottomSheetBase" />
<style name="BottomSheetBasePrivate" parent="Theme.MaterialComponents.BottomSheetDialog">
<style name="BottomSheetBasePrivate" parent="ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="android:windowIsFloating">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:colorBackground">?foundation</item>
</style>
<style name="BottomSheetBase" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<style name="BottomSheetBase" parent="ThemeOverlay.MaterialComponents.Light.BottomSheetDialog">
<item name="android:windowIsFloating">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:colorBackground">?foundation</item>
</style>
<!-- Tab Tray does not present a private theme, so it needs to be separate from other bottom sheet styles -->

Loading…
Cancel
Save