1
0
Fork 0

For #2948: Adds menu button add tab to collection

master
Sawyer Blatz 2019-05-28 15:43:44 -07:00
parent 3fd831cc4d
commit 6a53127ef9
3 changed files with 18 additions and 8 deletions

View File

@ -95,10 +95,6 @@ class CollectionCreationUIView(
false
}
view.save_button.setOnClickListener {
actionEmitter.onNext(CollectionCreationAction.SaveTabsToCollection(selectedTabs.toList()))
}
view.add_collection_button.setOnClickListener {
actionEmitter.onNext(CollectionCreationAction.AddNewCollection)
}
@ -118,6 +114,7 @@ class CollectionCreationUIView(
override fun updateView() = Consumer<CollectionCreationState> {
step = it.saveCollectionStep
selectedTabs = it.selectedTabs
selectedCollection = it.selectedTabCollection
when (it.saveCollectionStep) {
is SaveCollectionStep.SelectTabs -> {
@ -158,8 +155,22 @@ class CollectionCreationUIView(
it.selectedTabs.size
)
}
view.select_tabs_layout_text.text = selectTabsText
save_button.setOnClickListener { _ ->
if (selectedCollection != null) {
actionEmitter.onNext(
CollectionCreationAction.SelectCollection(
selectedCollection!!,
it.selectedTabs.toList()
)
)
} else {
actionEmitter.onNext(CollectionCreationAction.SaveTabsToCollection(selectedTabs.toList()))
}
}
save_button.visibility = if (it.selectedTabs.isEmpty()) {
View.GONE
} else {
@ -221,7 +232,6 @@ class CollectionCreationUIView(
}
is SaveCollectionStep.RenameCollection -> {
it.selectedTabCollection?.let { tabCollection ->
selectedCollection = tabCollection
tabCollection.tabs.map { tab ->
Tab(
tab.id.toString(),

View File

@ -71,7 +71,6 @@ import org.mozilla.fenix.mvi.getManagedEmitter
import org.mozilla.fenix.onboarding.FenixOnboarding
import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.share.ShareTab
import org.mozilla.fenix.utils.ItsNotBrokenSnack
import kotlin.coroutines.CoroutineContext
import kotlin.math.roundToInt
@ -410,7 +409,9 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
createDeleteCollectionPrompt(action.collection)
}
is CollectionAction.AddTab -> {
ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "1575")
showCollectionCreationFragment(
selectedTabCollection = action.collection
)
}
is CollectionAction.Rename -> {
showCollectionCreationFragment(

View File

@ -37,7 +37,6 @@ private object Versions {
// be kept in sync with the version used by android-components above.
const val mozilla_appservices = "0.28.1"
const val autodispose = "1.1.0"
const val adjust = "4.11.4"
const val installreferrer = "1.0"