當前位置: 首頁>>代碼示例>>Java>>正文


Java Drawable.jumpToCurrentState方法代碼示例

本文整理匯總了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();
        }
    }
}
 
開發者ID:nickyangjun,項目名稱:EasyEmoji,代碼行數:22,代碼來源:CommonUtil.java

示例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();
        }
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:20,代碼來源:AndroidUtilities.java

示例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();
    }
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:25,代碼來源:LUtils.java

示例4: jumpToCurrentState

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@Override
public void jumpToCurrentState(Drawable indeterminateDrawable) {
    indeterminateDrawable.jumpToCurrentState();
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:5,代碼來源:Utility11.java

示例5: jumpToCurrentState

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public static void jumpToCurrentState(Drawable drawable) {
    drawable.jumpToCurrentState();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:4,代碼來源:DrawableCompatHoneycomb.java


注:本文中的android.graphics.drawable.Drawable.jumpToCurrentState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。