本文整理匯總了Java中android.graphics.drawable.Drawable.jumpToCurrentState方法的典型用法代碼示例。如果您正苦於以下問題:Java Drawable.jumpToCurrentState方法的具體用法?Java Drawable.jumpToCurrentState怎麽用?Java Drawable.jumpToCurrentState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.graphics.drawable.Drawable
的用法示例。
在下文中一共展示了Drawable.jumpToCurrentState方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: clearDrawableAnimation
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
/**
* 清除View(etc:ListView) 拉至頂部或底部的橡皮筋效果
*/
public static void clearDrawableAnimation(View view) {
if (Build.VERSION.SDK_INT < 21 || view == null) {
return;
}
Drawable drawable;
if (view instanceof ListView) {
drawable = ((ListView) view).getSelector();
if (drawable != null) {
drawable.setState(StateSet.NOTHING);
}
} else {
drawable = view.getBackground();
if (drawable != null) {
drawable.setState(StateSet.NOTHING);
drawable.jumpToCurrentState();
}
}
}
示例2: clearDrawableAnimation
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@SuppressLint("NewApi")
public static void clearDrawableAnimation(View view) {
if (Build.VERSION.SDK_INT < 21 || view == null) {
return;
}
Drawable drawable;
if (view instanceof ListView) {
drawable = ((ListView) view).getSelector();
if (drawable != null) {
drawable.setState(StateSet.NOTHING);
}
} else {
drawable = view.getBackground();
if (drawable != null) {
drawable.setState(StateSet.NOTHING);
drawable.jumpToCurrentState();
}
}
}
示例3: setOrAnimatePlusCheckIcon
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public void setOrAnimatePlusCheckIcon(final FloatingActionButton fab, boolean isCheck,
boolean allowAnimate) {
if (!hasL()) {
compatSetOrAnimatePlusCheckIcon(fab, isCheck, allowAnimate);
return;
}
Drawable drawable = fab.getDrawable();
if (!(drawable instanceof AnimatedStateListDrawable)) {
Resources res = mActivity.getResources();
drawable = res.getDrawable(R.drawable.add_schedule_fab_icon_anim);
drawable.setTint(res.getColor(R.color.fab_icon_color));
fab.setImageDrawable(drawable);
}
if (allowAnimate) {
drawable.setState(isCheck ? STATE_UNCHECKED : STATE_CHECKED);
drawable.jumpToCurrentState();
drawable.setState(isCheck ? STATE_CHECKED : STATE_UNCHECKED);
} else {
drawable.setState(isCheck ? STATE_CHECKED : STATE_UNCHECKED);
drawable.jumpToCurrentState();
}
}
示例4: jumpToCurrentState
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@Override
public void jumpToCurrentState(Drawable indeterminateDrawable) {
indeterminateDrawable.jumpToCurrentState();
}
示例5: jumpToCurrentState
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public static void jumpToCurrentState(Drawable drawable) {
drawable.jumpToCurrentState();
}