Skip to content

Commit c4effb8

Browse files
committed
[Fix] Fix issue of duplicate value for resource attr/itemBackground
1 parent e688091 commit c4effb8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pinview/src/main/java/com/chaos/view/PinView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public PinView(Context context, @Nullable AttributeSet attrs, int defStyleAttr)
146146
mCursorWidth = a.getDimensionPixelSize(R.styleable.PinView_cursorWidth,
147147
res.getDimensionPixelSize(R.dimen.pv_pin_view_cursor_width));
148148

149-
mItemBackground = a.getDrawable(R.styleable.PinView_itemBackground);
149+
mItemBackground = a.getDrawable(R.styleable.PinView_android_itemBackground);
150150

151151
a.recycle();
152152

@@ -895,7 +895,7 @@ public int getCursorColor() {
895895
* a Drawable object or 0 to remove the item background.
896896
*
897897
* @param resId The identifier of the resource.
898-
* @attr ref R.styleable#PinView_itemBackground
898+
* @attr ref R.styleable#PinView_android_itemBackground
899899
*/
900900
public void setItemBackgroundResources(@DrawableRes int resId) {
901901
if (resId != 0 && mItemBackgroundResource != resId) {

pinview/src/main/res/values/attrs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
<attr name="android:cursorVisible" />
3737
<attr name="cursorWidth" format="dimension" />
3838
<attr name="cursorColor" format="reference|color" />
39-
<attr name="itemBackground" format="reference|color" />
39+
<attr name="android:itemBackground" />
4040
</declare-styleable>
4141
</resources>

simple/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
android:cursorVisible="true"
3434
android:hint="Hint."
3535
android:inputType="text"
36+
android:itemBackground="@mipmap/ic_launcher"
3637
android:padding="@dimen/common_padding"
3738
android:textColor="@color/text_colors"
3839
android:textSize="18sp"
3940
android:textStyle="bold"
4041
app:cursorColor="@color/line_selected"
4142
app:cursorWidth="2dp"
42-
app:itemBackground="@mipmap/ic_launcher"
4343
app:itemCount="5"
4444
app:itemHeight="48dp"
4545
app:itemRadius="4dp"

0 commit comments

Comments
 (0)