Skip to content

Commit

Permalink
[Fix] Fix issue of duplicate value for resource attr/itemBackground
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosLeung committed Aug 7, 2018
1 parent e688091 commit c4effb8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pinview/src/main/java/com/chaos/view/PinView.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public PinView(Context context, @Nullable AttributeSet attrs, int defStyleAttr)
mCursorWidth = a.getDimensionPixelSize(R.styleable.PinView_cursorWidth,
res.getDimensionPixelSize(R.dimen.pv_pin_view_cursor_width));

mItemBackground = a.getDrawable(R.styleable.PinView_itemBackground);
mItemBackground = a.getDrawable(R.styleable.PinView_android_itemBackground);

a.recycle();

Expand Down Expand Up @@ -895,7 +895,7 @@ public int getCursorColor() {
* a Drawable object or 0 to remove the item background.
*
* @param resId The identifier of the resource.
* @attr ref R.styleable#PinView_itemBackground
* @attr ref R.styleable#PinView_android_itemBackground
*/
public void setItemBackgroundResources(@DrawableRes int resId) {
if (resId != 0 && mItemBackgroundResource != resId) {
Expand Down
2 changes: 1 addition & 1 deletion pinview/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
<attr name="android:cursorVisible" />
<attr name="cursorWidth" format="dimension" />
<attr name="cursorColor" format="reference|color" />
<attr name="itemBackground" format="reference|color" />
<attr name="android:itemBackground" />
</declare-styleable>
</resources>
2 changes: 1 addition & 1 deletion simple/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
android:cursorVisible="true"
android:hint="Hint."
android:inputType="text"
android:itemBackground="@mipmap/ic_launcher"
android:padding="@dimen/common_padding"
android:textColor="@color/text_colors"
android:textSize="18sp"
android:textStyle="bold"
app:cursorColor="@color/line_selected"
app:cursorWidth="2dp"
app:itemBackground="@mipmap/ic_launcher"
app:itemCount="5"
app:itemHeight="48dp"
app:itemRadius="4dp"
Expand Down

0 comments on commit c4effb8

Please sign in to comment.