public static void shake(View view, Option option) {
if (option == null) {
option = getOption(view.getContext());
}
TranslateAnimation ta = new TranslateAnimation(-option.mOffsetX,
option.mOffsetX, -option.mOffsetY, option.mOffsetY);
ta.setDuration(option.mDuration);
ta.setInterpolator(new CycleInterpolator(option.mRepeatCount));
view.startAnimation(ta);
if (option.mVibrate) {
Vibrator v = (Vibrator) view.getContext().getSystemService(
Context.VIBRATOR_SERVICE);
v.vibrate(getVibratePattern(option), -1);
}
}
WindowShaker.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:WindowShaker
作者:
评论列表
文章目录