For #10496 - Fully expand bottom sheet when loaded
This commit is contained in:
parent
0566790257
commit
58a42828a1
|
@ -8,7 +8,6 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.annotation.CallSuper
|
||||
import androidx.annotation.IdRes
|
||||
|
@ -81,10 +80,8 @@ import org.mozilla.fenix.theme.ThemeManager
|
|||
import org.mozilla.fenix.utils.BrowsersCache
|
||||
import org.mozilla.fenix.utils.RunWhenReadyQueue
|
||||
import mozilla.components.concept.tabstray.TabsTray
|
||||
import mozilla.components.browser.tabstray.TabsAdapter
|
||||
import mozilla.components.browser.tabstray.BrowserTabsTray
|
||||
import org.mozilla.fenix.tabtray.FenixTabsAdapter
|
||||
import org.mozilla.fenix.tabtray.TabTrayViewHolder
|
||||
|
||||
/**
|
||||
* The main activity of the application. The application is primarily a single Activity (this one)
|
||||
|
|
|
@ -28,4 +28,4 @@ class FenixTabsAdapter(
|
|||
super.updateTabs(tabs)
|
||||
onTabsUpdated?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,13 +100,18 @@ class TabTrayView(
|
|||
{ it.content.private == isPrivate },
|
||||
{ })
|
||||
|
||||
|
||||
val selectedBrowserTabIndex = if (isPrivate) {
|
||||
val tabs = if (isPrivate) {
|
||||
view.context.components.core.store.state.privateTabs
|
||||
} else {
|
||||
view.context.components.core.store.state.normalTabs
|
||||
}.indexOfFirst { it.id == view.context.components.core.store.state.selectedTabId }
|
||||
}
|
||||
|
||||
val selectedBrowserTabIndex = tabs
|
||||
.indexOfFirst { it.id == view.context.components.core.store.state.selectedTabId }
|
||||
|
||||
if (tabs.size > EXPAND_AT_SIZE) {
|
||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||
}
|
||||
|
||||
(view.tabsTray as? BrowserTabsTray)?.also { tray ->
|
||||
TabsTouchHelper(tray.tabsAdapter).attachToRecyclerView(tray)
|
||||
|
@ -192,6 +197,7 @@ class TabTrayView(
|
|||
companion object {
|
||||
private const val DEFAULT_TAB_ID = 0
|
||||
private const val PRIVATE_TAB_ID = 1
|
||||
private const val EXPAND_AT_SIZE = 3
|
||||
private const val SLIDE_OFFSET = 0
|
||||
private const val ELEVATION = 90f
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user