|
|
@ -15,6 +15,7 @@ import kotlinx.android.synthetic.main.tabstray_multiselect_items.view.*
|
|
|
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
|
|
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
|
|
|
import kotlinx.coroutines.flow.Flow
|
|
|
|
import kotlinx.coroutines.flow.Flow
|
|
|
|
import kotlinx.coroutines.flow.collect
|
|
|
|
import kotlinx.coroutines.flow.collect
|
|
|
|
|
|
|
|
import kotlinx.coroutines.flow.drop
|
|
|
|
import kotlinx.coroutines.flow.map
|
|
|
|
import kotlinx.coroutines.flow.map
|
|
|
|
import mozilla.components.lib.state.helpers.AbstractBinding
|
|
|
|
import mozilla.components.lib.state.helpers.AbstractBinding
|
|
|
|
import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
|
|
|
|
import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
|
|
|
@ -69,6 +70,8 @@ class SelectionBannerBinding(
|
|
|
|
|
|
|
|
|
|
|
|
override suspend fun onState(flow: Flow<TabsTrayState>) {
|
|
|
|
override suspend fun onState(flow: Flow<TabsTrayState>) {
|
|
|
|
flow.map { it.mode }
|
|
|
|
flow.map { it.mode }
|
|
|
|
|
|
|
|
// ignore initial mode update; we never start in select mode.
|
|
|
|
|
|
|
|
.drop(1)
|
|
|
|
.ifChanged()
|
|
|
|
.ifChanged()
|
|
|
|
.collect { mode ->
|
|
|
|
.collect { mode ->
|
|
|
|
val isSelectMode = mode is Select
|
|
|
|
val isSelectMode = mode is Select
|
|
|
|