Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
namespace xml attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc3m1 committed Oct 22, 2014
1 parent b929b72 commit c3d6989
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {

allprojects {
group 'com.makeramen'
version '1.3.1'
version '1.4.0'
repositories {
mavenCentral()
}
Expand Down
8 changes: 4 additions & 4 deletions example/src/main/res/layout/rounded_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
android:padding="10dip"
android:src="@drawable/photo1"
android:scaleType="center"
app:corner_radius="30dip"
app:border_width="3dip"
app:oval="false"
app:border_color="@color/border"
app:riv_corner_radius="30dip"
app:riv_border_width="3dip"
app:riv_oval="false"
app:riv_border_color="@color/border"
/>

<TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public RoundedImageView(Context context, AttributeSet attrs, int defStyle) {
setScaleType(ScaleType.FIT_CENTER);
}

cornerRadius = a.getDimensionPixelSize(R.styleable.RoundedImageView_corner_radius, -1);
borderWidth = a.getDimensionPixelSize(R.styleable.RoundedImageView_border_width, -1);
cornerRadius = a.getDimensionPixelSize(R.styleable.RoundedImageView_riv_corner_radius, -1);
borderWidth = a.getDimensionPixelSize(R.styleable.RoundedImageView_riv_border_width, -1);

// don't allow negative values for radius and border
if (cornerRadius < 0) {
Expand All @@ -74,13 +74,13 @@ public RoundedImageView(Context context, AttributeSet attrs, int defStyle) {
borderWidth = DEFAULT_BORDER_WIDTH;
}

borderColor = a.getColorStateList(R.styleable.RoundedImageView_border_color);
borderColor = a.getColorStateList(R.styleable.RoundedImageView_riv_border_color);
if (borderColor == null) {
borderColor = ColorStateList.valueOf(RoundedDrawable.DEFAULT_BORDER_COLOR);
}

mutateBackground = a.getBoolean(R.styleable.RoundedImageView_mutate_background, false);
isOval = a.getBoolean(R.styleable.RoundedImageView_oval, false);
mutateBackground = a.getBoolean(R.styleable.RoundedImageView_riv_mutate_background, false);
isOval = a.getBoolean(R.styleable.RoundedImageView_riv_oval, false);

updateDrawableAttrs();
updateBackgroundDrawableAttrs(true);
Expand Down
10 changes: 5 additions & 5 deletions roundedimageview/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="RoundedImageView">
<attr name="corner_radius" format="dimension" />
<attr name="border_width" format="dimension" />
<attr name="border_color" format="color" />
<attr name="mutate_background" format="boolean" />
<attr name="oval" format="boolean" />
<attr name="riv_corner_radius" format="dimension" />
<attr name="riv_border_width" format="dimension" />
<attr name="riv_border_color" format="color" />
<attr name="riv_mutate_background" format="boolean" />
<attr name="riv_oval" format="boolean" />
<attr name="android:scaleType" />
</declare-styleable>
</resources>

0 comments on commit c3d6989

Please sign in to comment.