OSDN Git Service

LayoutLib: Support getting resource arrays. [DO NOT MERGE]
authorDeepanshu Gupta <deepanshu@google.com>
Fri, 22 May 2015 22:47:16 +0000 (15:47 -0700)
committerDeepanshu Gupta <deepanshu@google.com>
Tue, 25 Aug 2015 19:06:45 +0000 (12:06 -0700)
commitba5a02c5aa3c9850cdd72e592e9fa8a8d92db7ef
treeb849feba9de6e12ec41a0fe98a9d16c07dc8c529
parenta5ffed0b69ac41d65aacc6ee586688a22226f64b
LayoutLib: Support getting resource arrays. [DO NOT MERGE]

- Don't crash when Resources.get<Type>Array() is called.
- If the IDE supports it, actually return the value.
- Add tests for getArray.
- Update test app to latest gradle plugin version.
- Switch to using AppTheme for tests, since the tests depend on some
  custom theme attributes. The AppTheme now inherits from
  Material.Light.DarkActionBar, so other tests should be unaffected.

Depends on a newer version of sdk-common, which fixes the parsing of
array resource in value files.

Bug: 12372031
Change-Id: I313b61511e98ac1402d75056ebfdeeb005ebb96d
(cherry picked from commit 642cff50f8f7a67eed09eac1e56d7133b26a192c)
22 files changed:
tools/layoutlib/bridge/src/android/content/res/BridgeResources.java
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build.gradle
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/ArraysCheckWidget.class [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/MyActivity.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$array.class [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$attr.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$dimen.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$drawable.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$id.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$integer.class [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$layout.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$menu.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$string.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$style.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R.class
tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/java/com/android/layoutlib/test/myapplication/ArraysCheckWidget.java [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/array_check.xml [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/arrays.xml [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/attrs.xml [new file with mode: 0644]
tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml
tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java