Remove hidden fab in tabs tray (#16972)

upstream-sync
Elise Richards 4 years ago committed by GitHub
parent 556fea5591
commit 813693f1d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,6 +7,8 @@ package org.mozilla.fenix.tabtray
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.View.INVISIBLE
import android.view.View.VISIBLE
import android.view.ViewGroup
import android.view.accessibility.AccessibilityEvent
import androidx.annotation.IdRes
@ -125,12 +127,12 @@ class TabTrayView(
}
behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
override fun onSlide(bottomSheet: View, slideOffset: Float) {
if (interactor.onModeRequested() is Mode.Normal && !hasAccessibilityEnabled) {
if (slideOffset >= SLIDE_OFFSET) {
fabView.new_tab_button.show()
} else {
fabView.new_tab_button.hide()
}
if (
interactor.onModeRequested() is Mode.Normal &&
!hasAccessibilityEnabled &&
slideOffset >= SLIDE_OFFSET
) {
fabView.new_tab_button.show()
}
}
@ -312,7 +314,7 @@ class TabTrayView(
}
infoBanner?.apply {
view.infoBanner.visibility = View.VISIBLE
view.infoBanner.visibility = VISIBLE
showBanner()
}
}
@ -579,9 +581,9 @@ class TabTrayView(
}
view.tabsTray.visibility = if (hasNoTabs) {
View.INVISIBLE
INVISIBLE
} else {
View.VISIBLE
VISIBLE
}
counter_text.text = updateTabCounter(browserState.normalTabs.size)

@ -2,7 +2,8 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/new_tab_button"
style="@style/TabTrayFab"

Loading…
Cancel
Save