commit | 79a63f7ddb5bfb32a37dfbfd3e7748389c5076ad | [log] [tgz] |
---|---|---|
author | Romain Guy <romainguy@google.com> | Thu May 06 17:58:17 2010 -0700 |
committer | Romain Guy <romainguy@google.com> | Thu May 06 17:58:17 2010 -0700 |
tree | a4444f0b799084fbb2b57ff0d6977ec11b74bb8d | |
parent | 26723fc89d9f6396d5a38a6f6f9976d59d2a17e4 [diff] |
Make sure that a drawable replacing a layer in a LayerDrawable gets a callback. Change-Id: Iefac7d280b3c16e05f45688da655e17e21a3098b
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java index 389fd40..72fe9a6 100644 --- a/graphics/java/android/graphics/drawable/LayerDrawable.java +++ b/graphics/java/android/graphics/drawable/LayerDrawable.java
@@ -265,6 +265,7 @@ */ public boolean setDrawableByLayerId(int id, Drawable drawable) { final ChildDrawable[] layers = mLayerState.mChildren; + if (drawable != null) drawable.setCallback(mCallback); for (int i = mLayerState.mNum - 1; i >= 0; i--) { if (layers[i].mId == id) {