Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.9.6' propVersionName = '3.9.7' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/RadioGroupDialog.kt +9 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,8 @@ 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 cancelCallback: (() -> Unit)? = null, val callback: (newValue: Any) -> Unit) : RadioGroup.OnCheckedChangeListener { showOKButton: Boolean = false, val cancelCallback: (() -> Unit)? = null, val callback: (newValue: Any) -> Unit) : RadioGroup.OnCheckedChangeListener { val dialog: AlertDialog var wasInit = false var selectedItemId = -1 Loading @@ -37,9 +38,14 @@ class RadioGroupDialog(val activity: Activity, val items: ArrayList<RadioItem>, } } dialog = AlertDialog.Builder(activity) val builder = AlertDialog.Builder(activity) .setOnCancelListener { cancelCallback?.invoke() } .create().apply { if (selectedItemId != -1 && showOKButton) { builder.setPositiveButton(R.string.ok, { dialog, which -> onCheckedChanged(view.dialog_radio_group, selectedItemId) }) } dialog = builder.create().apply { activity.setupDialogStuff(view, this, titleId) } Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.9.6' propVersionName = '3.9.7' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/RadioGroupDialog.kt +9 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,8 @@ 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 cancelCallback: (() -> Unit)? = null, val callback: (newValue: Any) -> Unit) : RadioGroup.OnCheckedChangeListener { showOKButton: Boolean = false, val cancelCallback: (() -> Unit)? = null, val callback: (newValue: Any) -> Unit) : RadioGroup.OnCheckedChangeListener { val dialog: AlertDialog var wasInit = false var selectedItemId = -1 Loading @@ -37,9 +38,14 @@ class RadioGroupDialog(val activity: Activity, val items: ArrayList<RadioItem>, } } dialog = AlertDialog.Builder(activity) val builder = AlertDialog.Builder(activity) .setOnCancelListener { cancelCallback?.invoke() } .create().apply { if (selectedItemId != -1 && showOKButton) { builder.setPositiveButton(R.string.ok, { dialog, which -> onCheckedChanged(view.dialog_radio_group, selectedItemId) }) } dialog = builder.create().apply { activity.setupDialogStuff(view, this, titleId) } Loading