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


Java Animatable.isRunning方法代码示例

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


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

示例1: start

import android.graphics.drawable.Animatable; //导入方法依赖的package包/类
public void start() {
    setVisibility(View.VISIBLE);
    Animatable animatable = (Animatable) getDrawable();
    if (!animatable.isRunning()) {
        animatable.start();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:ProgressImageView.java

示例2: stop

import android.graphics.drawable.Animatable; //导入方法依赖的package包/类
public void stop() {
    Animatable animatable = (Animatable) getDrawable();
    if (animatable.isRunning()) {
        animatable.stop();
    }
    setVisibility(View.GONE);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:ProgressImageView.java

示例3: startAnimatable

import android.graphics.drawable.Animatable; //导入方法依赖的package包/类
private void startAnimatable() {
    if (drawable instanceof Animatable) {
        Animatable animatable = (Animatable) drawable;
        if (!animatable.isRunning()) {
            drawable.setCallback(viewGroup);
            animatable.start();
        }
    }
}
 
开发者ID:mReady,项目名称:progress-layouts,代码行数:10,代码来源:ProgressLayoutHelper.java

示例4: stopAnimatable

import android.graphics.drawable.Animatable; //导入方法依赖的package包/类
private void stopAnimatable() {
    if (drawable instanceof Animatable) {
        Animatable animatable = (Animatable) drawable;
        if (animatable.isRunning()) {
            animatable.stop();
            drawable.setCallback(null);
        }
    }
}
 
开发者ID:mReady,项目名称:progress-layouts,代码行数:10,代码来源:ProgressLayoutHelper.java

示例5: setImageDrawable

import android.graphics.drawable.Animatable; //导入方法依赖的package包/类
private static void setImageDrawable(@NonNull ImageView imageView, @DrawableRes int drawableResId, @NonNull Enum<?> type, @ColorInt int tintColor) {
    if (drawableResId == 0) {
        Log.e(TAG, "The drawable for the " + type.name() + " type is not valid");
        return;
    }
    Drawable drawable = ResourcesCompat.getDrawable(imageView.getContext(), drawableResId);
    if (drawable == null) {
        Log.e(TAG, "The drawable with id " + drawableResId + " is null");
        return;
    }
    if (Build.VERSION.SDK_INT != Build.VERSION_CODES.M) {
        drawable = drawable.mutate();
    }
    if (tintColor != 0) {
        drawable.setColorFilter(tintColor, PorterDuff.Mode.SRC_IN);
    }

    imageView.setImageDrawable(drawable);
    imageView.setTag(R.id.eavd_current_type, type);
    imageView.setTag(R.id.eavd_current_tint_color, tintColor);

    if (drawable instanceof Animatable) {
        Animatable animatable = (Animatable) drawable;
        if (animatable.isRunning()) {
            animatable.stop();
        }
        animatable.start();
    }
}
 
开发者ID:DenisMondon,项目名称:easy-animated-vector-drawable,代码行数:30,代码来源:EasyAnimatedVectorDrawable.java


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