Wise Fellow Androiders,

I am trying to use a ClipDrawable in my XML to position a part of an
image on top of another image (We are doing to save us space in APK by
not having to include several large backgrounds). This is needed for
the start screen splash, so I don't think any code is allowed, only
XML.

However, clip drawable don't seem to be at all made for being used
from purely XML. This is because after searching around, I found this
in the ClipDrawable onDraw code:
   @Override
    public void draw(Canvas canvas) {

        if (mClipState.mDrawable.getLevel() == 0) {
            return;
        }
      ...
    }

And I don't see a way to set the level from XML. Is this an oversight
and should we maybe allow this level to be set from XML too?

XML code.

<layer-list xmlns:android="http://schemas.android.com/apk/res/
android">
    <item android:drawable="@drawable/startscreen" />
    <item android:left="50px"
        android:top="50px"
        android:bottom="150px"
        android:right="150px">
    <clip android:gravity="top"
        android:level="1"
        android:drawable="@drawable/startscreen" />
    </item>
</layer-list>

Thanks,
Artem
--~--~---------~--~----~------------~-------~--~----~
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