SlideShare a Scribd company logo
1 of 19
Resources
Resources
To enable support for different configurations of the device, an
application uses resources in the /res folder of the project.
The folder contains default and alternative resources (for different
configurations).
The default resources and all the alternatives must be identified
by the same name.
The compiler creates a /gen folder that creates an enumeration
with all the resources available to the application.
The default resources must always be present because they are
loaded at runtime when no other resource is present.
Resources
Resources
● Animator: it contains .xml files with Property Animations
● Anim: it contains .xml files with View Animations
● Color: it contains .xml files with Color Selector
● Drawable: it can contain .png or .xml files
● Layout: it contains .xml files with layouts
● Menu: it contains .xml files with Options menus, Context
menus and/or Sub menus
● Raw: it contains all other files to recover during runtime
● Values: it contains .xml files with values for differnt
configurations. They are: strings, arrays, dimens, colors, styles
● Xml: it contains generic .xml files
Types
Resources
You need to create the /res subfolder that specify the name of the
type of configuration that supports to provide alternative
resources to support different configurations:
<resources_name>-<config_qualifier>
<resources_name> is the type of resource that contains as
indicated above and <config_qualifier> identifies the supported
configuration.
Ex. res/layout-land contains the layout to be used when the
phone is in landscape mode.
You can specify multiple qualifiers in series.
Alternative Resources
Resources
The most commonly used types of qualifiers are listed in the
same order in which they must be specified in the name of the
/res subfolder:
● Language (Ex. en, fr, it,...): it specifies in which language
resources are available within the folder
● SmallestWidth (sw<n>dp Es. sw320dp, sw720dp,...): the
resources of these folders are available only if the terminal has
Min(dp_height, dp_width) >= n
● Screen Size (small, normal, large, xlarge):
Qualifiers - Typologies
Resources
● ScreenOrientation (port, land)
● Screen Pixel Density (ldpi, mdpi, hdpi, xhdpi, xxhdpi,
xxxhdpi, tvdpi)
● ldpi: 120dp
● mdpi: 160dp
● hdpi: 240dp
● xhdpi: 320dp
● xxhdpi: 480dpi
● xxxhdpi: 640dp
● Platform Version (Es. V12, v15, v19, ...): the logic is top
bottom. Ex. A device with V19 verifies the presence of the
resource in v19, then in v18, and so on until it finds one.
Qualifiers - Tipologie
Resources
● The multiple qualifiers must be specified in the order indicated
before: Es.
res/drawable-port-hdpi/
● The folders defined with these rules can not contain subfolders
● The folder names are case-insensitive
● It is allowed only one value for each type of qualifier. Es.
res/drawable/it-en INCORRECT
If you want to provide the same resource configuration for it and
en, you have to create 2 folders and enter the same resource in
both
res/drawable-it CORRECT
res/drawable-en CORRECT
Qualifiers - Rules
Resources
When you insert a new resource in the project, the aapt
automatically generates the R class that contains all the IDs of
resources on the basis of fundamental subdirectory in which you
can retrieve them at runtime:
● R.anim.<anim_ID>
● R.array.<array_ID>
● R.bool.<bool_ID>
● R.color.<color_ID>
● R.dimen.<dimen_ID>
● R.drawable.<drawable_ID>
● R.integer.<integer_ID>
● R.layout.<layout_ID>
● R.menu.<menu_ID>
● R.raw.<raw_ID>
● R.string.<string_ID>
● R.style.<style_ID>
Resource access at runtime
Resources
The R class is generated for each project and it is created in the
package defined in the manifest:
[<package>.]R.<resource_type>.<resource_ID>
<package> is optional if the class is imported into the R class is
the same from which you want to retrieve a resource.
In this way it is possible to access resources outside projects and
imported to the system resources of Android for which
<package> = android
Then the developer may require a system resource with the
expression:
android.R.<resource_type>.<resource_ID>
N.B.: system resources at runtime are taken from the firmware of
the terminal, so the same ID can refer to different resources in
terminals with different firmware.
Resource access at runtime
Resources
To access resources from an xml file using the following syntax:
@[<package_name>:]<resource_type>/<resource_name>
<package_name> is optional if you want to use a resource
package of the project.
Pattern: during the creation of the layout you should always
include references to external resources instead of entering the
value in the layout.
Es.
android:text="@string/hello" CORRECT
android:text="Hello!" CORRECT BUT NOT
RECOMMENDED
Resource access from an xml file
Resources
<ViewGroup xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@[+][package:]id/resource_name"
android:layout_height=["dimension"|"fill_parent"|"wrap_content"]
android:layout_width=["dimension"|"fill_parent"|"wrap_content"]
[ViewGroup-specific attributes] >
<View
android:id="@[+][package:]id/resource_name"
android:layout_height=["dimension"|"fill_parent"|"wrap_content"]
android:layout_width=["dimension"|"fill_parent"|"wrap_content"]
[View-specific attributes] >
<requestFocus/>
</View>
<ViewGroup >
<View />
</ViewGroup>
<include layout="@layout/layout_resource"/>
</ViewGroup>
Layout
Resources
<resources>
<string
name="string_name"
>text_string</string>
</resources>
String
Resources
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@[package:]anim/interpolator_resource"
android:shareInterpolator=["true" | "false"] >
<alpha
android:fromAlpha="float"
android:toAlpha="float" />
<scale
android:fromXScale="float"
android:toXScale="float"
android:fromYScale="float"
android:toYScale="float"
android:pivotX="float"
android:pivotY="float" />
<translate
android:fromXDelta="float"
android:toXDelta="float"
android:fromYDelta="float"
android:toYDelta="float" />
<rotate
android:fromDegrees="float"
android:toDegrees="float"
android:pivotX="float"
android:pivotY="float" />
</set>
View Animation
Resources
<set
android:ordering=["together" | "sequentially"]>
<objectAnimator
android:propertyName="string"
android:duration="int"
android:valueFrom="float | int | color"
android:valueTo="float | int | color"
android:startOffset="int"
android:repeatCount="int"
android:repeatMode=["repeat" | "reverse"]
android:valueType=["intType" | "floatType"]/>
<animator
android:duration="int"
android:valueFrom="float | int | color"
android:valueTo="float | int | color"
android:startOffset="int"
android:repeatCount="int"
android:repeatMode=["repeat" | "reverse"]
android:valueType=["intType" | "floatType"]/>
</set>
Property Animation
Resources
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@[+][package:]id/resource_name"
android:title="string"
android:titleCondensed="string"
android:icon="@[package:]drawable/drawable_resource_name"
android:onClick="method name"
android:showAsAction=["ifRoom" | "never" | "withText" | "always" | "collapseActionView"]
android:actionLayout="@[package:]layout/layout_resource_name"
android:actionViewClass="class name"
android:actionProviderClass="class name"
android:alphabeticShortcut="string"
android:numericShortcut="string"
android:checkable=["true" | "false"]
android:visible=["true" | "false"]
android:enabled=["true" | "false"]
android:menuCategory=["container" | "system" | "secondary" | "alternative"]
android:orderInCategory="integer" />
<group android:id="@[+][package:]id/resource name"
android:checkableBehavior=["none" | "all" | "single"]
android:visible=["true" | "false"]
android:enabled=["true" | "false"]
android:menuCategory=["container" | "system" | "secondary" | "alternative"]
android:orderInCategory="integer" >
<item />
</group>
<item >
<menu>
<item />
</menu>
</item>
</menu>
Menu
Resources
<resources>
<style
name="style_name"
parent="@[package:]style/style_to_inherit">
<item
name="[package:]style_property_name">style_value</item>
</style>
</resources>
Style
Resources
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:constantSize=["true" | "false"]
android:dither=["true" | "false"]
android:variablePadding=["true" | "false"] >
<item
android:drawable="@[package:]drawable/drawable_resource"
android:state_pressed=["true" | "false"]
android:state_focused=["true" | "false"]
android:state_hovered=["true" | "false"]
android:state_selected=["true" | "false"]
android:state_checkable=["true" | "false"]
android:state_checked=["true" | "false"]
android:state_enabled=["true" | "false"]
android:state_activated=["true" | "false"]
android:state_window_focused=["true" | "false"] />
</selector>
Drawable Selector
Resources
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape=["rectangle" | "oval" | "line" | "ring"] >
<corners
android:radius="integer"
android:topLeftRadius="integer"
android:topRightRadius="integer"
android:bottomLeftRadius="integer"
android:bottomRightRadius="integer" />
<gradient
android:angle="integer"
android:centerX="integer"
android:centerY="integer"
android:centerColor="integer"
android:endColor="color"
android:gradientRadius="integer"
android:startColor="color"
android:type=["linear" | "radial" | "sweep"]
android:useLevel=["true" | "false"] />
<padding
android:left="integer"
android:top="integer"
android:right="integer"
android:bottom="integer" />
<size
android:width="integer"
android:height="integer" />
<solid
android:color="color" />
<stroke
android:width="integer"
android:color="color"
android:dashWidth="integer"
android:dashGap="integer" />
</shape>
Shape
Resources
<resources>
<bool
name="bool_name"
>[true | false]</bool>
<color
name="color_name"
>hex_color</color>
<dimen
name="dimension_name"
>dimension</dimen>
<integer
name="integer_name"
>integer</integer>
<integer-array
name="integer_array_name">
<item>integer</item>
</integer-array>
<array
name="integer_array_name">
<item>resource</item>
</array>
</resources>
Other Resources

More Related Content

Similar to Managing Resources

Android App Development 08 : Support Multiple Devices
Android App Development 08 : Support Multiple DevicesAndroid App Development 08 : Support Multiple Devices
Android App Development 08 : Support Multiple DevicesAnuchit Chalothorn
 
Android resource
Android resourceAndroid resource
Android resourceKrazy Koder
 
03 android application structure
03 android application structure03 android application structure
03 android application structureSokngim Sa
 
Android project architecture
Android project architectureAndroid project architecture
Android project architectureSourabh Sahu
 
Android Resources.docx
Android Resources.docxAndroid Resources.docx
Android Resources.docxKNANTHINIMCA
 
Assets, files, and data parsing
Assets, files, and data parsingAssets, files, and data parsing
Assets, files, and data parsingAly Arman
 
Android Development
Android DevelopmentAndroid Development
Android Developmentmclougm4
 
Android structure
Android structureAndroid structure
Android structureKumar
 
Globalization and accessibility
Globalization and accessibilityGlobalization and accessibility
Globalization and accessibilityaspnet123
 
Android resources
Android resourcesAndroid resources
Android resourcesma-polimi
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldTarunsingh198
 
Android style resource and other resources types-chapter12
Android style resource and other resources types-chapter12Android style resource and other resources types-chapter12
Android style resource and other resources types-chapter12Dr. Ramkumar Lakshminarayanan
 
Android stepbystep
Android stepbystepAndroid stepbystep
Android stepbystepKrazy Koder
 

Similar to Managing Resources (20)

Android App Development 08 : Support Multiple Devices
Android App Development 08 : Support Multiple DevicesAndroid App Development 08 : Support Multiple Devices
Android App Development 08 : Support Multiple Devices
 
Android resource
Android resourceAndroid resource
Android resource
 
Chapter 9 - Resources System
Chapter 9 - Resources SystemChapter 9 - Resources System
Chapter 9 - Resources System
 
03 android application structure
03 android application structure03 android application structure
03 android application structure
 
Android project architecture
Android project architectureAndroid project architecture
Android project architecture
 
Android Resources.docx
Android Resources.docxAndroid Resources.docx
Android Resources.docx
 
Assets, files, and data parsing
Assets, files, and data parsingAssets, files, and data parsing
Assets, files, and data parsing
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Android structure
Android structureAndroid structure
Android structure
 
Globalization and accessibility
Globalization and accessibilityGlobalization and accessibility
Globalization and accessibility
 
Android resources
Android resourcesAndroid resources
Android resources
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello world
 
Android dev tips
Android dev tipsAndroid dev tips
Android dev tips
 
lec1.docx
lec1.docxlec1.docx
lec1.docx
 
Android style resource and other resources types-chapter12
Android style resource and other resources types-chapter12Android style resource and other resources types-chapter12
Android style resource and other resources types-chapter12
 
Intro to-puppet
Intro to-puppetIntro to-puppet
Intro to-puppet
 
Android stepbystep
Android stepbystepAndroid stepbystep
Android stepbystep
 
Devtools cheatsheet
Devtools cheatsheetDevtools cheatsheet
Devtools cheatsheet
 
Devtools cheatsheet
Devtools cheatsheetDevtools cheatsheet
Devtools cheatsheet
 
Android for Beginners
Android  for BeginnersAndroid  for Beginners
Android for Beginners
 

More from Diego Grancini

Android App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgetsAndroid App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgetsDiego Grancini
 
Android App Development - 12 animations
Android App Development - 12 animationsAndroid App Development - 12 animations
Android App Development - 12 animationsDiego Grancini
 
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
Android App Development - 11 Lists, grids, adapters, dialogs and toastsAndroid App Development - 11 Lists, grids, adapters, dialogs and toasts
Android App Development - 11 Lists, grids, adapters, dialogs and toastsDiego Grancini
 
Android App Development - 10 Content providers
Android App Development - 10 Content providersAndroid App Development - 10 Content providers
Android App Development - 10 Content providersDiego Grancini
 
Android App Development - 09 Storage
Android App Development - 09 StorageAndroid App Development - 09 Storage
Android App Development - 09 StorageDiego Grancini
 
Android App Development - 08 Services
Android App Development - 08 ServicesAndroid App Development - 08 Services
Android App Development - 08 ServicesDiego Grancini
 
Android App Development - 06 Fragments
Android App Development - 06 FragmentsAndroid App Development - 06 Fragments
Android App Development - 06 FragmentsDiego Grancini
 
Android App Development - 05 Action bar
Android App Development - 05 Action barAndroid App Development - 05 Action bar
Android App Development - 05 Action barDiego Grancini
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsDiego Grancini
 
Android App Development - 02 Activity and intent
Android App Development - 02 Activity and intentAndroid App Development - 02 Activity and intent
Android App Development - 02 Activity and intentDiego Grancini
 

More from Diego Grancini (10)

Android App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgetsAndroid App Development - 13 Broadcast receivers and app widgets
Android App Development - 13 Broadcast receivers and app widgets
 
Android App Development - 12 animations
Android App Development - 12 animationsAndroid App Development - 12 animations
Android App Development - 12 animations
 
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
Android App Development - 11 Lists, grids, adapters, dialogs and toastsAndroid App Development - 11 Lists, grids, adapters, dialogs and toasts
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
 
Android App Development - 10 Content providers
Android App Development - 10 Content providersAndroid App Development - 10 Content providers
Android App Development - 10 Content providers
 
Android App Development - 09 Storage
Android App Development - 09 StorageAndroid App Development - 09 Storage
Android App Development - 09 Storage
 
Android App Development - 08 Services
Android App Development - 08 ServicesAndroid App Development - 08 Services
Android App Development - 08 Services
 
Android App Development - 06 Fragments
Android App Development - 06 FragmentsAndroid App Development - 06 Fragments
Android App Development - 06 Fragments
 
Android App Development - 05 Action bar
Android App Development - 05 Action barAndroid App Development - 05 Action bar
Android App Development - 05 Action bar
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
 
Android App Development - 02 Activity and intent
Android App Development - 02 Activity and intentAndroid App Development - 02 Activity and intent
Android App Development - 02 Activity and intent
 

Managing Resources

  • 2. Resources To enable support for different configurations of the device, an application uses resources in the /res folder of the project. The folder contains default and alternative resources (for different configurations). The default resources and all the alternatives must be identified by the same name. The compiler creates a /gen folder that creates an enumeration with all the resources available to the application. The default resources must always be present because they are loaded at runtime when no other resource is present. Resources
  • 3. Resources ● Animator: it contains .xml files with Property Animations ● Anim: it contains .xml files with View Animations ● Color: it contains .xml files with Color Selector ● Drawable: it can contain .png or .xml files ● Layout: it contains .xml files with layouts ● Menu: it contains .xml files with Options menus, Context menus and/or Sub menus ● Raw: it contains all other files to recover during runtime ● Values: it contains .xml files with values for differnt configurations. They are: strings, arrays, dimens, colors, styles ● Xml: it contains generic .xml files Types
  • 4. Resources You need to create the /res subfolder that specify the name of the type of configuration that supports to provide alternative resources to support different configurations: <resources_name>-<config_qualifier> <resources_name> is the type of resource that contains as indicated above and <config_qualifier> identifies the supported configuration. Ex. res/layout-land contains the layout to be used when the phone is in landscape mode. You can specify multiple qualifiers in series. Alternative Resources
  • 5. Resources The most commonly used types of qualifiers are listed in the same order in which they must be specified in the name of the /res subfolder: ● Language (Ex. en, fr, it,...): it specifies in which language resources are available within the folder ● SmallestWidth (sw<n>dp Es. sw320dp, sw720dp,...): the resources of these folders are available only if the terminal has Min(dp_height, dp_width) >= n ● Screen Size (small, normal, large, xlarge): Qualifiers - Typologies
  • 6. Resources ● ScreenOrientation (port, land) ● Screen Pixel Density (ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi, tvdpi) ● ldpi: 120dp ● mdpi: 160dp ● hdpi: 240dp ● xhdpi: 320dp ● xxhdpi: 480dpi ● xxxhdpi: 640dp ● Platform Version (Es. V12, v15, v19, ...): the logic is top bottom. Ex. A device with V19 verifies the presence of the resource in v19, then in v18, and so on until it finds one. Qualifiers - Tipologie
  • 7. Resources ● The multiple qualifiers must be specified in the order indicated before: Es. res/drawable-port-hdpi/ ● The folders defined with these rules can not contain subfolders ● The folder names are case-insensitive ● It is allowed only one value for each type of qualifier. Es. res/drawable/it-en INCORRECT If you want to provide the same resource configuration for it and en, you have to create 2 folders and enter the same resource in both res/drawable-it CORRECT res/drawable-en CORRECT Qualifiers - Rules
  • 8. Resources When you insert a new resource in the project, the aapt automatically generates the R class that contains all the IDs of resources on the basis of fundamental subdirectory in which you can retrieve them at runtime: ● R.anim.<anim_ID> ● R.array.<array_ID> ● R.bool.<bool_ID> ● R.color.<color_ID> ● R.dimen.<dimen_ID> ● R.drawable.<drawable_ID> ● R.integer.<integer_ID> ● R.layout.<layout_ID> ● R.menu.<menu_ID> ● R.raw.<raw_ID> ● R.string.<string_ID> ● R.style.<style_ID> Resource access at runtime
  • 9. Resources The R class is generated for each project and it is created in the package defined in the manifest: [<package>.]R.<resource_type>.<resource_ID> <package> is optional if the class is imported into the R class is the same from which you want to retrieve a resource. In this way it is possible to access resources outside projects and imported to the system resources of Android for which <package> = android Then the developer may require a system resource with the expression: android.R.<resource_type>.<resource_ID> N.B.: system resources at runtime are taken from the firmware of the terminal, so the same ID can refer to different resources in terminals with different firmware. Resource access at runtime
  • 10. Resources To access resources from an xml file using the following syntax: @[<package_name>:]<resource_type>/<resource_name> <package_name> is optional if you want to use a resource package of the project. Pattern: during the creation of the layout you should always include references to external resources instead of entering the value in the layout. Es. android:text="@string/hello" CORRECT android:text="Hello!" CORRECT BUT NOT RECOMMENDED Resource access from an xml file
  • 11. Resources <ViewGroup xmlns:android="http://schemas.android.com/apk/res/android" android:id="@[+][package:]id/resource_name" android:layout_height=["dimension"|"fill_parent"|"wrap_content"] android:layout_width=["dimension"|"fill_parent"|"wrap_content"] [ViewGroup-specific attributes] > <View android:id="@[+][package:]id/resource_name" android:layout_height=["dimension"|"fill_parent"|"wrap_content"] android:layout_width=["dimension"|"fill_parent"|"wrap_content"] [View-specific attributes] > <requestFocus/> </View> <ViewGroup > <View /> </ViewGroup> <include layout="@layout/layout_resource"/> </ViewGroup> Layout
  • 13. Resources <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@[package:]anim/interpolator_resource" android:shareInterpolator=["true" | "false"] > <alpha android:fromAlpha="float" android:toAlpha="float" /> <scale android:fromXScale="float" android:toXScale="float" android:fromYScale="float" android:toYScale="float" android:pivotX="float" android:pivotY="float" /> <translate android:fromXDelta="float" android:toXDelta="float" android:fromYDelta="float" android:toYDelta="float" /> <rotate android:fromDegrees="float" android:toDegrees="float" android:pivotX="float" android:pivotY="float" /> </set> View Animation
  • 14. Resources <set android:ordering=["together" | "sequentially"]> <objectAnimator android:propertyName="string" android:duration="int" android:valueFrom="float | int | color" android:valueTo="float | int | color" android:startOffset="int" android:repeatCount="int" android:repeatMode=["repeat" | "reverse"] android:valueType=["intType" | "floatType"]/> <animator android:duration="int" android:valueFrom="float | int | color" android:valueTo="float | int | color" android:startOffset="int" android:repeatCount="int" android:repeatMode=["repeat" | "reverse"] android:valueType=["intType" | "floatType"]/> </set> Property Animation
  • 15. Resources <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@[+][package:]id/resource_name" android:title="string" android:titleCondensed="string" android:icon="@[package:]drawable/drawable_resource_name" android:onClick="method name" android:showAsAction=["ifRoom" | "never" | "withText" | "always" | "collapseActionView"] android:actionLayout="@[package:]layout/layout_resource_name" android:actionViewClass="class name" android:actionProviderClass="class name" android:alphabeticShortcut="string" android:numericShortcut="string" android:checkable=["true" | "false"] android:visible=["true" | "false"] android:enabled=["true" | "false"] android:menuCategory=["container" | "system" | "secondary" | "alternative"] android:orderInCategory="integer" /> <group android:id="@[+][package:]id/resource name" android:checkableBehavior=["none" | "all" | "single"] android:visible=["true" | "false"] android:enabled=["true" | "false"] android:menuCategory=["container" | "system" | "secondary" | "alternative"] android:orderInCategory="integer" > <item /> </group> <item > <menu> <item /> </menu> </item> </menu> Menu
  • 17. Resources <selector xmlns:android="http://schemas.android.com/apk/res/android" android:constantSize=["true" | "false"] android:dither=["true" | "false"] android:variablePadding=["true" | "false"] > <item android:drawable="@[package:]drawable/drawable_resource" android:state_pressed=["true" | "false"] android:state_focused=["true" | "false"] android:state_hovered=["true" | "false"] android:state_selected=["true" | "false"] android:state_checkable=["true" | "false"] android:state_checked=["true" | "false"] android:state_enabled=["true" | "false"] android:state_activated=["true" | "false"] android:state_window_focused=["true" | "false"] /> </selector> Drawable Selector
  • 18. Resources <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape=["rectangle" | "oval" | "line" | "ring"] > <corners android:radius="integer" android:topLeftRadius="integer" android:topRightRadius="integer" android:bottomLeftRadius="integer" android:bottomRightRadius="integer" /> <gradient android:angle="integer" android:centerX="integer" android:centerY="integer" android:centerColor="integer" android:endColor="color" android:gradientRadius="integer" android:startColor="color" android:type=["linear" | "radial" | "sweep"] android:useLevel=["true" | "false"] /> <padding android:left="integer" android:top="integer" android:right="integer" android:bottom="integer" /> <size android:width="integer" android:height="integer" /> <solid android:color="color" /> <stroke android:width="integer" android:color="color" android:dashWidth="integer" android:dashGap="integer" /> </shape> Shape