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 {
36
36
userOrg = ' buffer'
37
37
groupId = ' org.buffer.android'
38
38
artifactId = ' android-components'
39
- publishVersion = ' 0.19 '
39
+ publishVersion = ' 1.1 '
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 @@ -91,15 +91,23 @@ object DialogFactory {
91
91
context : Context ,
92
92
title : String ,
93
93
message : String? = null,
94
- positive : String ,
95
- negative : String ,
94
+ positive : String? = null,
95
+ negative : String? = null,
96
+ neutral : String? = null,
96
97
positiveListener : DialogInterface .OnClickListener ? = null,
97
- negativeListener : DialogInterface .OnClickListener ? = null
98
+ negativeListener : DialogInterface .OnClickListener ? = null,
99
+ neutralListener : DialogInterface .OnClickListener ? = null
98
100
): 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
+ }
103
111
if (! message.isNullOrBlank()) {
104
112
alertDialog.setMessage(message)
105
113
}
You can’t perform that action at this time.
0 commit comments