Skip to content

Commit 3ec7dec

Browse files
committed
Fix dialog factory functions
1 parent fe81f43 commit 3ec7dec

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ object DialogFactory {
4141
return alertDialog.create()
4242
}
4343

44+
fun createSimpleYesNoDialog(
45+
context: Context,
46+
title: String,
47+
message: String
48+
): AlertDialog {
49+
val alertDialog = AlertDialog.Builder(context)
50+
.setTitle(title)
51+
.setMessage(message)
52+
.setNeutralButton(R.string.dialog_action_ok, null);
53+
return alertDialog.create()
54+
}
55+
4456
fun createSimpleYesNoDialog(
4557
context: Context,
4658
title: String,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RoundedButton @JvmOverloads constructor(context: Context,
2424
val style = ButtonStyle.fromIdentifier(getStyleIdentifierFromStyleableAttributes(attrs))
2525
when (style) {
2626
ButtonStyle.DARK -> {
27-
setTextColor(ContextCompat.getColor(context,
27+
setTextColor(ContextCompat.getColorStateList(context,
2828
R.color.selector_dark_button_text))
2929
setBackgroundResource(R.drawable.button_bfr_round_dark)
3030
}
@@ -34,7 +34,7 @@ class RoundedButton @JvmOverloads constructor(context: Context,
3434
setBackgroundResource(R.drawable.button_bfr_round_light)
3535
}
3636
ButtonStyle.CLEAR -> {
37-
setTextColor(ContextCompat.getColor(context,
37+
setTextColor(ContextCompat.getColorStateList(context,
3838
R.color.selector_clear_button_text))
3939
setBackgroundResource(R.drawable.button_bfr_round_white)
4040
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
<string name="dialog_dont_ask_again">Don\'t ask again.</string>
3+
4+
<string name="dialog_action_ok">OK</string>
5+
</resources>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<resources>
22
<string name="dialog_dont_ask_again">Don\'t ask again.</string>
3+
4+
<string name="dialog_action_ok">OK</string>
35
</resources>

0 commit comments

Comments
 (0)