1
0
Fork 0

For #10504 - Fixes up tab tray dialog styles

master
Jeff Boek 2020-05-20 21:18:53 -07:00
parent 0b9484a172
commit 90cef752b0
6 changed files with 20 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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