summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-01-11 14:28:03 -0800
committerXavier Ducrohet <xav@android.com>2010-01-11 14:28:03 -0800
commit9ce3b775f55abd0ceb1d8e96968ce725f1f8bade (patch)
tree24d0be965d60df05ba62b8ddc7d3095d76ee420f /tools/layoutlib
parent595f48b2a4fa2751ad638b60d2476e77738b21da (diff)
downloadframeworks_base-9ce3b775f55abd0ceb1d8e96968ce725f1f8bade.zip
frameworks_base-9ce3b775f55abd0ceb1d8e96968ce725f1f8bade.tar.gz
frameworks_base-9ce3b775f55abd0ceb1d8e96968ce725f1f8bade.tar.bz2
LayoutLib: support for custom styles.
Change-Id: Ic6c2ef234589f45db15024261d698066aa6e2f4e
Diffstat (limited to 'tools/layoutlib')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java
index 1e9f573..b670eee 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java
@@ -259,7 +259,18 @@ public final class BridgeContext extends Context {
// resolve the defStyleAttr value into a IStyleResourceValue
IStyleResourceValue defStyleValues = null;
- if (defStyleAttr != 0) {
+
+ // look for a custom style.
+ String customStyle = parser.getAttributeValue(null /* namespace*/, "style");
+ if (customStyle != null) {
+ IResourceValue item = findResValue(customStyle);
+
+ if (item instanceof IStyleResourceValue) {
+ defStyleValues = (IStyleResourceValue)item;
+ }
+ }
+
+ if (defStyleValues == null && defStyleAttr != 0) {
// get the name from the int.
String defStyleName = searchAttr(defStyleAttr);
@@ -1104,7 +1115,7 @@ public final class BridgeContext extends Context {
Bundle initialExtras) {
// TODO Auto-generated method stub
}
-
+
@Override
public void setTheme(int arg0) {
// TODO Auto-generated method stub
@@ -1137,7 +1148,7 @@ public final class BridgeContext extends Context {
throws IntentSender.SendIntentException {
// TODO Auto-generated method stub
}
-
+
@Override
public boolean startInstrumentation(ComponentName arg0, String arg1,
Bundle arg2) {