3423 Commits

Author SHA1 Message Date
Adam Lesinski
6e46056abc AAPT: Add flag to disable versioning of vector related XML
AAPT automatically versions XML files according to the SDK level
in which their attributes were introduced. Support libraries
know how to handle resources built against newer SDKs, so offer
the option to disable some of the automatic versioning, namely
vectors.

Bug:19336994
Change-Id: I9f9d0ae8f2a0c28404f82e27de416f80e38493c9
2015-04-21 14:27:02 -07:00
Svet Ganov
e8b6debd9b Fix build for real
Change-Id: I5742226e9b873cd5a035f11be0e228188e215365
2015-04-17 15:49:53 -07:00
Svet Ganov
6762301a10 Fix build
Change-Id: If469dce767b492c3fcc1ad8cf7ab1041eb61096f
2015-04-17 15:14:54 -07:00
Jeff Brown
f647832bd4 Merge "Add support for disabling display scaling for development." 2015-04-16 22:55:58 +00:00
Deepanshu Gupta
4967201a2c resolved conflicts for merge of 186fe7b1 to master
Change-Id: I60886d3e44ae23a11c8f129517df87ee29625ada
2015-04-16 11:18:41 -07:00
Deepanshu Gupta
c4affce9df am 1f3c7f3f: am f18ceefc: am cd6e00c6: Merge changes from topic \'layoutlib-api-15\' into lmp-mr1-dev
* commit '1f3c7f3f500bdbfd790c20872961d84ef617f066':
  Update golden image for tests.
  Update to using LayoutlibCallback.
  Remove implementation of deprecated method.
  Add @empty support.
2015-04-16 17:41:54 +00:00
Deepanshu Gupta
1f3c7f3f50 am f18ceefc: am cd6e00c6: Merge changes from topic \'layoutlib-api-15\' into lmp-mr1-dev
* commit 'f18ceefcf0d3cc91e74737e0a93f16775e3bf18b':
  Update golden image for tests.
  Update to using LayoutlibCallback.
  Remove implementation of deprecated method.
  Add @empty support.
2015-04-16 17:31:34 +00:00
Adam Lesinski
5886a92eb6 Fix up the command line, add flags.
Change-Id: I420bd0212fc7541668bd095b88295564d3d11f6c
2015-04-15 20:29:48 -07:00
Adam Lesinski
769de98f2d AAPT2: Add library support
Change-Id: I307f56d9631784ab29ee4156d94886f9b2f25b30
2015-04-15 19:56:59 -07:00
Jeff Brown
d46747a1c6 Add support for disabling display scaling for development.
Added two new options to the wm command.

1. Set the screen size based on dips rather than pixels using the
current screen density.

eg. adb shell wm size 320dpx320dp

2. Disable automatic scaling of the contents of the display.
When combined with the previous command, this is useful for seeing
how the UI would behave if the screen remained at its current density
but changed physical size.

eg. adb shell wm scaling off

Bug: 19899223
Change-Id: I545f893ba4861494e995cf0457ebeba1050d28dc
2015-04-15 19:02:36 -07:00
Deepanshu Gupta
54862febaf Update golden image for tests.
Change-Id: If07edcbfb7016a6b80f4bd00cffab494f74bfc03
2015-04-15 18:20:57 -07:00
Deepanshu Gupta
37dbb8b7f3 Update to using LayoutlibCallback.
Change-Id: Ia89d418b0d40ca8efef8968a4a2a635616b945ac
2015-04-15 18:20:56 -07:00
Deepanshu Gupta
49ce36e175 Remove implementation of deprecated method.
BridgeResources.getDrawable(int) is not needed anymore, since the super
method is deprecated and it calls the alternative
getDrawable(int, Theme), which we override.

Change-Id: I00c0bfaef6c4167a787bb74990b91cebb951c847
2015-04-15 18:20:55 -07:00
Deepanshu Gupta
9ca9774726 Add @empty support.
Bug: http://b.android.com/162428
Change-Id: Id7a981de2fce21213e12cdabcce4104f146fd4d3
2015-04-15 18:20:47 -07:00
Tim Kilbourn
6a975b3c35 Save search context when dispatching onSearchRequested.
The InputDevice used to trigger the search is saved in a SearchEvent
so an application implementing onSearchRequested determine the device
triggering the search.

Bug: 15374820
Change-Id: If2cd14f77ce572a5ee131697cd63145fbea63f27
2015-04-13 09:39:24 -07:00
Qiwen Zhao
f2834c12a3 Merge "remove data-binding from base/tools. it should not be here since it depends on support lib." 2015-04-11 02:42:43 +00:00
Adam Lesinski
d8d07f1757 Merge "AAPT2: Create Makefile" 2015-04-11 02:10:32 +00:00
Adam Lesinski
c7e2432dec AAPT2: Create Makefile
Makefile that uses zip for assembling the final APK. This is temporary and
helps speed up the rest of development.

Has to add a new 'manifest' phase that simply compiles the AndroidManifest.xml.
Manifests are handled differently and must be validated.

Change-Id: I0d8255b3ad0d0b0a322683077e3331ca93e37fa0
2015-04-10 19:07:51 -07:00
Qiwen Zhao
f73037aee9 remove data-binding from base/tools. it should not be here since it depends on support lib.
Change-Id: Iac90ab2fb797617429a6a4e1e429f085455154e2
2015-04-10 16:04:41 -07:00
Adam Lesinski
105b8a5f4f Merge "AAPT2: Adding basic binding support" 2015-04-10 22:27:38 +00:00
Adam Lesinski
4d3a987694 AAPT2: Adding basic binding support
This is incomplete. Still requires:

- filling in layout information in the resulting .bind.xml
- processing elements with <view class=""/>
- processing imports

Change-Id: Ie5d4c5e6435591bbed3248129a548736244894eb
2015-04-10 15:25:39 -07:00
Adam Powell
539ea12810 Relax apilint FW1 error to a warning
This rule was catching simple getters ("getIntent") as errors even if
the method is a true property get method. Relax to warning until we
can make this a bit more clever.

Change-Id: If183ad5bdc076ce2252399d4abcc8a3a6cbb55c3
2015-04-10 13:07:52 -07:00
Adam Lesinski
a826c4b7a4 Merge "Add PNG and 9-patch support" 2015-04-10 00:32:28 +00:00
Adam Lesinski
98aa3ad6e4 Add PNG and 9-patch support
Change-Id: I9ecdfdf82b82d59084490da518e167e256afd5f2
2015-04-09 17:19:06 -07:00
Colin Cross
88fa96c758 am 106f83ee: am 4cead39a: am 1be312df: Merge "Re-enable -Wall and -Werror that were lost in a merge"
* commit '106f83ee9cc145a6421d21067c44b513cc148e80':
  Re-enable -Wall and -Werror that were lost in a merge
2015-04-09 01:44:38 +00:00
Colin Cross
4cead39a17 am 1be312df: Merge "Re-enable -Wall and -Werror that were lost in a merge"
* commit '1be312dfb02e86731da6ac54a39956db791f4978':
  Re-enable -Wall and -Werror that were lost in a merge
2015-04-09 01:13:50 +00:00
Colin Cross
1be312dfb0 Merge "Re-enable -Wall and -Werror that were lost in a merge" 2015-04-09 00:49:56 +00:00
Colin Cross
01f185633c Re-enable -Wall and -Werror that were lost in a merge
-Wall and -Werror were lost during a merge when they were added to
aaptCFLAGS instead of aaptCFlags.  Fix the typo, and the warnings
that crept in while it was disabled.

Change-Id: Ib944b8d6149278e4f3861c1acac277bcd95cc7c2
2015-04-08 17:48:23 -07:00
Qiwen Zhao
4e7bb6312f Merge KDataBinder/ from platform/vendor/google/prototypes/data-binding to tools/data-binding/ 2015-04-08 15:58:36 -07:00
George Mount
6ad2715911 Fix merge error. 2015-04-07 13:00:54 -07:00
George Mount
4ec064dff1 Use layout path for the tag on bound layout roots.
Change-Id: I6bda5d5716e749251b27c112865da066ba908509
2015-04-07 11:02:11 -07:00
Yigit Boyar
266aa36b42 Fix ternary handling and generate better code
This CL fixes an issue about ternary expressions where
a ternary expression would be evaluated with its last
evaluated dependency. This would create a problem where
ternary expressions would not be evaluated if other branch
of the conditional is chosen, This bug is fixed by checking
outher flags such that we'll still calculate it together
if all dependencies are behind the same flag vs we'll
calculate it independently if its dependency flags are different.

This CL also improves the generated code in two ways:
  - When there is an if inside if, we don't add flag check (the if)
    if all of its conditions are covered in the parent if.
  - I replaced flag names with binary values. This looks more
    readable then generated names.

Bug: 20073197
Change-Id: I9d07868206a5393d6509ab0a205b30a796e11107
2015-04-06 14:16:54 -07:00
Deepanshu Gupta
1fd5d21e0d Merge "Be lenient in accepting version strings." 2015-04-06 20:56:05 +00:00
Deepanshu Gupta
d654b6f981 Be lenient in accepting version strings.
Don't throw exceptions for malformed version strings in font files, and
try to rename the font as is.

Change-Id: Ib4f74e68593abb5b551fbcb049484efc925a3d6e
2015-04-06 12:52:18 -07:00
Elliott Hughes
dda35c37ea am 66d94512: am dbb5f5d6: am efcbaec1: Merge "Only Windows doesn\'t have %zd."
* commit '66d9451273c4a3775b6b63a0e4b7027bd2eae65d':
  Only Windows doesn't have %zd.
2015-04-03 20:58:25 +00:00
Elliott Hughes
dbb5f5d6c4 am efcbaec1: Merge "Only Windows doesn\'t have %zd."
* commit 'efcbaec14135c42f81e2a8f645584cf7cf542a02':
  Only Windows doesn't have %zd.
2015-04-03 20:40:52 +00:00
Elliott Hughes
b12f2410c7 Only Windows doesn't have %zd.
Change-Id: I0e4b0fdc61641c5ecb724fd096bd2315dcf8ed4a
2015-04-03 12:56:45 -07:00
Adam Lesinski
feefeb4f30 AAPT2 statically link libz on Windows builds
Change-Id: I2abf47273173c470c04e00a54aa619fe1ce0e745
2015-04-03 12:44:40 -07:00
Adam Lesinski
ca2fc353c2 Fix windows build of AAPT2
Change-Id: Ib8e1a4322510b582e9600a08d3118842c9abc73c
2015-04-03 12:33:02 -07:00
Yigit Boyar
3695b1aae9 Fix bugs related to how we handle Ternary ops
This CL fixes two bugs.
1) When a Ternary operation was inside another operation, we were
not handling dependecies properly and model would think that
the container expression can be evaluated before Ternary is evaluated,
eventually causing an exception in code-gen because Ternay is not
calculated yet.

2) This also fixes another bug where when ?? is used, we would put
ifTrue and ifFalse statements in wrong order and eventually evaluate
!??.

Bug: 19939148

Change-Id: I3e1d2bee172e47412bb8ef9e7c785aef47337155
2015-04-03 10:00:25 -07:00
Greg Hackmann
1fce4f9c89 aapt2: fix definition of G in Util.h
Change-Id: Icbefa425cf543f130deabab9e2e2e6c13ab672d3
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-04-02 20:31:17 -07:00
Adam Lesinski
e6c28f7c3a Merge "AAPT2" 2015-04-03 00:06:34 +00:00
Adam Lesinski
6f6ceb7e14 AAPT2
First checking of AAPT2. The individual phases of AAPT2 work, but there
are some missing pieces.

For early testing we are missing:
- Need to properly mark file references and include them in package
- Need to package into zip

Final AAPT for apps we are missing:
- Need to crush PNGs
- Need to parse 9-patches
- Need to validate all of AndroidManifest.xml
- Need to write align method to align resource tables for splits.

Final AAPT for apps + system we are missing:
- Need to handle overlays
- Need to store comments for R file
- Need to handle --shared-lib (dynamic references too).

New AAPT features coming:
- Need to import compiled libraries
    - Name mangling
    - R file generation for library code

Change-Id: I95f8a63581b81a1f424ae6fb2c373c883b72c18d
2015-04-02 17:02:48 -07:00
George Mount
53a6b1bde8 Change "generated" to "databinding" 2015-04-02 21:05:51 +00:00
George Mount
a02e4c6c76 Use setTag(id, val) when minSdk is ICS and later.
setTag(id, val) leaks on versions before ICS. When the
minimum SDK is before ICS, setTag(val) must be used
for bindings. However, this prevents the developer from
using the tag for his or her own purposes. Therefore,
if the minimum SDK is ICS and greater, setTag(id, val)
is used.

Change-Id: I46327084bde4bafc05a64f82ad5ebcf710820ecc
2015-04-02 13:38:53 -07:00
George Mount
dfbaf13bea Address comment in CL
Bug 19933646
2015-04-02 18:05:06 +00:00
George Mount
808ebfa37f Don't use reflection for DataBinderMapper.
By having a concrete implementation of DataBinderMapper in the
library and then stripping it out, the generated DataBinderMapper
may be instantiated without reflection.
2015-04-02 18:04:45 +00:00
George Mount
4cd742ffeb Capture views with IDs and no expressions in Binding.
We want to get all Views with IDs in the Binding to save the
developer effort in calling findViewById.

Change-Id: Ib7dd85ae9ecc0fd31b235364c0eadc2303dd1780
2015-04-02 10:23:37 -07:00
George Mount
fcbf46e7d0 Merge "Merge implementation into base class for single implementations." 2015-04-01 14:10:57 +00:00
George Mount
bc81292ae8 Fix license on expression grammar. 2015-03-31 14:13:05 -07:00