Lines Matching refs:drawable

17 package android.support.v4.graphics.drawable;
23 import android.graphics.drawable.Drawable;
35 * Helper for accessing features in {@link android.graphics.drawable.Drawable}
43 void jumpToCurrentState(Drawable drawable);
44 void setAutoMirrored(Drawable drawable, boolean mirrored);
45 boolean isAutoMirrored(Drawable drawable);
46 void setHotspot(Drawable drawable, float x, float y);
47 void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom);
48 void setTint(Drawable drawable, int tint);
49 void setTintList(Drawable drawable, ColorStateList tint);
50 void setTintMode(Drawable drawable, PorterDuff.Mode tintMode);
51 Drawable wrap(Drawable drawable);
52 boolean setLayoutDirection(Drawable drawable, int layoutDirection);
53 int getLayoutDirection(Drawable drawable);
54 int getAlpha(Drawable drawable);
55 void applyTheme(Drawable drawable, Resources.Theme t);
56 boolean canApplyTheme(Drawable drawable);
57 ColorFilter getColorFilter(Drawable drawable);
58 void clearColorFilter(Drawable drawable);
59 void inflate(Drawable drawable, Resources res, XmlPullParser parser, AttributeSet attrs,
68 public void jumpToCurrentState(Drawable drawable) {
72 public void setAutoMirrored(Drawable drawable, boolean mirrored) {
76 public boolean isAutoMirrored(Drawable drawable) {
81 public void setHotspot(Drawable drawable, float x, float y) {
85 public void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
89 public void setTint(Drawable drawable, int tint) {
90 DrawableCompatBase.setTint(drawable, tint);
94 public void setTintList(Drawable drawable, ColorStateList tint) {
95 DrawableCompatBase.setTintList(drawable, tint);
99 public void setTintMode(Drawable drawable, PorterDuff.Mode tintMode) {
100 DrawableCompatBase.setTintMode(drawable, tintMode);
104 public Drawable wrap(Drawable drawable) {
105 return DrawableCompatBase.wrapForTinting(drawable);
109 public boolean setLayoutDirection(Drawable drawable, int layoutDirection) {
115 public int getLayoutDirection(Drawable drawable) {
120 public int getAlpha(Drawable drawable) {
125 public void applyTheme(Drawable drawable, Resources.Theme t) {
129 public boolean canApplyTheme(Drawable drawable) {
134 public ColorFilter getColorFilter(Drawable drawable) {
139 public void clearColorFilter(Drawable drawable) {
140 drawable.clearColorFilter();
144 public void inflate(Drawable drawable, Resources res, XmlPullParser parser,
147 DrawableCompatBase.inflate(drawable, res, parser, attrs, t);
156 public void jumpToCurrentState(Drawable drawable) {
157 DrawableCompatHoneycomb.jumpToCurrentState(drawable);
161 public Drawable wrap(Drawable drawable) {
162 return DrawableCompatHoneycomb.wrapForTinting(drawable);
168 public boolean setLayoutDirection(Drawable drawable, int layoutDirection) {
169 return DrawableCompatJellybeanMr1.setLayoutDirection(drawable, layoutDirection);
173 public int getLayoutDirection(Drawable drawable) {
174 final int dir = DrawableCompatJellybeanMr1.getLayoutDirection(drawable);
184 public void setAutoMirrored(Drawable drawable, boolean mirrored) {
185 DrawableCompatKitKat.setAutoMirrored(drawable, mirrored);
189 public boolean isAutoMirrored(Drawable drawable) {
190 return DrawableCompatKitKat.isAutoMirrored(drawable);
194 public Drawable wrap(Drawable drawable) {
195 return DrawableCompatKitKat.wrapForTinting(drawable);
199 public int getAlpha(Drawable drawable) {
200 return DrawableCompatKitKat.getAlpha(drawable);
209 public void setHotspot(Drawable drawable, float x, float y) {
210 DrawableCompatLollipop.setHotspot(drawable, x, y);
214 public void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
215 DrawableCompatLollipop.setHotspotBounds(drawable, left, top, right, bottom);
219 public void setTint(Drawable drawable, int tint) {
220 DrawableCompatLollipop.setTint(drawable, tint);
224 public void setTintList(Drawable drawable, ColorStateList tint) {
225 DrawableCompatLollipop.setTintList(drawable, tint);
229 public void setTintMode(Drawable drawable, PorterDuff.Mode tintMode) {
230 DrawableCompatLollipop.setTintMode(drawable, tintMode);
234 public Drawable wrap(Drawable drawable) {
235 return DrawableCompatLollipop.wrapForTinting(drawable);
239 public void applyTheme(Drawable drawable, Resources.Theme t) {
240 DrawableCompatLollipop.applyTheme(drawable, t);
244 public boolean canApplyTheme(Drawable drawable) {
245 return DrawableCompatLollipop.canApplyTheme(drawable);
249 public ColorFilter getColorFilter(Drawable drawable) {
250 return DrawableCompatLollipop.getColorFilter(drawable);
254 public void clearColorFilter(Drawable drawable) {
255 DrawableCompatLollipop.clearColorFilter(drawable);
259 public void inflate(Drawable drawable, Resources res, XmlPullParser parser,
262 DrawableCompatLollipop.inflate(drawable, res, parser, attrs, t);
271 public boolean setLayoutDirection(Drawable drawable, int layoutDirection) {
272 return DrawableCompatApi23.setLayoutDirection(drawable, layoutDirection);
276 public int getLayoutDirection(Drawable drawable) {
277 return DrawableCompatApi23.getLayoutDirection(drawable);
281 public Drawable wrap(Drawable drawable) {
283 return drawable;
287 public void clearColorFilter(Drawable drawable) {
289 drawable.clearColorFilter();
320 * @param drawable The Drawable against which to invoke the method.
322 public static void jumpToCurrentState(@NonNull Drawable drawable) {
323 IMPL.jumpToCurrentState(drawable);
334 * @param drawable The Drawable against which to invoke the method.
338 public static void setAutoMirrored(@NonNull Drawable drawable, boolean mirrored) {
339 IMPL.setAutoMirrored(drawable, mirrored);
349 * @param drawable The Drawable against which to invoke the method.
353 public static boolean isAutoMirrored(@NonNull Drawable drawable) {
354 return IMPL.isAutoMirrored(drawable);
358 * Specifies the hotspot's location within the drawable.
360 * @param drawable The Drawable against which to invoke the method.
364 public static void setHotspot(@NonNull Drawable drawable, float x, float y) {
365 IMPL.setHotspot(drawable, x, y);
370 * different from the drawable bounds.
372 * @param drawable The Drawable against which to invoke the method.
374 public static void setHotspotBounds(@NonNull Drawable drawable, int left, int top,
376 IMPL.setHotspotBounds(drawable, left, top, right, bottom);
380 * Specifies a tint for {@code drawable}.
382 * @param drawable The Drawable against which to invoke the method.
383 * @param tint Color to use for tinting this drawable
385 public static void setTint(@NonNull Drawable drawable, @ColorInt int tint) {
386 IMPL.setTint(drawable, tint);
390 * Specifies a tint for {@code drawable} as a color state list.
392 * @param drawable The Drawable against which to invoke the method.
393 * @param tint Color state list to use for tinting this drawable, or null to clear the tint
395 public static void setTintList(@NonNull Drawable drawable, @Nullable ColorStateList tint) {
396 IMPL.setTintList(drawable, tint);
400 * Specifies a tint blending mode for {@code drawable}.
402 * @param drawable The Drawable against which to invoke the method.
405 public static void setTintMode(@NonNull Drawable drawable, @Nullable PorterDuff.Mode tintMode) {
406 IMPL.setTintMode(drawable, tintMode);
410 * Get the alpha value of the {@code drawable}.
413 * @param drawable The Drawable against which to invoke the method.
415 public static int getAlpha(@NonNull Drawable drawable) {
416 return IMPL.getAlpha(drawable);
422 public static void applyTheme(@NonNull Drawable drawable, @NonNull Resources.Theme t) {
423 IMPL.applyTheme(drawable, t);
429 public static boolean canApplyTheme(@NonNull Drawable drawable) {
430 return IMPL.canApplyTheme(drawable);
438 public static ColorFilter getColorFilter(@NonNull Drawable drawable) {
439 return IMPL.getColorFilter(drawable);
443 * Removes the color filter from the given drawable.
445 public static void clearColorFilter(@NonNull Drawable drawable) {
446 IMPL.clearColorFilter(drawable);
459 public static void inflate(@NonNull Drawable drawable, @NonNull Resources res,
463 IMPL.inflate(drawable, res, parser, attrs, theme);
467 * Potentially wrap {@code drawable} so that it may be used for tinting across the
470 * <p>If the given drawable is wrapped, we will copy over certain state over to the wrapped
471 * drawable, such as its bounds, level, visibility and state.</p>
473 * <p>You must use the result of this call. If the given drawable is being used by a view
474 * (as it's background for instance), you must replace the original drawable with
479 * // Need to set the background with the wrapped drawable
482 * // You can now tint the drawable
486 * <p>If you need to get hold of the original {@link android.graphics.drawable.Drawable} again,
489 * @param drawable The Drawable to process
490 * @return A drawable capable of being tinted across all API levels.
497 public static Drawable wrap(@NonNull Drawable drawable) {
498 return IMPL.wrap(drawable);
502 * Unwrap {@code drawable} if it is the result of a call to {@link #wrap(Drawable)}. If
503 * the {@code drawable} is not the result of a call to {@link #wrap(Drawable)} then
504 * {@code drawable} is returned as-is.
506 * @param drawable The drawable to unwrap
507 * @return the unwrapped {@link Drawable} or {@code drawable} if it hasn't been wrapped.
511 public static <T extends Drawable> T unwrap(@NonNull Drawable drawable) {
512 if (drawable instanceof DrawableWrapper) {
513 return (T) ((DrawableWrapper) drawable).getWrappedDrawable();
515 return (T) drawable;
519 * Set the layout direction for this drawable. Should be a resolved
523 * @param layoutDirection the resolved layout direction for the drawable,
527 * appearance of the drawable to change such that it needs to be
531 public static boolean setLayoutDirection(@NonNull Drawable drawable, int layoutDirection) {
532 return IMPL.setLayoutDirection(drawable, layoutDirection);
542 public static int getLayoutDirection(@NonNull Drawable drawable) {
543 return IMPL.getLayoutDirection(drawable);