Skip to content

Commit

Permalink
Prefix MaterialRippleLayout attributes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
balysv committed Feb 16, 2015
1 parent 5bcad28 commit c91ed82
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions demo/src/main/res/layout/demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
android:layout_height="wrap_content"
android:background="#ffff00"
android:layout_marginTop="24dp"
app:rippleOverlay="true"
app:rippleColor="#585858"
app:rippleAlpha="0.2"
app:rippleDelayClick="false"
app:rippleHover="true">
app:mrl_rippleOverlay="true"
app:mrl_rippleColor="#585858"
app:mrl_rippleAlpha="0.2"
app:mrl_rippleDelayClick="false"
app:mrl_rippleHover="true">

<Button
android:id="@+id/ripple_layout_1"
Expand Down
8 changes: 4 additions & 4 deletions demo/src/main/res/layout/demo_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="70dp"
app:rippleOverlay="false"
app:rippleColor="#585858"
app:rippleAlpha="0.2"
app:rippleHover="true">
app:mrl_rippleOverlay="false"
app:mrl_rippleColor="#585858"
app:mrl_rippleAlpha="0.2"
app:mrl_rippleHover="true">

<TextView
android:id="@android:id/text1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,21 @@ public MaterialRippleLayout(Context context, AttributeSet attrs, int defStyle) {
gestureDetector = new GestureDetector(context, longClickListener);

TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MaterialRippleLayout);
rippleColor = a.getColor(R.styleable.MaterialRippleLayout_rippleColor, DEFAULT_COLOR);
rippleColor = a.getColor(R.styleable.MaterialRippleLayout_mrl_rippleColor, DEFAULT_COLOR);
rippleDiameter = a.getDimensionPixelSize(
R.styleable.MaterialRippleLayout_rippleDimension,
R.styleable.MaterialRippleLayout_mrl_rippleDimension,
(int) dpToPx(getResources(), DEFAULT_DIAMETER_DP)
);
rippleOverlay = a.getBoolean(R.styleable.MaterialRippleLayout_rippleOverlay, DEFAULT_RIPPLE_OVERLAY);
rippleHover = a.getBoolean(R.styleable.MaterialRippleLayout_rippleHover, DEFAULT_HOVER);
rippleDuration = a.getInt(R.styleable.MaterialRippleLayout_rippleDuration, DEFAULT_DURATION);
rippleAlpha = (int) (255 * a.getFloat(R.styleable.MaterialRippleLayout_rippleAlpha, DEFAULT_ALPHA));
rippleDelayClick = a.getBoolean(R.styleable.MaterialRippleLayout_rippleDelayClick, DEFAULT_DELAY_CLICK);
rippleFadeDuration = a.getInteger(R.styleable.MaterialRippleLayout_rippleFadeDuration, DEFAULT_FADE_DURATION);
rippleBackground = new ColorDrawable(a.getColor(R.styleable.MaterialRippleLayout_rippleBackground, DEFAULT_BACKGROUND));
ripplePersistent = a.getBoolean(R.styleable.MaterialRippleLayout_ripplePersistent, DEFAULT_PERSISTENT);
rippleInAdapter = a.getBoolean(R.styleable.MaterialRippleLayout_rippleInAdapter, DEFAULT_SEARCH_ADAPTER);
rippleRoundedCorners = a.getDimensionPixelSize(R.styleable.MaterialRippleLayout_rippleRoundedCorners, DEFAULT_ROUNDED_CORNERS);
rippleOverlay = a.getBoolean(R.styleable.MaterialRippleLayout_mrl_rippleOverlay, DEFAULT_RIPPLE_OVERLAY);
rippleHover = a.getBoolean(R.styleable.MaterialRippleLayout_mrl_rippleHover, DEFAULT_HOVER);
rippleDuration = a.getInt(R.styleable.MaterialRippleLayout_mrl_rippleDuration, DEFAULT_DURATION);
rippleAlpha = (int) (255 * a.getFloat(R.styleable.MaterialRippleLayout_mrl_rippleAlpha, DEFAULT_ALPHA));
rippleDelayClick = a.getBoolean(R.styleable.MaterialRippleLayout_mrl_rippleDelayClick, DEFAULT_DELAY_CLICK);
rippleFadeDuration = a.getInteger(R.styleable.MaterialRippleLayout_mrl_rippleFadeDuration, DEFAULT_FADE_DURATION);
rippleBackground = new ColorDrawable(a.getColor(R.styleable.MaterialRippleLayout_mrl_rippleBackground, DEFAULT_BACKGROUND));
ripplePersistent = a.getBoolean(R.styleable.MaterialRippleLayout_mrl_ripplePersistent, DEFAULT_PERSISTENT);
rippleInAdapter = a.getBoolean(R.styleable.MaterialRippleLayout_mrl_rippleInAdapter, DEFAULT_SEARCH_ADAPTER);
rippleRoundedCorners = a.getDimensionPixelSize(R.styleable.MaterialRippleLayout_mrl_rippleRoundedCorners, DEFAULT_ROUNDED_CORNERS);

a.recycle();

Expand Down
24 changes: 12 additions & 12 deletions library/src/main/res/values/attributes.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="MaterialRippleLayout">
<attr name="rippleColor" format="color" localization="suggested" />
<attr name="rippleDimension" format="dimension" localization="suggested" />
<attr name="rippleOverlay" format="boolean" localization="suggested" />
<attr name="rippleAlpha" format="float" localization="suggested" />
<attr name="rippleDuration" format="integer" localization="suggested" />
<attr name="rippleFadeDuration" format="integer" localization="suggested" />
<attr name="rippleHover" format="boolean" localization="suggested" />
<attr name="rippleBackground" format="color" localization="suggested" />
<attr name="rippleDelayClick" format="boolean" localization="suggested" />
<attr name="ripplePersistent" format="boolean" localization="suggested" />
<attr name="rippleInAdapter" format="boolean" localization="suggested" />
<attr name="rippleRoundedCorners" format="dimension" localization="suggested" />
<attr name="mrl_rippleColor" format="color" localization="suggested" />
<attr name="mrl_rippleDimension" format="dimension" localization="suggested" />
<attr name="mrl_rippleOverlay" format="boolean" localization="suggested" />
<attr name="mrl_rippleAlpha" format="float" localization="suggested" />
<attr name="mrl_rippleDuration" format="integer" localization="suggested" />
<attr name="mrl_rippleFadeDuration" format="integer" localization="suggested" />
<attr name="mrl_rippleHover" format="boolean" localization="suggested" />
<attr name="mrl_rippleBackground" format="color" localization="suggested" />
<attr name="mrl_rippleDelayClick" format="boolean" localization="suggested" />
<attr name="mrl_ripplePersistent" format="boolean" localization="suggested" />
<attr name="mrl_rippleInAdapter" format="boolean" localization="suggested" />
<attr name="mrl_rippleRoundedCorners" format="dimension" localization="suggested" />
</declare-styleable>
</resources>

0 comments on commit c91ed82

Please sign in to comment.