當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。