Rename RippleOldDrawable to RippleDrawable
This commit is contained in:
1 parent
111cee1299
commit
795682f31f
2 files changed
+10
-10
No files matched your search
+3
-3
@@ -76,9 +76,9 @@ import java.util.Arrays;
|
||||
*
|
||||
* @attr ref android.R.styleable#RippleDrawable_color
|
||||
*/
|
||||
public class RippleOldDrawable extends Drawable implements RippleOwner, Hotspotable {
|
||||
public class RippleDrawable extends Drawable implements RippleOwner, Hotspotable {
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = RippleOldDrawable.class.getSimpleName();
|
||||
private static final String TAG = RippleDrawable.class.getSimpleName();
|
||||
|
||||
/** The maximum number of ripples supported. */
|
||||
private static final int MAX_RIPPLES = 10;
|
||||
@@ -132,7 +132,7 @@ public class RippleOldDrawable extends Drawable implements RippleOwner, Hotspota
|
||||
|
||||
private final Drawable mContent;
|
||||
|
||||
RippleOldDrawable(ColorStateList color, Drawable content) {
|
||||
RippleDrawable(ColorStateList color, Drawable content) {
|
||||
setColor(color);
|
||||
|
||||
mContent = content;
|
||||
@@ -21,7 +21,6 @@ import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.RippleDrawable;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
|
||||
@@ -47,17 +46,18 @@ public final class RippleSalon {
|
||||
addRipple(v, color, v.getBackground());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public static void addRipple(View v, ColorStateList color, Drawable content) {
|
||||
if (USE_OLD_RIPPLE) {
|
||||
RippleOldDrawable rippleOldDrawable = new RippleOldDrawable(color, content);
|
||||
v.setOnTouchListener(new HotspotTouchHelper(rippleOldDrawable));
|
||||
v.setBackgroundDrawable(rippleOldDrawable);
|
||||
RippleDrawable rippleDrawable = new RippleDrawable(color, content);
|
||||
v.setOnTouchListener(new HotspotTouchHelper(rippleDrawable));
|
||||
//noinspection deprecation
|
||||
v.setBackgroundDrawable(rippleDrawable);
|
||||
} else {
|
||||
RippleDrawable rippleDrawable = new RippleDrawable(color, content, MASK);
|
||||
android.graphics.drawable.RippleDrawable rippleDrawable =
|
||||
new android.graphics.drawable.RippleDrawable(color, content, MASK);
|
||||
//noinspection deprecation
|
||||
v.setBackgroundDrawable(rippleDrawable);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user