List of usage examples for android.util StateSet WILD_CARD
null WILD_CARD
To view the source code for android.util StateSet WILD_CARD.
Click Source Link
From source file:Main.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB) public static ColorStateList createActivatedColor(int passive, int active) { return new ColorStateList(new int[][] { new int[] { android.R.attr.state_activated }, StateSet.WILD_CARD }, new int[] { active, passive }); }
From source file:Main.java
@NonNull private static StateListDrawable getStateListDrawable(int normalColor, int pressedColor) { StateListDrawable states = new StateListDrawable(); states.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(pressedColor)); states.addState(new int[] { android.R.attr.state_focused }, new ColorDrawable(pressedColor)); states.addState(new int[] { android.R.attr.state_activated }, new ColorDrawable(pressedColor)); states.addState(new int[] {}, new ColorDrawable(normalColor)); states.addState(StateSet.WILD_CARD, new ColorDrawable(normalColor)); return states; }
From source file:com.facebook.litho.reference.DrawableResourcesCache.java
public void release(Drawable drawable, int resId) { SimplePoolWithCount<Drawable> drawablesPool = mDrawableCache.get(resId); if (drawablesPool == null) { drawablesPool = new SimplePoolWithCount<>(DRAWABLES_POOL_MAX_ITEMS); mDrawableCache.put(resId, drawablesPool); }//from w w w . j av a 2 s .co m // Reset a stateful drawable, and its animations, before being released. if (drawable.isStateful()) { drawable.setState(StateSet.WILD_CARD); if (SDK_INT >= HONEYCOMB) { drawable.jumpToCurrentState(); } } drawablesPool.release(drawable); }
From source file:com.vuze.android.remote.spanbubbles.SpanTags.java
private void createDrawTagables() { if (tagDrawables != null) { return;//from w w w.ja va2 s . com } if (context == null) { return; } Drawable drawableTag = ContextCompat.getDrawable(context, R.drawable.tag_q); Drawable drawableTagIdea = ContextCompat.getDrawable(context, R.drawable.tag_idea); Drawable drawableTagPending = ContextCompat.getDrawable(context, R.drawable.tag_pending); Drawable drawableTagSelected = ContextCompat.getDrawable(context, R.drawable.tag_check); tagDrawables = new StateListDrawable(); tagDrawables.addState(new int[] { android.R.attr.state_middle }, drawableTagPending); tagDrawables.addState(new int[] { android.R.attr.state_middle, android.R.attr.state_checked }, drawableTagPending); tagDrawables.addState(new int[] { android.R.attr.state_checked }, drawableTagSelected); tagDrawables.addState(new int[] { android.R.attr.state_single }, drawableTagIdea); tagDrawables.addState(StateSet.WILD_CARD, drawableTag); }
From source file:com.nihaskalam.progressbuttonlibrary.CircularProgressButton.java
private void initErrorStateDrawable() { int colorPressed = getPressedColor(mErrorColorState); StrokeGradientDrawable drawablePressed = createDrawable(colorPressed); mErrorStateDrawable = new StateListDrawable(); mErrorStateDrawable.addState(new int[] { android.R.attr.state_pressed }, drawablePressed.getGradientDrawable()); mErrorStateDrawable.addState(StateSet.WILD_CARD, background.getGradientDrawable()); }
From source file:com.nihaskalam.progressbuttonlibrary.CircularProgressButton.java
private void initCompleteStateDrawable() { int colorPressed = getPressedColor(mCompleteColorState); StrokeGradientDrawable drawablePressed = createDrawable(colorPressed); mCompleteStateDrawable = new StateListDrawable(); mCompleteStateDrawable.addState(new int[] { android.R.attr.state_pressed }, drawablePressed.getGradientDrawable()); mCompleteStateDrawable.addState(StateSet.WILD_CARD, background.getGradientDrawable()); }
From source file:com.nihaskalam.progressbuttonlibrary.CircularProgressButton.java
private void initCancelStateDrawable() { int colorPressed = getPressedColor(mCancelColorState); StrokeGradientDrawable drawablePressed = createDrawable(colorPressed); mCancelStateDrawable = new StateListDrawable(); mCancelStateDrawable.addState(new int[] { android.R.attr.state_pressed }, drawablePressed.getGradientDrawable()); mCancelStateDrawable.addState(StateSet.WILD_CARD, background.getGradientDrawable()); }
From source file:com.nihaskalam.progressbuttonlibrary.CircularProgressButton.java
private void initIdleStateDrawable() { int colorNormal = getNormalColor(mIdleColorState); int colorPressed = getPressedColor(mIdleColorState); int colorFocused = getFocusedColor(mIdleColorState); int colorDisabled = getDisabledColor(mIdleColorState); if (background == null) { background = createDrawable(colorNormal); }/*from w ww .ja va 2s . c o m*/ StrokeGradientDrawable drawableDisabled = createDrawable(colorDisabled); StrokeGradientDrawable drawableFocused = createDrawable(colorFocused); StrokeGradientDrawable drawablePressed = createDrawable(colorPressed); mIdleStateDrawable = new StateListDrawable(); mIdleStateDrawable.addState(new int[] { android.R.attr.state_pressed }, drawablePressed.getGradientDrawable()); mIdleStateDrawable.addState(new int[] { android.R.attr.state_focused }, drawableFocused.getGradientDrawable()); mIdleStateDrawable.addState(new int[] { -android.R.attr.state_enabled }, drawableDisabled.getGradientDrawable()); mIdleStateDrawable.addState(StateSet.WILD_CARD, background.getGradientDrawable()); }