For #1843 - Closes the fragment when the arrow button is pressed

nightly-build-test
Jeff Boek 5 years ago committed by Emily Kager
parent d39c15402e
commit 9df64b61d4

@ -26,7 +26,7 @@ sealed class CollectionCreationChange : Change {
}
sealed class CollectionCreationAction : Action {
object Close : CollectionCreationAction()
}
class CollectionCreationComponent(

@ -32,7 +32,7 @@ class CollectionCreationUIView(
init {
view.back_button.setOnClickListener {
Log.e("Collection Creation", "Back button tapped")
actionEmitter.onNext(CollectionCreationAction.Close)
}
view.select_all_button.setOnClickListener {

@ -16,6 +16,7 @@ import androidx.lifecycle.ViewModelProviders
import kotlinx.android.synthetic.main.fragment_create_collection.view.*
import org.mozilla.fenix.R
import org.mozilla.fenix.mvi.ActionBusFactory
import org.mozilla.fenix.mvi.getAutoDisposeObservable
import org.mozilla.fenix.mvi.getManagedEmitter
class CreateCollectionFragment : DialogFragment() {
@ -48,6 +49,12 @@ class CreateCollectionFragment : DialogFragment() {
}!!.tabs
getManagedEmitter<CollectionCreationChange>().onNext(CollectionCreationChange.TabListChange(tabs))
getAutoDisposeObservable<CollectionCreationAction>().subscribe {
when (it) {
is CollectionCreationAction.Close -> dismissAllowingStateLoss()
}
}
}
companion object {

Loading…
Cancel
Save