File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/main/java/org/buffer/android/components Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ publish {
36
36
userOrg = ' buffer'
37
37
groupId = ' org.buffer.android'
38
38
artifactId = ' android-components'
39
- publishVersion = ' 0.14 '
39
+ publishVersion = ' 0.15 '
40
40
desc = ' An Android library for frequently used UI components'
41
41
website = ' https://github.com/bufferapp/android-components'
42
42
}
Original file line number Diff line number Diff line change @@ -377,22 +377,25 @@ object DialogFactory {
377
377
@StringRes title : Int ,
378
378
@StringRes message : Int ,
379
379
@StringRes positive : Int ,
380
- @StringRes neutral : Int ,
380
+ @StringRes neutral : Int? ,
381
381
@StringRes checkbox : Int ,
382
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
386
dontShowAgain.setText(checkbox)
387
387
388
- return MaterialAlertDialogBuilder (context)
388
+ val builder = MaterialAlertDialogBuilder (context)
389
389
.setView(checkboxView)
390
390
.setTitle(title)
391
391
.setMessage(message)
392
392
.setPositiveButton(positive) { dialog, which ->
393
393
clickListener?.onPositiveButtonSelected(dontShowAgain.isChecked) }
394
- .setNeutralButton(neutral) { dialog, which ->
395
- clickListener?.onNeutralButtonSelected(dontShowAgain.isChecked) }
394
+ if (neutral != null ) {
395
+ builder.setNeutralButton(neutral) { dialog, which ->
396
+ clickListener?.onNeutralButtonSelected(dontShowAgain.isChecked) }
397
+ }
398
+ return builder
396
399
}
397
400
398
401
You can’t perform that action at this time.
0 commit comments