Top Banner
ANDROID STYLES XML for Graphics
17

Android Styles

Jun 14, 2015

Download

Technology

androidalliance

Presentation given by Frank Panko at the second Android Alliance meeting.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Android Styles

ANDROID STYLESXML for Graphics

Page 2: Android Styles

ADD A LITTLE STYLETransform an ordinary layout into something nice.

Page 3: Android Styles

COLORS.XMLCreate a color palette.

Page 4: Android Styles

ADDING COLORSandroid:background=”@color/white”

Page 5: Android Styles

STYLES.XMLSeparate your styles from your program.

Page 6: Android Styles

SHAPE DRAWABLESA simple gradient

Page 7: Android Styles

APPLY GRADIENT@drawable/green_grad

Page 8: Android Styles

UNOPTIMIZED STYLESApplying similar styles to text & buttons.

Page 9: Android Styles

OPTIMIZE STYLESCombine common attributes. Then apply as parent styles.

Page 10: Android Styles

STATE LIST DRAWABLECreating buttons with focus & pressed states.

Page 11: Android Styles

STATE LIST DRAWABLEInteractive button styles

Page 12: Android Styles

ADDING ICONSandroid:drawableLeft=”@drawable/cloud”

Page 13: Android Styles

ADDING BACKGROUNDSCreate drawable-land folder for landscape versions images.

Page 14: Android Styles

PHONE / TABLETBy default, most phone styles are small on tablets.

Background images stretch.

Page 15: Android Styles

TABLET STYLESAdd values-xlarge folder. Then add a new styles.xml file with just

the styles that are different

Page 16: Android Styles

TABLET STYLESStyles are adjusted for tablets without affecting phones.

Page 17: Android Styles

KEEP IN TOUCH

• @aviewfrommyseat

[email protected]

• frankpanko.com/aa.pdf