diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-04-24 19:19:30 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-05-04 16:43:24 -0700 |
commit | 24aad163bc88cb10d2275385e9afc3de7f342d65 (patch) | |
tree | 361fc0b3fbef5f68a16f357ae9d2bed5e93efbf5 /tools/aapt2/XmlFlattener.h | |
parent | ab2581398c812917145088590bd18eb83f3a2ea6 (diff) | |
download | frameworks_base-24aad163bc88cb10d2275385e9afc3de7f342d65.zip frameworks_base-24aad163bc88cb10d2275385e9afc3de7f342d65.tar.gz frameworks_base-24aad163bc88cb10d2275385e9afc3de7f342d65.tar.bz2 |
Add namespace handling in attribute values
Previously, you could only reference namespace prefixes in attribute names:
<View xmlns:appcompat="http://schemas.android.com/apk/res/android.support.v7.appcompat"
appcompat:name="hey"
...
Now you can also reference them in resource names within an attribute value:
...
android:text="@appcompat:string/confirm"
...
Which will be treated as "@android.support.v7.appcompat:string/confirm".
Change-Id: Ib076e867a990c80cf877a704eb77cd1ef0b23b52
Diffstat (limited to 'tools/aapt2/XmlFlattener.h')
-rw-r--r-- | tools/aapt2/XmlFlattener.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/aapt2/XmlFlattener.h b/tools/aapt2/XmlFlattener.h index 540a5ef..60a500e 100644 --- a/tools/aapt2/XmlFlattener.h +++ b/tools/aapt2/XmlFlattener.h @@ -23,6 +23,8 @@ #include "Source.h" #include "XmlPullParser.h" +#include <string> + namespace aapt { /** @@ -34,6 +36,12 @@ class XmlFlattener { public: struct Options { /** + * The package to use when a reference has no package specified + * (or a namespace URI equals "http://schemas.android.com/apk/res-auto"). + */ + std::u16string defaultPackage; + + /** * If set, tells the XmlFlattener to strip out * attributes that have been introduced after * max SDK. @@ -46,7 +54,7 @@ public: * and attributes. */ XmlFlattener(const std::shared_ptr<ResourceTable>& table, - const std::shared_ptr<Resolver>& resolver); + const std::shared_ptr<IResolver>& resolver); XmlFlattener(const XmlFlattener&) = delete; // Not copyable. @@ -62,7 +70,7 @@ public: private: std::shared_ptr<ResourceTable> mTable; - std::shared_ptr<Resolver> mResolver; + std::shared_ptr<IResolver> mResolver; }; } // namespace aapt |