本文整理汇总了Java中android.graphics.drawable.AnimationDrawable.stop方法的典型用法代码示例。如果您正苦于以下问题:Java AnimationDrawable.stop方法的具体用法?Java AnimationDrawable.stop怎么用?Java AnimationDrawable.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.drawable.AnimationDrawable
的用法示例。
在下文中一共展示了AnimationDrawable.stop方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private void initView() {
LayoutInflater.from(mContext).inflate(R.layout.kaws_refresh_header, this);
ImageView img = (ImageView) findViewById(R.id.img);
animationDrawable = (AnimationDrawable) img.getDrawable();
if (animationDrawable.isRunning()) {
animationDrawable.stop();
}
msg = (TextView) findViewById(R.id.msg);
measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
mMeasuredHeight = getMeasuredHeight();
setGravity(Gravity.CENTER_HORIZONTAL);
mContainer = (LinearLayout) findViewById(R.id.container);
mContainer.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 0));
this.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
示例2: start
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private void start(AnimationDrawable object, final OnPointDragListener removeListener) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
int duration = 0;
for (int i = 0; i < object.getNumberOfFrames(); i++) {
duration += object.getDuration(i);
}
view.postDelayed(new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
view.setBackground(background);
}
end(removeListener);
}
}, duration + 5);
view.setText("");
int drawableL = (view.getWidth() + view.getHeight()) / 2;
ViewGroup.LayoutParams lp = view.getLayoutParams();
lp.height = lp.width = drawableL;
view.setLayoutParams(lp);
view.setBackground(object);
if (object.isRunning())
object.stop();
object.start();
} else {
end(removeListener);
}
}
示例3: stop
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private void stop() {
if (animationView.getBackground() instanceof AnimationDrawable) {
AnimationDrawable animation = (AnimationDrawable) animationView.getBackground();
animation.stop();
endPlayAnim();
}
}
示例4: stopAnimation
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public void stopAnimation(){
AnimationDrawable animationDrawable = (AnimationDrawable) audioAnttView.getBackground();
if (animationDrawable.isRunning()) {
animationDrawable.stop();
animationDrawable.selectDrawable(0);
}
}
示例5: onClick
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
@OnClick(android.R.id.content)
public void onClick() {
AnimationDrawable animationDrawable = (AnimationDrawable) starIcon.getDrawable();
animationDrawable.stop();
animationDrawable.start();
}