We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 229e746 commit 5c21552Copy full SHA for 5c21552
1 file changed
library/src/main/java/me/zhanghai/android/fastscroll/Utils.java
@@ -31,6 +31,10 @@ class Utils {
31
@ColorInt
32
public static int getColorFromAttrRes(@AttrRes int attrRes, @NonNull Context context) {
33
TypedArray a = context.obtainStyledAttributes(new int[] { attrRes });
34
+ int type = a.getType(0);
35
+ if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
36
+ return a.getColor(0, 0);
37
+ }
38
int resId;
39
try {
40
resId = a.getResourceId(0, 0);
0 commit comments