On Wed, Jan 26, 2011 at 7:55 PM, Bob Kerns <[email protected]> wrote:

> Just to be very clear about it -- given the current reality, I suggest
> viewing all firmware-defined resources as, well, infirm.
>

No.  Any resources that are in the public SDK are officially supported
resources, there for you to use.

Of course any that are not in the public SDK (that is you are accessing them
from com.android.internal.R or the resource XML trick involving '*'), then
you put yourself at risk for breaking.

In fact with the way resources work, you are guaranteed to be broken on
everything except the exact build you are compiling against when using
non-public resources.  The resource compiler dynamically assign the resource
identifier for these, so they are basically random, and change constantly.

The standard platform has a number of common drawables in the public
resources, including the button background:

http://developer.android.com/reference/android/R.drawable.html

There are also a number of styles you can use in your XML to get even more
consistent behavior with the default widgets:

http://developer.android.com/reference/android/R.style.html

And, often best, the theme has attributes you can use to get a variety of
standard visuals, styles, and other appearances that are appropriate for the
current theme:

http://developer.android.com/reference/android/R.styleable.html#Theme

For example, if you have a View that you want to be styled like a button,
you can write in XML something like this:

  <com.foo.MyView style="?android:attr/buttonStyle" />

-- 
Dianne Hackborn
Android framework engineer
[email protected]

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 [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