Make sure that a drawable replacing a layer in a LayerDrawable gets a callback.

Change-Id: Iefac7d280b3c16e05f45688da655e17e21a3098b
This commit is contained in:
Romain Guy
2010-05-06 17:58:17 -07:00
parent 26723fc89d
commit 79a63f7ddb

View File

@@ -265,6 +265,7 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
*/
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) {