File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
androidshared/src/main/java/org/odk/collect/androidshared/ui
collect_app/src/main/java/org/odk/collect/android/fragments Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ object SnackbarUtils {
9090
9191 if (action != null ) {
9292 setAction(action.text) {
93- action.listener .invoke()
93+ action.beforeDismiss .invoke()
9494 dismiss()
9595 }
9696 }
@@ -109,7 +109,7 @@ object SnackbarUtils {
109109 val action : Action ? = null
110110 )
111111
112- data class Action (val text : String , val listener : () -> Unit )
112+ data class Action (val text : String , val beforeDismiss : () -> Unit = {} )
113113
114114 abstract class SnackbarPresenterObserver <T : Any ?>(private val parentView : View ) :
115115 Observer <Consumable <T >? > {
Original file line number Diff line number Diff line change @@ -93,9 +93,7 @@ abstract class BarCodeScannerFragment : Fragment() {
9393 duration = 2000 ,
9494 action = SnackbarUtils .Action (
9595 getString(org.odk.collect.strings.R .string.exit_scanning)
96- ) {
97- handleScanningResult(result)
98- },
96+ ),
9997 onDismiss = {
10098 handleScanningResult(result)
10199 }
You can’t perform that action at this time.
0 commit comments