For #11342 - Fixes missing space for the FAB

fennec/production
Jeff Boek 4 years ago committed by Emily Kager
parent 651b2831fe
commit 1639b1d3a1

@ -94,7 +94,10 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), TabTrayInteractor {
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
val isLandscape = newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE
tabTrayView.setTopOffset(isLandscape)
if (isLandscape) {
tabTrayView.expand()
}
}

@ -104,7 +104,7 @@ class TabTrayView(
expand()
}
behavior.setExpandedOffset(view.context.resources.getDimension(R.dimen.tab_tray_top_offset).toInt())
setTopOffset(startingInLandscape)
(view.tabsTray as? BrowserTabsTray)?.also { tray ->
TabsTouchHelper(tray.tabsAdapter).attachToRecyclerView(tray)
@ -199,6 +199,16 @@ class TabTrayView(
}
}
fun setTopOffset(landscape: Boolean) {
val topOffset = if (landscape) {
0
} else {
view.context.resources.getDimension(R.dimen.tab_tray_top_offset).toInt()
}
behavior.setExpandedOffset(topOffset)
}
companion object {
private const val DEFAULT_TAB_ID = 0
private const val PRIVATE_TAB_ID = 1

@ -7,5 +7,4 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabLayout"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:clipToPadding="false" />
android:layout_width="match_parent" />

@ -560,6 +560,8 @@
<style name="BottomSheetModal" parent="Widget.Design.BottomSheet.Modal">
<item name="shapeAppearance">@style/BottomSheetShapeAppearance</item>
<item name="behavior_fitToContents">false</item>
<item name="behavior_expandedOffset">80</item>
<item name="behavior_skipCollapsed">true</item>
</style>
<style name="TabTrayFab" parent="Widget.MaterialComponents.ExtendedFloatingActionButton">

Loading…
Cancel
Save