summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/ImageView.java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-03-24 18:00:26 -0700
committerAlan Viverette <alanv@google.com>2014-03-24 18:00:26 -0700
commit52b999f0721b53e9c6e18a4bd664e89aeb65b2d5 (patch)
tree3ef7369c91bd51fae75769c23ebfb71e04d3989c /core/java/android/widget/ImageView.java
parent852472d9aa39eb4591eac43487ac3e0944e1daf6 (diff)
downloadframeworks_base-52b999f0721b53e9c6e18a4bd664e89aeb65b2d5.zip
frameworks_base-52b999f0721b53e9c6e18a4bd664e89aeb65b2d5.tar.gz
frameworks_base-52b999f0721b53e9c6e18a4bd664e89aeb65b2d5.tar.bz2
Implement APIs for obtaining, caching themed Drawables
When Drawables are inflated during preload (or otherwise without a theme) they cache their themeable attributes in their constant state as an array keyed on attribute index. Drawables inflated with a theme will simply resolve theme attributes as part of normal inflation, and they will not cache any themeable attributes. Drawables obtained from Resources are pulled from theme-specific cache when possible. If an unthemed Drawable exists in the preload cache, a new constant state will be obtained for the Drawable and the theme will be applied by resolving the cached themeable attributes and overwriting their respective constant state properties. If no cached version exists, a new Drawable is inflated against the desired theme. Constant states from themed drawables may be cached if the applied theme is "pure" and was loaded from a style resource without any subsequent modifications. This CL does not handle applying themes to several Drawable types, but it fully supports BitmapDrawable, GradientDrawable, NinePatchDrawable, ColorDrawable, and TouchFeedbackDrawable. BUG: 12611005 Change-Id: I4e794fbb62f7a371715f4ebdf946ee5f9a5ad1c9
Diffstat (limited to 'core/java/android/widget/ImageView.java')
-rw-r--r--core/java/android/widget/ImageView.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 572302a..eedacb5 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -664,7 +664,7 @@ public class ImageView extends View {
InputStream stream = null;
try {
stream = mContext.getContentResolver().openInputStream(mUri);
- d = Drawable.createFromStream(stream, null);
+ d = Drawable.createFromStreamThemed(stream, null, mContext.getTheme());
} catch (Exception e) {
Log.w("ImageView", "Unable to open content: " + mUri, e);
} finally {