diff options
author | Xavier Ducrohet <xav@android.com> | 2012-02-27 07:51:05 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-02-27 07:51:05 -0800 |
commit | aeb17f17ffd8d3384dfed223e40010b4abac4cc5 (patch) | |
tree | 411156d560e7bf4ec626d9e91d5290229ca6c199 /tools/layoutlib/bridge | |
parent | 0a66900ee5093afa12a5786c4b9dc0e58991f426 (diff) | |
parent | 77fdcbff8b458dd3430b38e60aee1a28ca92a738 (diff) | |
download | frameworks_base-aeb17f17ffd8d3384dfed223e40010b4abac4cc5.zip frameworks_base-aeb17f17ffd8d3384dfed223e40010b4abac4cc5.tar.gz frameworks_base-aeb17f17ffd8d3384dfed223e40010b4abac4cc5.tar.bz2 |
am 77fdcbff: am f038868d: am 44e63a21: Support rendering layout that use the new res-auto namespace.
* commit '77fdcbff8b458dd3430b38e60aee1a28ca92a738':
Support rendering layout that use the new res-auto namespace.
Diffstat (limited to 'tools/layoutlib/bridge')
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java | 3 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java index 112af1e..eb9e7f1 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java @@ -39,6 +39,9 @@ public class BridgeConstants { /** Namespace for the resource XML */ public final static String NS_RESOURCES = "http://schemas.android.com/apk/res/android"; + /** App auto namespace */ + public final static String NS_APP_RES_AUTO = "http://schemas.android.com/apk/res-auto"; + public final static String R = "com.android.internal.R"; diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java index cd085fc..58dc2d4 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java @@ -49,8 +49,8 @@ import android.content.res.BridgeResources; import android.content.res.BridgeTypedArray; import android.content.res.Configuration; import android.content.res.Resources; -import android.content.res.TypedArray; import android.content.res.Resources.Theme; +import android.content.res.TypedArray; import android.database.DatabaseErrorHandler; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; @@ -78,8 +78,8 @@ import java.io.InputStream; import java.util.HashMap; import java.util.IdentityHashMap; import java.util.Map; -import java.util.TreeMap; import java.util.Map.Entry; +import java.util.TreeMap; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; @@ -615,7 +615,8 @@ public final class BridgeContext extends Context { } String namespace = BridgeConstants.NS_RESOURCES; - if (frameworkAttributes.get() == false) { + boolean useFrameworkNS = frameworkAttributes.get(); + if (useFrameworkNS == false) { // need to use the application namespace namespace = mProjectCallback.getNamespace(); } @@ -628,6 +629,12 @@ public final class BridgeContext extends Context { String value = null; if (set != null) { value = set.getAttributeValue(namespace, name); + + // if this is an app attribute, and the first get fails, try with the + // new res-auto namespace as well + if (useFrameworkNS == false && value == null) { + value = set.getAttributeValue(BridgeConstants.NS_APP_RES_AUTO, name); + } } // if there's no direct value for this attribute in the XML, we look for default |