@@ -373,32 +373,31 @@ object DialogFactory {
373
373
}
374
374
375
375
fun createCheckboxDialog (
376
- context : Context ,
377
- @StringRes title : Int ,
378
- @StringRes message : Int ,
379
- @StringRes positive : Int ,
380
- @StringRes neutral : Int ? ,
381
- @StringRes checkbox : Int ,
382
- clickListener : ActionListener ? = null
376
+ context : Context ,
377
+ title : String ,
378
+ message : String ,
379
+ positive : String ,
380
+ neutral : String ? ,
381
+ checkbox : String ,
382
+ clickListener : ActionListener ? = null
383
383
): MaterialAlertDialogBuilder {
384
384
val checkboxView = LayoutInflater .from(context).inflate(R .layout.checkbox, null )
385
385
val dontShowAgain = checkboxView.findViewById<CheckBox >(R .id.skip)
386
- dontShowAgain.setText( checkbox)
386
+ dontShowAgain.text = checkbox
387
387
388
388
val builder = MaterialAlertDialogBuilder (context)
389
- .setView(checkboxView)
390
- .setTitle(title)
391
- .setMessage(message)
392
- .setPositiveButton(positive) { dialog, which ->
393
- clickListener?.onPositiveButtonSelected(dontShowAgain.isChecked) }
389
+ .setView(checkboxView)
390
+ .setTitle(title)
391
+ .setMessage(message)
392
+ .setPositiveButton(positive) { _, _ ->
393
+ clickListener?.onPositiveButtonSelected(dontShowAgain.isChecked) }
394
394
if (neutral != null ) {
395
- builder.setNeutralButton(neutral) { dialog, which ->
395
+ builder.setNeutralButton(neutral) { _, _ ->
396
396
clickListener?.onNeutralButtonSelected(dontShowAgain.isChecked) }
397
397
}
398
398
return builder
399
399
}
400
400
401
-
402
401
interface InputListener {
403
402
fun onTextInput (text : String )
404
403
}
0 commit comments