Skip to content

Commit

Permalink
Added "mtn" prefix to attributes, to prevent naming conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDattilio committed Aug 10, 2015
1 parent 36f814c commit d89b677
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion motion-sample/src/main/res/layout/fragment_parallax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:id="@android:id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
parallax:tiltSensitivity="2.5"
parallax:mtn_tiltSensitivity="2.5"
/>

<LinearLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ public ParallaxImageView(Context context, AttributeSet attrs, int defStyle) {
final TypedArray customAttrs = context.obtainStyledAttributes(attrs, R.styleable.ParallaxImageView);

if (customAttrs != null) {
if (customAttrs.hasValue(R.styleable.ParallaxImageView_intensity)) {
setParallaxIntensity(customAttrs.getFloat(R.styleable.ParallaxImageView_intensity, mParallaxIntensity));
if (customAttrs.hasValue(R.styleable.ParallaxImageView_mtn_intensity)) {
setParallaxIntensity(customAttrs.getFloat(R.styleable.ParallaxImageView_mtn_intensity, mParallaxIntensity));
}

if (customAttrs.hasValue(R.styleable.ParallaxImageView_scaledIntensity)) {
setScaledIntensities(customAttrs.getBoolean(R.styleable.ParallaxImageView_scaledIntensity, mScaledIntensities));
if (customAttrs.hasValue(R.styleable.ParallaxImageView_mtn_scaledIntensity)) {
setScaledIntensities(customAttrs.getBoolean(R.styleable.ParallaxImageView_mtn_scaledIntensity, mScaledIntensities));
}

if (customAttrs.hasValue(R.styleable.ParallaxImageView_tiltSensitivity)) {
setTiltSensitivity(customAttrs.getFloat(R.styleable.ParallaxImageView_tiltSensitivity,
if (customAttrs.hasValue(R.styleable.ParallaxImageView_mtn_tiltSensitivity)) {
setTiltSensitivity(customAttrs.getFloat(R.styleable.ParallaxImageView_mtn_tiltSensitivity,
mSensorInterpreter.getTiltSensitivity()));
}

Expand Down
6 changes: 3 additions & 3 deletions motion/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="ParallaxImageView">
<attr name="intensity" format="float"/>
<attr name="tiltSensitivity" format="float"/>
<attr name="scaledIntensity" format="boolean"/>
<attr name="mtn_intensity" format="float"/>
<attr name="mtn_tiltSensitivity" format="float"/>
<attr name="mtn_scaledIntensity" format="boolean"/>
</declare-styleable>
</resources>

0 comments on commit d89b677

Please sign in to comment.