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 {
3636 userOrg = ' buffer'
3737 groupId = ' org.buffer.android'
3838 artifactId = ' android-components'
39- publishVersion = ' 0.14 '
39+ publishVersion = ' 0.15 '
4040 desc = ' An Android library for frequently used UI components'
4141 website = ' https://github.com/bufferapp/android-components'
4242}
Original file line number Diff line number Diff line change @@ -377,22 +377,25 @@ object DialogFactory {
377377 @StringRes title : Int ,
378378 @StringRes message : Int ,
379379 @StringRes positive : Int ,
380- @StringRes neutral : Int ,
380+ @StringRes neutral : Int? ,
381381 @StringRes checkbox : Int ,
382382 clickListener : ActionListener ? = null
383383 ): MaterialAlertDialogBuilder {
384384 val checkboxView = LayoutInflater .from(context).inflate(R .layout.checkbox, null )
385385 val dontShowAgain = checkboxView.findViewById<CheckBox >(R .id.skip)
386386 dontShowAgain.setText(checkbox)
387387
388- return MaterialAlertDialogBuilder (context)
388+ val builder = MaterialAlertDialogBuilder (context)
389389 .setView(checkboxView)
390390 .setTitle(title)
391391 .setMessage(message)
392392 .setPositiveButton(positive) { dialog, which ->
393393 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
396399 }
397400
398401
You can’t perform that action at this time.
0 commit comments