For #12585: Close tab tray menu on orientation changes
parent
0e0183aa24
commit
27341eaaf4
|
@ -61,6 +61,7 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), UserInteractionHandler
|
||||||
|
|
||||||
private val tabsFeature = ViewBoundFeatureWrapper<TabsFeature>()
|
private val tabsFeature = ViewBoundFeatureWrapper<TabsFeature>()
|
||||||
private var _tabTrayView: TabTrayView? = null
|
private var _tabTrayView: TabTrayView? = null
|
||||||
|
private var currentOrientation: Int? = null
|
||||||
private val tabTrayView: TabTrayView
|
private val tabTrayView: TabTrayView
|
||||||
get() = _tabTrayView!!
|
get() = _tabTrayView!!
|
||||||
private lateinit var tabTrayDialogStore: TabTrayDialogFragmentStore
|
private lateinit var tabTrayDialogStore: TabTrayDialogFragmentStore
|
||||||
|
@ -154,9 +155,10 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), UserInteractionHandler
|
||||||
val isLandscape = newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE
|
val isLandscape = newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE
|
||||||
tabTrayView.setTopOffset(isLandscape)
|
tabTrayView.setTopOffset(isLandscape)
|
||||||
|
|
||||||
if (isLandscape) {
|
if (newConfig.orientation != currentOrientation) {
|
||||||
tabTrayView.dismissMenu()
|
tabTrayView.dismissMenu()
|
||||||
tabTrayView.expand()
|
tabTrayView.expand()
|
||||||
|
currentOrientation = newConfig.orientation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +170,7 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), UserInteractionHandler
|
||||||
|
|
||||||
val thumbnailLoader = ThumbnailLoader(requireContext().components.core.thumbnailStorage)
|
val thumbnailLoader = ThumbnailLoader(requireContext().components.core.thumbnailStorage)
|
||||||
val adapter = FenixTabsAdapter(requireContext(), thumbnailLoader)
|
val adapter = FenixTabsAdapter(requireContext(), thumbnailLoader)
|
||||||
|
currentOrientation = resources.configuration.orientation
|
||||||
|
|
||||||
_tabTrayView = TabTrayView(
|
_tabTrayView = TabTrayView(
|
||||||
view.tabLayout,
|
view.tabLayout,
|
||||||
|
|
Loading…
Reference in New Issue