Skip to content

Commit

Permalink
Remove hidden fab in tabs tray (mozilla-mobile#16972)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliserichards committed Dec 11, 2020
1 parent 556fea5 commit 813693f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
20 changes: 11 additions & 9 deletions app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}

Expand Down Expand Up @@ -312,7 +314,7 @@ class TabTrayView(
}

infoBanner?.apply {
view.infoBanner.visibility = View.VISIBLE
view.infoBanner.visibility = VISIBLE
showBanner()
}
}
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/component_tabstray_fab.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 813693f

Please sign in to comment.