On Mon, Jul 30, 2012 at 11:34 PM, skink <psk...@gmail.com> wrote:

> as far i know this is not true: you can change the bounds of one layer
> without affecting the other layers. try to:
>     d.setBounds(left, top, right, bottom);
>     d.invalidateSelf();
> in some callback method e.g. onClick(View v) and you will see it works as
> expected
>

If you are suggesting to do this on one of the child drawables that you
have placed in the LayerDrawable, then you are relying on the framework
never calling setBounds() again on that Drawable itself.  This is a very
dangerous thing to rely on.  This is very very far into the realm of
relying on implementation details that there will be no guarantee remain
that way.

When you put a drawable into a parent drawable, the parent owns the state
management of the child drawable.  Don't try to play games whacking on its
state yourself in the hope you can get lucky and not conflict with it.
 (And this is a good rule to assume for any situation where you are placing
a child object into a parent container.)

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to