android styles
DESCRIPTION
Presentation given by Frank Panko at the second Android Alliance meeting.TRANSCRIPT
ANDROID STYLESXML for Graphics
ADD A LITTLE STYLETransform an ordinary layout into something nice.
COLORS.XMLCreate a color palette.
ADDING COLORSandroid:background=”@color/white”
STYLES.XMLSeparate your styles from your program.
SHAPE DRAWABLESA simple gradient
APPLY GRADIENT@drawable/green_grad
UNOPTIMIZED STYLESApplying similar styles to text & buttons.
OPTIMIZE STYLESCombine common attributes. Then apply as parent styles.
STATE LIST DRAWABLECreating buttons with focus & pressed states.
STATE LIST DRAWABLEInteractive button styles
ADDING ICONSandroid:drawableLeft=”@drawable/cloud”
ADDING BACKGROUNDSCreate drawable-land folder for landscape versions images.
PHONE / TABLETBy default, most phone styles are small on tablets.
Background images stretch.
TABLET STYLESAdd values-xlarge folder. Then add a new styles.xml file with just
the styles that are different
TABLET STYLESStyles are adjusted for tablets without affecting phones.
KEEP IN TOUCH
• @aviewfrommyseat
• frankpanko.com/aa.pdf