本文整理汇总了Java中android.graphics.drawable.RippleDrawable.setHotspot方法的典型用法代码示例。如果您正苦于以下问题:Java RippleDrawable.setHotspot方法的具体用法?Java RippleDrawable.setHotspot怎么用?Java RippleDrawable.setHotspot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.drawable.RippleDrawable
的用法示例。
在下文中一共展示了RippleDrawable.setHotspot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActionDown
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionDown() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{android.R.attr.state_pressed});
} else if (Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
setPressed(true);
}
示例2: onActionUp
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionUp() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{});
} else if (Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
setPressed(false);
}
示例3: onActionDown
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionDown() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{android.R.attr.state_pressed});
} else if (Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
// setPressed(true);
}
示例4: onActionUp
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionUp() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{});
} else if (Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
// setPressed(false);
}
示例5: onActionUp
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionUp() {
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{android.R.attr.state_enabled});
} else if (Util.hasLollipop()) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{android.R.attr.state_enabled});
ripple.setHotspot(calculateCenterX(), calculateCenterY());
ripple.setVisible(true, true);
}
}
示例6: onActionDown
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionDown() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{android.R.attr.state_pressed});
} else if (Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
}
示例7: onActionUp
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionUp() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{});
} else if (Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
}
示例8: onActionDown
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionDown() {
if(mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if(mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[] {android.R.attr.state_pressed});
} else if(Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[] {android.R.attr.state_enabled,
android.R.attr.state_pressed});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
// setPressed(true);
}
示例9: onActionUp
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionUp() {
if(mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if(mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[] {});
} else if(Util.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[] {});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
// setPressed(false);
}
示例10: forceRippleAnimation
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
private void forceRippleAnimation(View view, MotionEvent event) {
Drawable background = view.getBackground();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && background instanceof RippleDrawable) {
final RippleDrawable rippleDrawable = (RippleDrawable) background;
rippleDrawable.setState(new int[]{android.R.attr.state_pressed, android.R.attr.state_enabled});
rippleDrawable.setHotspot(event.getX(), event.getY());
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
rippleDrawable.setState(new int[]{});
}
}, 300);
}
}
示例11: onActionDown
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionDown() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{android.R.attr.state_pressed});
} else if (Label.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
setPressed(true);
}
示例12: onActionUp
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionUp() {
if (mUsingStyle) {
mBackgroundDrawable = getBackground();
}
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{});
} else if (Label.hasLollipop() && mBackgroundDrawable instanceof RippleDrawable) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{});
ripple.setHotspot(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
ripple.setVisible(true, true);
}
setPressed(false);
}
示例13: onActionDown
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionDown() {
if (mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed});
} else if (Util.hasLollipop()) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed});
ripple.setHotspot(calculateCenterX(), calculateCenterY());
ripple.setVisible(true, true);
}
}
示例14: onActionDown
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionDown() {
if(!mUsingRipple) return;
if(mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[] {android.R.attr.state_enabled,
android.R.attr.state_pressed});
} else if(Util.hasLollipop()) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[] {android.R.attr.state_enabled,
android.R.attr.state_pressed});
ripple.setHotspot(calculateCenterX(), calculateCenterY());
ripple.setVisible(true, true);
}
}
示例15: onActionUp
import android.graphics.drawable.RippleDrawable; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void onActionUp() {
if(!mUsingRipple) return;
if(mBackgroundDrawable instanceof StateListDrawable) {
StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable;
drawable.setState(new int[] {android.R.attr.state_enabled});
} else if(Util.hasLollipop()) {
RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable;
ripple.setState(new int[] {android.R.attr.state_enabled});
ripple.setHotspot(calculateCenterX(), calculateCenterY());
ripple.setVisible(true, true);
}
}