For #10504 - Fixes up tab tray dialog styles
parent
0b9484a172
commit
90cef752b0
|
@ -10,6 +10,7 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import androidx.core.view.updatePadding
|
||||
import kotlinx.android.synthetic.main.component_tabstray.view.*
|
||||
import kotlinx.android.synthetic.main.fragment_tab_tray_dialog.*
|
||||
import kotlinx.android.synthetic.main.fragment_tab_tray_dialog.view.*
|
||||
import mozilla.components.concept.tabstray.Tab
|
||||
|
@ -38,8 +39,14 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), TabTrayInteractor {
|
|||
view.tabLayout.setOnApplyWindowInsetsListener { v, insets ->
|
||||
v.updatePadding(
|
||||
left = insets.systemWindowInsetLeft,
|
||||
right = insets.systemWindowInsetRight
|
||||
right = insets.systemWindowInsetRight,
|
||||
bottom = insets.systemWindowInsetBottom
|
||||
)
|
||||
|
||||
tabTrayView.view.tab_wrapper.updatePadding(
|
||||
bottom = insets.systemWindowInsetBottom
|
||||
)
|
||||
|
||||
insets
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class TabTrayView(
|
|||
|
||||
behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
|
||||
override fun onSlide(bottomSheet: View, slideOffset: Float) {
|
||||
Log.e("slideOffset", "$slideOffset")
|
||||
|
||||
if (slideOffset > -0.4) {
|
||||
fabView.new_tab_button.show()
|
||||
} else {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
android:id="@+id/tab_wrapper"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="?foundation"
|
||||
style="@style/BottomSheetModal"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
@ -62,6 +63,8 @@
|
|||
android:id="@+id/tabsTray"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:paddingBottom="80dp"
|
||||
android:clipToPadding="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -71,7 +74,5 @@
|
|||
mozac:tabsTraySelectedItemBackgroundColor="?tabTrayItemSelectedBackground"
|
||||
mozac:tabsTraySelectedItemTextColor="?tabTrayItemText"
|
||||
mozac:tabsTrayItemUrlTextColor="?tabTrayItemUrl"
|
||||
mozac:tabsTraySelectedItemUrlTextColor="?tabTrayItemUrl"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="90dp"/>
|
||||
mozac:tabsTraySelectedItemUrlTextColor="?tabTrayItemUrl" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -14,5 +14,4 @@
|
|||
android:backgroundTint="@color/photonBlue50"
|
||||
android:contentDescription="TODO: Changeme"
|
||||
app:srcCompat="@drawable/ic_new"
|
||||
app:tint="@color/photonWhite"
|
||||
android:fitsSystemWindows="true" />
|
||||
app:tint="@color/photonWhite" />
|
||||
|
|
|
@ -7,4 +7,5 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent" />
|
||||
android:layout_width="match_parent"
|
||||
android:clipToPadding="false" />
|
||||
|
|
|
@ -532,13 +532,12 @@
|
|||
|
||||
<style name="TabTrayDialogStyle" parent="Theme.Design.Light.BottomSheetDialog">
|
||||
<item name="bottomSheetStyle">@style/BottomSheetModal</item>
|
||||
<item name="android:textAppearance">@style/TextAppearance.AppCompat</item>
|
||||
<item name="android:colorBackground">?foundation</item>
|
||||
<!-- <item name="android:textAppearance">@style/TextAppearance.AppCompat</item>-->
|
||||
<!-- <item name="android:colorBackground">?foundation</item>-->
|
||||
|
||||
<item name="android:windowAnimationStyle">@style/Animation.Design.BottomSheetDialog</item>
|
||||
<!-- <item name="android:windowAnimationStyle">@style/Animation.Design.BottomSheetDialog</item>-->
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">?foundation</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
|
@ -552,7 +551,7 @@
|
|||
|
||||
<style name="BottomSheetModal" parent="Widget.Design.BottomSheet.Modal">
|
||||
<item name="shapeAppearance">@style/BottomSheetShapeAppearance</item>
|
||||
<item name="behavior_halfExpandedRatio">0.4</item>
|
||||
<item name="behavior_halfExpandedRatio">0.6</item>
|
||||
<item name="behavior_fitToContents">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue