2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-02 03:40:16 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/16422: Handle theme for tab history bottom sheet.

This commit is contained in:
mcarare 2020-12-14 19:12:06 +02:00 committed by Mihai Adrian Carare
parent 6019e8c907
commit 2d3fdfdf54
2 changed files with 5 additions and 11 deletions

View File

@ -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(

View File

@ -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 -->