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


Java AnimationDrawable.isRunning方法代码示例

本文整理汇总了Java中android.graphics.drawable.AnimationDrawable.isRunning方法的典型用法代码示例。如果您正苦于以下问题:Java AnimationDrawable.isRunning方法的具体用法?Java AnimationDrawable.isRunning怎么用?Java AnimationDrawable.isRunning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.graphics.drawable.AnimationDrawable的用法示例。


在下文中一共展示了AnimationDrawable.isRunning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActivityCreated

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mLlProgressBar = getView(R.id.ll_progress_bar);
    ImageView img = getView(R.id.img_progress);

    // 加载动画
    mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默认进入页面就开启动画
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    mRefresh = getView(R.id.ll_error_refresh);
    // 点击加载失败布局
    mRefresh.setOnClickListener(new PerfectClickListener() {
        @Override
        protected void onNoDoubleClick(View v) {
            showLoading();
            onRefresh();
        }
    });
    bindingView.getRoot().setVisibility(View.GONE);

}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:25,代码来源:BaseFragment.java

示例2: 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

示例3: initView

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public void initView(Context context) {
    LayoutInflater.from(context).inflate(R.layout.yun_refresh_footer, this);
    mText = (TextView) findViewById(R.id.msg);
    mIvProgress = (ImageView) findViewById(R.id.iv_progress);
    mAnimationDrawable = (AnimationDrawable) mIvProgress.getDrawable();
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:LoadingMoreFooter.java

示例4: initLoading

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private void initLoading() {
    //加载中
    llLoading.setStatus(LoadingLayout.Loading);
    ImageView img = (ImageView) findViewById(R.id.iv_loading_progress);
    // 加载动画
    AnimationDrawable mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默认进入页面就开启动画
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    //网络错误之类的
    if (!JUtils.isNetWorkAvilable()) {
        llLoading.setStatus(LoadingLayout.No_Network);
        return;
    }
}
 
开发者ID:zhao-mingjian,项目名称:qvod,代码行数:17,代码来源:MovieDetailsActivity.java

示例5: setContentView

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
@Override
public void setContentView(@LayoutRes int layoutResID) {

    mBaseBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_base, null, false);
    bindingView = DataBindingUtil.inflate(getLayoutInflater(), layoutResID, null, false);

    // content
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    bindingView.getRoot().setLayoutParams(params);
    RelativeLayout mContainer = (RelativeLayout) mBaseBinding.getRoot().findViewById(R.id.container);
    mContainer.addView(bindingView.getRoot());
    getWindow().setContentView(mBaseBinding.getRoot());

    // 设置透明状态栏
    StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme),0);
    llProgressBar = getView(R.id.ll_progress_bar);
    refresh = getView(R.id.ll_error_refresh);
    ImageView img = getView(R.id.img_progress);

    // 加载动画
    mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默认进入页面就开启动画
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }

    setToolBar();
    // 点击加载失败布局
    refresh.setOnClickListener(new PerfectClickListener() {
        @Override
        protected void onNoDoubleClick(View v) {
            showLoading();
            onRefresh();
        }
    });
    bindingView.getRoot().setVisibility(View.GONE);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:38,代码来源:BaseActivity.java

示例6: startAnimation

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public void startAnimation() {
    try {
        if (mListDrawable.getLevel() == 0) {
            mListDrawable.setLevel(1);
            animation = (AnimationDrawable) mListDrawable.getCurrent();
            if (!animation.isRunning())
                animation.start();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:13,代码来源:RspMsgItemView.java

示例7: LoadingImageView

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public LoadingImageView(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    setImageResource(R.drawable.anim_yun);
    // 加载动画
    AnimationDrawable mAnimationDrawable = (AnimationDrawable) getDrawable();
    // 默认进入页面就开启动画
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
}
 
开发者ID:zhao-mingjian,项目名称:qvod,代码行数:11,代码来源:LoadingImageView.java

示例8: 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

示例9: setContentView

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
@Override
public void setContentView(@LayoutRes int layoutResID) {
    mBaseBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_base, null, false);
    bindingView = DataBindingUtil.inflate(getLayoutInflater(), layoutResID, null, false);

    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    bindingView.getRoot().setLayoutParams(params);
    RelativeLayout mContainer = (RelativeLayout) mBaseBinding.getRoot().findViewById(R.id.container);
    mContainer.addView(bindingView.getRoot());
    getWindow().setContentView(mBaseBinding.getRoot());

    //设置透明状态栏
    StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme),0);

    llProgressBar = getView(R.id.ll_progress_bar);
    refresh=getView(R.id.ll_error_refresh);
    ImageView img = getView(R.id.img_progress);
            // 加载动画
            mAnimationDrawable= (AnimationDrawable) img.getDrawable();
    //默认进入页面就开启动画
    if(!mAnimationDrawable.isRunning()){
        mAnimationDrawable.start();
    }
    OnceInit.once(this);
    setToolBar();
    bindingView.getRoot().setVisibility(View.GONE);
}
 
开发者ID:jutao,项目名称:GankReader,代码行数:28,代码来源:BaseActivity.java

示例10: onActivityCreated

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mLlProgressBar = getView(R.id.ll_progress_bar);
    ImageView img = getView(R.id.img_progress);

    //加载动画
    mAnimationDrawable= (AnimationDrawable) img.getDrawable();
    //默认进入页面就加载动画
    if(!mAnimationDrawable.isRunning()){
        mAnimationDrawable.start();
    }
    mRefresh=getView(R.id.ll_error_refresh);
    bindingView.getRoot().setVisibility(View.GONE);
}
 
开发者ID:jutao,项目名称:GankReader,代码行数:16,代码来源:BaseFragment.java

示例11: createLoadingView

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private View createLoadingView() {
    loadingView = LayoutInflater.from(mContext).inflate(R.layout.basefragment_state_loading, null);
    img = (ImageView) loadingView.getRootView().findViewById(R.id.img_progress);
    // 加载动画 这边也可以直接用progressbar 可以看看topnews页下拉刷新就是只用用progressbar控制动画
    mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默认进入页面就开启动画
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    return loadingView;
}
 
开发者ID:paterWang,项目名称:EasyReader,代码行数:12,代码来源:LoadingPage.java

示例12: endOfSpeech

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public void endOfSpeech() {
    if (null == imgMic) return;
    imgMic.setImageResource(R.drawable.rc_anim_speech_end);
    animEnd = (AnimationDrawable) imgMic.getDrawable();
    if (!animEnd.isRunning()) {
        animEnd.start();
    }
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:9,代码来源:RecognizerView.java

示例13: beginOfSpeech

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public void beginOfSpeech() {
    if (null == imgMic) return;
    imgMic.setImageResource(R.drawable.rc_anim_speech_start);
    animStart = (AnimationDrawable) imgMic.getDrawable();
    if (!animStart.isRunning()) {
        animStart.start();
    }
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:9,代码来源:RecognizerView.java

示例14: 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

示例15: setContentView

import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
@Override
public void setContentView(@LayoutRes int layoutResID) {
    View ll = getLayoutInflater().inflate(R.layout.activity_header_base, null);

    // 内容
    bindingContentView = DataBindingUtil.inflate(getLayoutInflater(), layoutResID, null, false);
    // 头部
    bindingHeaderView = DataBindingUtil.inflate(getLayoutInflater(), setHeaderLayout(), null, false);
    // 标题
    bindingTitleView = DataBindingUtil.inflate(getLayoutInflater(), R.layout.base_header_title_bar, null, false);

    // title (如自定义很强可以拿出去)
    RelativeLayout.LayoutParams titleParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    bindingTitleView.getRoot().setLayoutParams(titleParams);
    RelativeLayout mTitleContainer = (RelativeLayout) ll.findViewById(R.id.title_container);
    mTitleContainer.addView(bindingTitleView.getRoot());
    getWindow().setContentView(ll);

    // header
    RelativeLayout.LayoutParams headerParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    bindingHeaderView.getRoot().setLayoutParams(headerParams);
    RelativeLayout mHeaderContainer = (RelativeLayout) ll.findViewById(R.id.header_container);
    mHeaderContainer.addView(bindingHeaderView.getRoot());
    getWindow().setContentView(ll);

    // content
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    bindingContentView.getRoot().setLayoutParams(params);
    RelativeLayout mContainer = (RelativeLayout) ll.findViewById(R.id.container);
    mContainer.addView(bindingContentView.getRoot());
    getWindow().setContentView(ll);

    llProgressBar = getView(R.id.ll_progress_bar);
    refresh = getView(R.id.ll_error_refresh);

    // 设置自定义元素共享切换动画
    setMotion(setHeaderPicView(),false);

    // 初始化滑动渐变
    initSlideShapeTheme(setHeaderImgUrl(), setHeaderImageView());

    // 设置toolbar
    setToolBar();

    ImageView img = getView(R.id.img_progress);

    // 加载动画
    mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默认进入页面就开启动画
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    // 点击加载失败布局
    refresh.setOnClickListener(new PerfectClickListener() {
        @Override
        protected void onNoDoubleClick(View v) {
            showLoading();
            onRefresh();
        }
    });
    bindingContentView.getRoot().setVisibility(View.GONE);

}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:64,代码来源:BaseHeaderActivity.java


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