Adam Lesinski 8c3f31f022 AAPT2: Fix issue with styled string indices
Styled strings use spans to denote which part
is styled (<b>, <i>, etc). Spans are simply a range
of indices into the original string.

In Java, we use String and its internal representation, meaning
we must encode the indices using UTF16 lengths.

When the internal AAPT2 representation of strings switched to UTF8,
the indices also began to index into the UTF8 string.

This change reverts the indices to use UTF16 lengths.

Bug:31170115
Change-Id: I07b8b5b67d2542c7e0a855b601cdbd3ac4ebffb0
2016-09-07 13:45:13 -07:00
..
2016-07-13 17:45:28 -07:00
2016-08-31 18:32:34 -07:00
2016-08-31 18:32:34 -07:00
2016-08-31 18:32:34 -07:00
2016-09-06 17:34:06 -07:00
2016-09-06 17:34:06 -07:00
2016-07-13 17:45:28 -07:00

Android Asset Packaging Tool 2.0 (AAPT2) release notes

Version 2.2

aapt2 compile ...

Version 2.1

  • Configuration Split APK support: supports splitting resources that match a set of configurations to a separate APK which can be loaded alongside the base APK on API 21+ devices. This is done using the flag --split path/to/split.apk:<config1>[,<config2>,...].
  • SDK version resource filtering: Resources with an SDK version qualifier that is unreachable at runtime due to the minimum SDK level declared by the AndroidManifest.xml are stripped.

Version 2.0

aapt2 compile ...

  • Pseudo-localization: generates pseudolocalized versions of default strings when the --pseudo-localize option is specified.
  • Legacy mode: treats some class of errors as warnings in order to be more compatible with AAPT when --legacy is specified.
  • Compile directory: treats the input file as a directory when --dir is specified. This will emit a zip of compiled files, one for each file in the directory. The directory must follow the Android resource directory structure (res/values-[qualifiers]/file.ext).
  • Automatic attribute versioning: adds version qualifiers to resources that use attributes introduced in a later SDK level. This can be disabled with --no-auto-version.
  • Min SDK resource filtering: removes resources that can't possibly be selected at runtime due to the application's minimum supported SDK level.