Skip to content

Commit 87ec61b

Browse files
committed
Fix obtainItemColor-method.
1 parent 1fd055b commit 87ec61b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

library/src/main/java/de/mrapp/android/dialog/builder/AbstractListDialogBuilder.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ public abstract class AbstractListDialogBuilder<DialogType extends ListDialog, B
5656
private void obtainItemColor(@StyleRes final int themeResourceId) {
5757
TypedArray typedArray = getContext().getTheme()
5858
.obtainStyledAttributes(themeResourceId, new int[]{R.attr.materialDialogItemColor});
59-
int defaultColor = ThemeUtil
60-
.getColor(getContext(), themeResourceId, android.R.attr.textColorSecondary);
61-
setItemColor(typedArray.getColor(0, defaultColor));
59+
ColorStateList color = typedArray.getColorStateList(0);
60+
61+
if (color == null) {
62+
color = ThemeUtil.getColorStateList(getContext(), themeResourceId,
63+
android.R.attr.textColorSecondary);
64+
}
65+
66+
setItemColor(color);
6267
}
6368

6469
/**

0 commit comments

Comments
 (0)