File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
src/main/java/org/buffer/android/components Expand file tree Collapse file tree 2 files changed +16
-8
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 = ' 1.0 '
39+ publishVersion = ' 1.1 '
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 @@ -91,15 +91,23 @@ object DialogFactory {
9191 context : Context ,
9292 title : String ,
9393 message : String? = null,
94- positive : String ,
95- negative : String ,
94+ positive : String? = null,
95+ negative : String? = null,
96+ neutral : String? = null,
9697 positiveListener : DialogInterface .OnClickListener ? = null,
97- negativeListener : DialogInterface .OnClickListener ? = null
98+ negativeListener : DialogInterface .OnClickListener ? = null,
99+ neutralListener : DialogInterface .OnClickListener ? = null
98100 ): AlertDialog {
99- val alertDialog = MaterialAlertDialogBuilder (context)
100- .setTitle(title)
101- .setPositiveButton(positive, positiveListener)
102- .setNegativeButton(negative, negativeListener)
101+ val alertDialog = MaterialAlertDialogBuilder (context).setTitle(title)
102+ if (positive != null ) {
103+ alertDialog.setPositiveButton(positive, positiveListener)
104+ }
105+ if (negative != null ) {
106+ alertDialog.setNegativeButton(negative, negativeListener)
107+ }
108+ if (neutral != null ) {
109+ alertDialog.setNeutralButton(neutral, neutralListener)
110+ }
103111 if (! message.isNullOrBlank()) {
104112 alertDialog.setMessage(message)
105113 }
You can’t perform that action at this time.
0 commit comments