OSDN Git Service

Resolve color xml attributes properly.
authorDeepanshu Gupta <deepanshu@google.com>
Sat, 9 Aug 2014 21:14:45 +0000 (14:14 -0700)
committerDeepanshu Gupta <deepanshu@google.com>
Tue, 12 Aug 2014 16:57:27 +0000 (09:57 -0700)
commit99d90a621084ec0f799dc7840cc05565a0589031
tree0042efb754038ada9d06c41aaecfaf4ec63c963b
parent3afd00e9f2b55a21ca378d6e520d24283dbb62e0
Resolve color xml attributes properly.

Color attributes were not being converted to int properly. The
conversion to int was a simple string to int using base 16. This change
resolves the colors as per #RGB, #ARGB, #RRGGBB or #AARRGGBB format
depending on the length of the attribute. All values that begin with '#'
are treated as colors.

Bug: http://b.android.com/73845
Change-Id: I8ad089b821af1e290b9b95771b50213fe2fdd784
tools/layoutlib/bridge/src/android/util/BridgeXmlPullAttributes.java