diff --git a/app/src/main/java/com/rey/material/app/ContactView.java b/app/src/main/java/com/rey/material/app/ContactView.java index 10cb0a5e..6bdc7ce1 100644 --- a/app/src/main/java/com/rey/material/app/ContactView.java +++ b/app/src/main/java/com/rey/material/app/ContactView.java @@ -15,7 +15,6 @@ import android.graphics.Shader; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.os.Build; import android.support.annotation.NonNull; import android.support.v4.view.GravityCompat; import android.text.TextUtils; @@ -159,7 +158,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return mRippleManager.onTouchEvent(this, event) || result; + if(result) + mRippleManager.onTouchEvent(this, event); + return result; } public void setAvatarBitmap(Bitmap bm){ diff --git a/material/build.gradle b/material/build.gradle index 38b9c1fe..9b453434 100644 --- a/material/build.gradle +++ b/material/build.gradle @@ -31,6 +31,3 @@ dependencies { } // Place it at the end of the file -apply from: "$rootProject.projectDir/dist/distInfo.gradle" -apply from: "$rootProject.projectDir/dist/bintray.gradle" -apply from: "$rootProject.projectDir/dist/maven.gradle" diff --git a/material/src/main/java/com/rey/material/app/SimpleDialog.java b/material/src/main/java/com/rey/material/app/SimpleDialog.java index 33edbbd9..d70bc53d 100644 --- a/material/src/main/java/com/rey/material/app/SimpleDialog.java +++ b/material/src/main/java/com/rey/material/app/SimpleDialog.java @@ -163,6 +163,18 @@ private void initMessageView(){ mMessage.setGravity(Gravity.START | Gravity.CENTER_VERTICAL); } + /** + * Set a gravity to this message view + * @param gravity + * @return The SimpleDialog for chaining methods. + */ + public SimpleDialog messageGravity(int gravity){ + if(mMessage == null) + initMessageView(); + mMessage.setGravity(gravity); + return this; + } + /** * Set a message text to this SimpleDialog. * @param message diff --git a/material/src/main/java/com/rey/material/widget/Button.java b/material/src/main/java/com/rey/material/widget/Button.java index 7a1e8da8..150d2373 100644 --- a/material/src/main/java/com/rey/material/widget/Button.java +++ b/material/src/main/java/com/rey/material/widget/Button.java @@ -122,7 +122,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } } diff --git a/material/src/main/java/com/rey/material/widget/CheckedTextView.java b/material/src/main/java/com/rey/material/widget/CheckedTextView.java index 1bf60fce..97a23444 100644 --- a/material/src/main/java/com/rey/material/widget/CheckedTextView.java +++ b/material/src/main/java/com/rey/material/widget/CheckedTextView.java @@ -151,6 +151,8 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } } diff --git a/material/src/main/java/com/rey/material/widget/CompoundButton.java b/material/src/main/java/com/rey/material/widget/CompoundButton.java index ebb5a7db..90a1e188 100644 --- a/material/src/main/java/com/rey/material/widget/CompoundButton.java +++ b/material/src/main/java/com/rey/material/widget/CompoundButton.java @@ -229,7 +229,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } @Override diff --git a/material/src/main/java/com/rey/material/widget/FloatingActionButton.java b/material/src/main/java/com/rey/material/widget/FloatingActionButton.java index ed9e7342..3d890518 100644 --- a/material/src/main/java/com/rey/material/widget/FloatingActionButton.java +++ b/material/src/main/java/com/rey/material/widget/FloatingActionButton.java @@ -501,8 +501,10 @@ public boolean onTouchEvent(@NonNull MotionEvent event) { if(action == MotionEvent.ACTION_DOWN && ! mBackground.isPointerOver(event.getX(), event.getY())) return false; - boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + boolean result = super.onTouchEvent(event); + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } @Override diff --git a/material/src/main/java/com/rey/material/widget/FrameLayout.java b/material/src/main/java/com/rey/material/widget/FrameLayout.java index cd7b0f49..f2ddf3e2 100644 --- a/material/src/main/java/com/rey/material/widget/FrameLayout.java +++ b/material/src/main/java/com/rey/material/widget/FrameLayout.java @@ -110,7 +110,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } } diff --git a/material/src/main/java/com/rey/material/widget/ImageButton.java b/material/src/main/java/com/rey/material/widget/ImageButton.java index f286ae96..41301c3b 100644 --- a/material/src/main/java/com/rey/material/widget/ImageButton.java +++ b/material/src/main/java/com/rey/material/widget/ImageButton.java @@ -110,7 +110,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } } diff --git a/material/src/main/java/com/rey/material/widget/ImageView.java b/material/src/main/java/com/rey/material/widget/ImageView.java index 38b36430..76d8a678 100644 --- a/material/src/main/java/com/rey/material/widget/ImageView.java +++ b/material/src/main/java/com/rey/material/widget/ImageView.java @@ -113,7 +113,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } } diff --git a/material/src/main/java/com/rey/material/widget/LinearLayout.java b/material/src/main/java/com/rey/material/widget/LinearLayout.java index e01e7806..959c669f 100644 --- a/material/src/main/java/com/rey/material/widget/LinearLayout.java +++ b/material/src/main/java/com/rey/material/widget/LinearLayout.java @@ -113,7 +113,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } } diff --git a/material/src/main/java/com/rey/material/widget/RelativeLayout.java b/material/src/main/java/com/rey/material/widget/RelativeLayout.java index f1528859..138e2edf 100644 --- a/material/src/main/java/com/rey/material/widget/RelativeLayout.java +++ b/material/src/main/java/com/rey/material/widget/RelativeLayout.java @@ -110,7 +110,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } } diff --git a/material/src/main/java/com/rey/material/widget/TextView.java b/material/src/main/java/com/rey/material/widget/TextView.java index d372113f..42a43260 100644 --- a/material/src/main/java/com/rey/material/widget/TextView.java +++ b/material/src/main/java/com/rey/material/widget/TextView.java @@ -128,7 +128,9 @@ public void setOnClickListener(OnClickListener l) { @Override public boolean onTouchEvent(@NonNull MotionEvent event) { boolean result = super.onTouchEvent(event); - return getRippleManager().onTouchEvent(this, event) || result; + if(result) + getRippleManager().onTouchEvent(this, event); + return result; } public void setOnSelectionChangedListener(OnSelectionChangedListener listener){