Hi people !

I'm trying to use 9-patches in my application.

At first, I created one NinePatchDrawable that I used in every Button,
but this lead to some problems :
http://pastebin.com/pBep1NM0

This happened with any Drawable, including NinePatchDrawable or
BitmapDrawable.

Someone told me that it was because Drawable was storing some shared
values, so I decided to use one Drawable per button...

But since I was going to use many NinePatchDrawable with the same
NinePatch, I thought it might be a better idea to first create a
NinePatch, and then distribute NinePatchDrawable based on this
NinePatch.

But the NinePatchDrawable(Resouce, NinePatch) constructor produces a
null-pointer exception because no padding is entered... (By the way,
why is this constructor public then ?... Since it directly calls
setNinePatchState, wich calls computeBitmapSize, where the error
occurs...).

So what's the way to do it ? Directly call
Resource.getDrawable() ?... :-/ But then it gets more difficult to
control when the data is loaded... (When calling multiple times
Resource.getDrawable() with the same file, only the first call loads
the file, right ? The others are faster ?)

What is the clean way to use Managers to handle this ?...

Thanks  :)

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

Reply via email to