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


Java IconDrawable.pulse方法代码示例

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


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

示例1: IconImageView

import com.joanzapata.iconify.IconDrawable; //导入方法依赖的package包/类
public IconImageView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    final TypedArray a = context.obtainStyledAttributes(
            attrs, R.styleable.IconImageView, defStyleAttr, 0);
    ColorStateList colorStateList = a.getColorStateList(R.styleable.IconImageView_iconColor);
    if (colorStateList != null) {
        this.colorStateList = colorStateList;
    }
    String iconKey = a.getString(R.styleable.IconImageView_iconName);
    if (iconKey != null) {
        IconDrawable drawable = new IconDrawable(context, iconKey);
        switch (Animation.values()[a.getInt(R.styleable.IconImageView_iconAnimation,
                Animation.NONE.ordinal())]) {
            case SPIN:
                drawable.spin();
                break;
            case PULSE:
                drawable.pulse();
                break;
        }
        setImageDrawable(drawable);
    }
    a.recycle();
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:25,代码来源:IconImageView.java

示例2: setIconAnimation

import com.joanzapata.iconify.IconDrawable; //导入方法依赖的package包/类
public void setIconAnimation(@NonNull Animation animation, boolean restart) {
    Drawable drawable = getDrawable();
    if (drawable instanceof IconDrawable) {
        IconDrawable iconDrawable = (IconDrawable) drawable;
        switch (animation) {
            case SPIN:
                iconDrawable.spin();
                break;
            case PULSE:
                iconDrawable.pulse();
                break;
            case NONE:
                iconDrawable.stop();
                break;
        }
        if (restart && getVisibility() == VISIBLE) {
            iconDrawable.setVisible(true, true);
        }
    }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:21,代码来源:IconImageView.java

示例3: IconImageButton

import com.joanzapata.iconify.IconDrawable; //导入方法依赖的package包/类
public IconImageButton(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    final TypedArray a = context.obtainStyledAttributes(
            attrs, R.styleable.IconImageView, defStyleAttr, 0);
    ColorStateList colorStateList = a.getColorStateList(R.styleable.IconImageView_iconColor);
    if (colorStateList != null) {
        this.colorStateList = colorStateList;
    }
    String iconKey = a.getString(R.styleable.IconImageView_iconName);
    if (iconKey != null) {
        IconDrawable drawable = new IconDrawable(context, iconKey);
        switch (Animation.values()[a.getInt(R.styleable.IconImageView_iconAnimation,
                Animation.NONE.ordinal())]) {
            case SPIN:
                drawable.spin();
                break;
            case PULSE:
                drawable.pulse();
                break;
        }
        setImageDrawable(drawable);
    }
    a.recycle();
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:25,代码来源:IconImageButton.java

示例4: IconProgressBar

import com.joanzapata.iconify.IconDrawable; //导入方法依赖的package包/类
public IconProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    final TypedArray a = context.obtainStyledAttributes(
            attrs, R.styleable.IconProgressBar, defStyleAttr, 0);
    ColorStateList colorStateList = a.getColorStateList(
            R.styleable.IconProgressBar_indeterminateIconColor);
    this.colorStateList = colorStateList != null ? colorStateList :
            ColorStateList.valueOf(DEFAULT_COLOR);
    String iconKey = a.getString(R.styleable.IconProgressBar_indeterminateIconName);
    if (iconKey != null) {
        IconDrawable drawable = new IconDrawable(context, iconKey);
        if (a.getBoolean(R.styleable.IconProgressBar_indeterminateIconPulse, false)) {
            // Change animation mode to pulse without running it, as the
            // animation is controlled by the ProgressBar implementation.
            drawable.pulse();
            drawable.stop();
        }
        setIndeterminateDrawable(drawable);
    }
    a.recycle();
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:22,代码来源:IconProgressBar.java


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