Skip to content

Commit 73c471f

Browse files
author
梁任彦
committed
bug修复。
1 parent fcddcb4 commit 73c471f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

banner/src/main/java/com/donkingliang/banner/CustomBanner.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ private void getAttrs(Context context, AttributeSet attrs) {
121121
R.styleable.custom_banner_indicatorSelectRes, 0);
122122
int indicatorUnSelectRes = mTypedArray.getResourceId(
123123
R.styleable.custom_banner_indicatorUnSelectRes, 0);
124-
mIndicatorSelectDrawable = context.getResources().getDrawable(indicatorSelectRes);
125-
mIndicatorUnSelectDrawable = context.getResources().getDrawable(indicatorUnSelectRes);
124+
if (indicatorSelectRes != 0) {
125+
mIndicatorSelectDrawable = context.getResources().getDrawable(indicatorSelectRes);
126+
}
127+
if (indicatorUnSelectRes != 0) {
128+
mIndicatorUnSelectDrawable = context.getResources().getDrawable(indicatorUnSelectRes);
129+
}
126130
mTypedArray.recycle();
127131
}
128132
}

0 commit comments

Comments
 (0)