Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fad36128 authored by tibbi's avatar tibbi
Browse files

add an optional cancel callback to RadioGroupDialog

parent 1ca650cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.9.5'
        propVersionName = '3.9.6'
        kotlin_version = '1.2.21'
        support_libs = '27.0.2'
    }
+2 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ import kotlinx.android.synthetic.main.dialog_radio_group.view.*
import java.util.*

class RadioGroupDialog(val activity: Activity, val items: ArrayList<RadioItem>, val checkedItemId: Int = -1, val titleId: Int = 0,
                       val callback: (newValue: Any) -> Unit) : RadioGroup.OnCheckedChangeListener {
                       val cancelCallback: (() -> Unit)? = null, val callback: (newValue: Any) -> Unit) : RadioGroup.OnCheckedChangeListener {
    val dialog: AlertDialog
    var wasInit = false
    var selectedItemId = -1
@@ -38,6 +38,7 @@ class RadioGroupDialog(val activity: Activity, val items: ArrayList<RadioItem>,
        }

        dialog = AlertDialog.Builder(activity)
                .setOnCancelListener { cancelCallback?.invoke() }
                .create().apply {
            activity.setupDialogStuff(view, this, titleId)
        }