From a0f78e64a8df237c1ef4c061afc2486cf21ae3be Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Thu, 31 Mar 2016 11:42:10 +0300 Subject: [PATCH] Deprecation of IconsCacheMethods. --- OsmAnd/src/net/osmand/plus/IconsCache.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/IconsCache.java b/OsmAnd/src/net/osmand/plus/IconsCache.java index 8abc135cb5..1437a50d60 100644 --- a/OsmAnd/src/net/osmand/plus/IconsCache.java +++ b/OsmAnd/src/net/osmand/plus/IconsCache.java @@ -34,10 +34,12 @@ public class IconsCache { return new BitmapDrawable(app.getResources(), bitmapResized); } + @Deprecated private Drawable getDrawable(@DrawableRes int resId, @ColorRes int clrId) { return getDrawable(resId, clrId, 0); } + @Deprecated private Drawable getDrawable(@DrawableRes int resId, @ColorRes int clrId, float scale) { long hash = ((long)resId << 31l) + clrId + (int)(scale * 10000f); Drawable d = drawable.get(hash); @@ -56,6 +58,7 @@ public class IconsCache { return d; } + @Deprecated private Drawable getPaintedDrawable(@DrawableRes int resId, @ColorInt int color){ long hash = ((long)resId << 31l) + color; Drawable d = drawable.get(hash); @@ -68,18 +71,22 @@ public class IconsCache { return d; } + @Deprecated public Drawable getPaintedContentIcon(@DrawableRes int id, @ColorInt int color){ return getPaintedDrawable(id, color); } + @Deprecated public Drawable getIcon(@DrawableRes int id, @ColorRes int colorId) { return getDrawable(id, colorId); } + @Deprecated public Drawable getIcon(@DrawableRes int id, @ColorRes int colorId, float scale) { return getDrawable(id, colorId, scale); } + @Deprecated public Drawable getIcon(@DrawableRes int backgroundId, @DrawableRes int id, @ColorRes int colorId) { Drawable b = getDrawable(backgroundId, 0); Drawable f = getDrawable(id, colorId); @@ -89,18 +96,22 @@ public class IconsCache { return new LayerDrawable(layers); } + @Deprecated public Drawable getContentIcon(@DrawableRes int id) { return getDrawable(id, app.getSettings().isLightContent() ? R.color.icon_color : 0); } + @Deprecated public Drawable getContentIcon(@DrawableRes int id, boolean isLightContent) { return getDrawable(id, isLightContent ? R.color.icon_color : 0); } + @Deprecated public Drawable getIcon(@DrawableRes int id) { return getDrawable(id, 0); } - + + @Deprecated public Drawable getIcon(@DrawableRes int id, boolean light) { return getDrawable(id, light ? R.color.icon_color : 0); }