For #2948: Adds menu button add tab to collection
parent
3fd831cc4d
commit
6a53127ef9
|
@ -95,10 +95,6 @@ class CollectionCreationUIView(
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
view.save_button.setOnClickListener {
|
|
||||||
actionEmitter.onNext(CollectionCreationAction.SaveTabsToCollection(selectedTabs.toList()))
|
|
||||||
}
|
|
||||||
|
|
||||||
view.add_collection_button.setOnClickListener {
|
view.add_collection_button.setOnClickListener {
|
||||||
actionEmitter.onNext(CollectionCreationAction.AddNewCollection)
|
actionEmitter.onNext(CollectionCreationAction.AddNewCollection)
|
||||||
}
|
}
|
||||||
|
@ -118,6 +114,7 @@ class CollectionCreationUIView(
|
||||||
override fun updateView() = Consumer<CollectionCreationState> {
|
override fun updateView() = Consumer<CollectionCreationState> {
|
||||||
step = it.saveCollectionStep
|
step = it.saveCollectionStep
|
||||||
selectedTabs = it.selectedTabs
|
selectedTabs = it.selectedTabs
|
||||||
|
selectedCollection = it.selectedTabCollection
|
||||||
|
|
||||||
when (it.saveCollectionStep) {
|
when (it.saveCollectionStep) {
|
||||||
is SaveCollectionStep.SelectTabs -> {
|
is SaveCollectionStep.SelectTabs -> {
|
||||||
|
@ -158,8 +155,22 @@ class CollectionCreationUIView(
|
||||||
it.selectedTabs.size
|
it.selectedTabs.size
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
view.select_tabs_layout_text.text = selectTabsText
|
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()) {
|
save_button.visibility = if (it.selectedTabs.isEmpty()) {
|
||||||
View.GONE
|
View.GONE
|
||||||
} else {
|
} else {
|
||||||
|
@ -221,7 +232,6 @@ class CollectionCreationUIView(
|
||||||
}
|
}
|
||||||
is SaveCollectionStep.RenameCollection -> {
|
is SaveCollectionStep.RenameCollection -> {
|
||||||
it.selectedTabCollection?.let { tabCollection ->
|
it.selectedTabCollection?.let { tabCollection ->
|
||||||
selectedCollection = tabCollection
|
|
||||||
tabCollection.tabs.map { tab ->
|
tabCollection.tabs.map { tab ->
|
||||||
Tab(
|
Tab(
|
||||||
tab.id.toString(),
|
tab.id.toString(),
|
||||||
|
|
|
@ -71,7 +71,6 @@ import org.mozilla.fenix.mvi.getManagedEmitter
|
||||||
import org.mozilla.fenix.onboarding.FenixOnboarding
|
import org.mozilla.fenix.onboarding.FenixOnboarding
|
||||||
import org.mozilla.fenix.settings.SupportUtils
|
import org.mozilla.fenix.settings.SupportUtils
|
||||||
import org.mozilla.fenix.share.ShareTab
|
import org.mozilla.fenix.share.ShareTab
|
||||||
import org.mozilla.fenix.utils.ItsNotBrokenSnack
|
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
|
@ -410,7 +409,9 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
|
||||||
createDeleteCollectionPrompt(action.collection)
|
createDeleteCollectionPrompt(action.collection)
|
||||||
}
|
}
|
||||||
is CollectionAction.AddTab -> {
|
is CollectionAction.AddTab -> {
|
||||||
ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "1575")
|
showCollectionCreationFragment(
|
||||||
|
selectedTabCollection = action.collection
|
||||||
|
)
|
||||||
}
|
}
|
||||||
is CollectionAction.Rename -> {
|
is CollectionAction.Rename -> {
|
||||||
showCollectionCreationFragment(
|
showCollectionCreationFragment(
|
||||||
|
|
|
@ -37,7 +37,6 @@ private object Versions {
|
||||||
// be kept in sync with the version used by android-components above.
|
// be kept in sync with the version used by android-components above.
|
||||||
const val mozilla_appservices = "0.28.1"
|
const val mozilla_appservices = "0.28.1"
|
||||||
|
|
||||||
|
|
||||||
const val autodispose = "1.1.0"
|
const val autodispose = "1.1.0"
|
||||||
const val adjust = "4.11.4"
|
const val adjust = "4.11.4"
|
||||||
const val installreferrer = "1.0"
|
const val installreferrer = "1.0"
|
||||||
|
|
Loading…
Reference in New Issue