Skip to content

Commit 33ddd44

Browse files
committed
Only set message if not null
1 parent 713d64e commit 33ddd44

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ publish {
3636
userOrg = 'buffer'
3737
groupId = 'org.buffer.android'
3838
artifactId = 'android-components'
39-
publishVersion = '0.7'
39+
publishVersion = '0.8'
4040
desc = 'An Android library for frequently used UI components'
4141
website = 'https://github.com/bufferapp/android-components'
4242
}

app/src/main/java/org/buffer/android/components/DialogFactory.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ object DialogFactory {
2828
fun createSimpleYesNoDialog(
2929
context: Context,
3030
title: String,
31-
message: String,
31+
message: String? = null,
3232
positive: String,
3333
negative: String,
3434
positiveListener: DialogInterface.OnClickListener? = null,
3535
negativeListener: DialogInterface.OnClickListener? = null
3636
): AlertDialog {
3737
val alertDialog = MaterialAlertDialogBuilder(context)
3838
.setTitle(title)
39-
.setMessage(message)
4039
.setPositiveButton(positive, positiveListener)
4140
.setNegativeButton(negative, negativeListener)
41+
if (!message.isNullOrBlank()) {
42+
alertDialog.setMessage(message)
43+
}
4244
return alertDialog.create()
4345
}
4446

0 commit comments

Comments
 (0)