Neither. It's a view background, defined as a state list.
Take a look in android-sdk\platforms\android-X\data\res\values\styles.xml:
<style name="Widget.Button">
*<item
name="android:background">@android:drawable/btn_default</item>
* <item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item
name="android:textAppearance">?android:attr/textAppearanceSmallInverse</item>
<item
name="android:textColor">@android:color/primary_text_light</item>
<item
name="android:gravity">center_vertical|center_horizontal</item>
</style>
And btn_default is in turn inside data\res\drawable:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/btn_default_normal" />
<item android:state_window_focused="false" android:state_enabled="false"
android:drawable="@drawable/btn_default_normal_disable" />
... snipped for brevity ....
<item
android:drawable="@drawable/btn_default_normal_disable" />
</selector>
Finally, these drawable resources are nine-patches, inside drawable-mdpi or
drawable-hdpi.
-- Kostya
2011/6/29 guich <[email protected]>
> Hi,
>
> Who exactly draws the Button's border and background? I saw that
> Button extends TextView, but this class has 8500 lines. I would like
> to understand the algorithms used to draw the border and the dithered
> gradient background.
>
> thanks
>
> guich
>
> --
> 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
--
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