本文整理汇总了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();
}
示例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);
}
}
}
示例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();
}
示例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();
}