OSDN Git Service

Implement AAPT Bundle format
authorAdam Lesinski <adamlesinski@google.com>
Wed, 28 Oct 2015 22:44:27 +0000 (15:44 -0700)
committerAdam Lesinski <adamlesinski@google.com>
Tue, 24 Nov 2015 23:38:40 +0000 (15:38 -0800)
commit9d0f7d44d5cc5322415f52f7ce03cc37a478b350
tree1882cbfd2f9867e865444c95da0d79028d79ae60
parent1cffc196610891f6669c33404f3ff5b0232b7059
Implement AAPT Bundle format

AAPT will scan XML files looking for the <aapt:attr> XML tag.

<!-- @layout/bundle.xml -->
<ImageView xmlns:aapt="http://schemas.android.com/aapt">
  <aapt:attr name="android:src">
    <vector android:pathData="..." ...>
    </vector>
  </aapt:attr>
</ImageView>

The SINGLE child element of the <aapt:attr> tag is extracted into its own top
level resource. It is given a generated name.

The parent element of <aapt:attr> is then given the resource attribute that was assigned
to the `name' attribute. The value is set to a reference to the generated resource.

<!-- @layout/bundle.xml -->
<ImageView android:src="@drawable/bundle_1.xml">
</ImageView>

<!-- @layout/bundle_1.xml -->
<vector android:pathData="..." ...>
</vector>

Bug:22627686
Change-Id: I31bc96aae30d38bfd0b16508d0f585de5fd88a07
tools/aapt/Resource.cpp
tools/aapt/ResourceTable.cpp
tools/aapt/ResourceTable.h
tools/aapt/XMLNode.cpp
tools/aapt/XMLNode.h