3408 Commits

Author SHA1 Message Date
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
George Mount
0dbcee1fb9 Merge implementation into base class for single implementations.
Bug 19933646

Change-Id: Ifc947d929b5275e32598e8d40f0122504a99d7f8
2015-03-31 08:23:39 -07:00
Raph Levien
26d443aee4 Revert "Fix build: Revert "Record hyphens from Minikin and draw them""
This reverts commit 5a6eeb3cbe0896ddf4bdccc0b1a81d7aac49821e and
fixes the underlying issue (needed to @hide getHyphen() for subclasses
of Layout, not just the base class), and layoutlib changes for
checkbuild.

Change-Id: I7a2b5f20ae014ea8e224d8c4079cf9131e17e1c1
2015-03-30 15:13:50 -07:00
George Mount
75aa9bf96f Require only one pass to make BR.java file.
Bug 19985005

Because the generation of Binding files created @Bindable
annotations, the BR file generation had to wait until a
second annotation pass. This caused errors to be generated
that were later cleared, causing confusion. I moved the
BR file generation to the same annotation processing stage
that generates the Binding files to clear up the error
generation.

TODO: merge the annotation processing stages so that there
is less cross-talk between annotation processors.
2015-03-30 12:27:25 -07:00
Adam Metcalf
1c7e70aaf8 Add support for GmsCore to apilint.py
Add flag to allow references to google.
Refactor argument parsing to use argparse.

Change-Id: I5fd3b6628a00113b9644dcae2919632db056909d
2015-03-27 16:17:23 -07:00
George Mount
a428ab93ec Address comments on LeakTest. 2015-03-27 16:14:36 -07:00
George Mount
46bb16c303 Make ViewStub support binding variables like include.
Bug 19969378
2015-03-27 16:05:21 -07:00
Deepanshu Gupta
22ed799622 am c1c3b88e: am 80d5c425: am fb37c97c: am 61bb0b4f: am 4e6ae02a: am 17bb697b: am ec8df9af: Fix tests for Java 6.
* commit 'c1c3b88ebd853425e931a5c07a045bae6ac1085f':
  Fix tests for Java 6.
2015-03-27 03:29:15 +00:00
Deepanshu Gupta
80d5c4250f am fb37c97c: am 61bb0b4f: am 4e6ae02a: am 17bb697b: am ec8df9af: Fix tests for Java 6.
* commit 'fb37c97c251cc9bef81dbf5b9acc58328656a980':
  Fix tests for Java 6.
2015-03-27 03:05:16 +00:00
Deepanshu Gupta
fb37c97c25 am 61bb0b4f: am 4e6ae02a: am 17bb697b: am ec8df9af: Fix tests for Java 6.
* commit '61bb0b4f58f794ff468f2cfaf958cb5cc0b09026':
  Fix tests for Java 6.
2015-03-27 02:58:47 +00:00
Deepanshu Gupta
4e6ae02a29 am 17bb697b: am ec8df9af: Fix tests for Java 6.
* commit '17bb697b3bce1b23137553829dd62e0e7c16b472':
  Fix tests for Java 6.
2015-03-27 01:09:53 +00:00
Deepanshu Gupta
17bb697b3b am ec8df9af: Fix tests for Java 6.
* commit 'ec8df9af2f35eb5be4df01d66b1add4a4e7546c7':
  Fix tests for Java 6.
2015-03-27 01:02:58 +00:00
George Mount
efff1c249e Move to public final fields instead of getters for Views.
Bug 19933644
2015-03-26 16:22:41 -07:00
George Mount
038ad93e7e Don't execute binding when the root view is detached.
Also add tests for memory leaks. The binder should be deleted
when the root view is deleted.

Change-Id: Ifcb24feb80791e64cdfd7203d071d9b1453f6f70
2015-03-26 15:57:23 -07:00
Deepanshu Gupta
ec8df9af2f Fix tests for Java 6.
- Change the guava version used to match the one included in the SDK.
   The test server uses the same. However, the command line build still
   uses the guava present at platform/external/guava, which is compiled
   with Java 7. Thus, running the tests from inside the IDE can be done
   via Java 6.
 - Rebuilt the test app classes with Java 6 compatibility.
 - Change similarity threshold to prevent differences due to some locale
   settings different java versions.

Change-Id: Ic71d43256a8cf6f9df296e63550667a202c7105f
2015-03-26 12:29:36 -07:00
Diego Perez
6386b8dae7 More layoutlib delegate native methods to do text rendering.
Moving some more methods to measure the text and compute the line
breaks.
The missing methods were causing crashes when running layoutlib from
master.

Change-Id: I910e1509836186fcff5cdd40c1dc38466b44c434
2015-03-26 14:39:12 +00:00