当前位置: 首页>>代码示例>>Java>>正文


Java AnimationDrawable.stop方法代码示例

本文整理汇总了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));
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:17,代码来源:YunRefreshHeader.java

示例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);
    }
}
 
开发者ID:javonleee,项目名称:DragPointView,代码行数:29,代码来源:PointViewAnimObject.java

示例3: stop

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private void stop() {
    if (animationView.getBackground() instanceof AnimationDrawable) {
        AnimationDrawable animation = (AnimationDrawable) animationView.getBackground();
        animation.stop();

        endPlayAnim();
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:9,代码来源:MsgViewHolderAudio.java

示例4: stopAnimation

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public void stopAnimation(){
    AnimationDrawable animationDrawable = (AnimationDrawable) audioAnttView.getBackground();
    if (animationDrawable.isRunning()) {
            animationDrawable.stop();
            animationDrawable.selectDrawable(0);
    }
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:8,代码来源:AudioRenderView.java

示例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();
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:7,代码来源:DrawableAnimationActivity.java


注:本文中的android.graphics.drawable.AnimationDrawable.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。