3536 Commits

Author SHA1 Message Date
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
Bryce Lee
0ad58deca1 am 5f11a1af: add correct exception throw declaration to isScreenBrightnessBoosted.
* commit '5f11a1af572730567d9e35d6792a720585a268c6':
  add correct exception throw declaration to isScreenBrightnessBoosted.
2015-03-25 20:33:53 +00:00
Yigit Boyar
ff5868ed69 Fix integration tests that were broken after package renaming 2015-03-25 12:47:13 -07:00
Bryce Lee
5f11a1af57 add correct exception throw declaration to isScreenBrightnessBoosted.
Change-Id: I9b861002d7719ad43643d68f6795df6938bd0fc3
2015-03-25 11:51:39 -07:00
Bryce Lee
a6045ec8ed am 40a4f4a6: Implement isScreenBrightnessBoosted in BridgePowerManager.
* commit '40a4f4a61fbb2172901eda763bf928ae9b1b5300':
  Implement isScreenBrightnessBoosted in BridgePowerManager.
2015-03-25 18:51:05 +00:00
Bryce Lee
cffef341f9 Implement isScreenBrightnessBoosted in BridgePowerManager.
Change-Id: I7da132c7522e5c352e14123f059b900008d94c95
(cherry picked from commit 40a4f4a61fbb2172901eda763bf928ae9b1b5300)
2015-03-25 11:43:03 -07:00
Bryce Lee
40a4f4a61f Implement isScreenBrightnessBoosted in BridgePowerManager.
Change-Id: I7da132c7522e5c352e14123f059b900008d94c95
2015-03-25 11:16:23 -07:00
Deepanshu Gupta
ab11ec3917 am e773c20d: am 693236b3: am c263a07a: am 862f5900: am 44b5a1c8: am e541f350: Merge "Update JRE for runConfigurations." into lmp-dev
* commit 'e773c20d43a4a8b7504a91df5dd7cb216b89eaef':
  Update JRE for runConfigurations.
2015-03-25 00:30:05 +00:00
Deepanshu Gupta
3ae0bc032a am e2b85016: am ce2b74f7: am e51f5cdc: am e97079d9: am a16bb347: am 44fea603: Merge "Fix RoundRect radius." into lmp-dev
* commit 'e2b8501695c4ba5712d49313e86a566e95a5b0df':
  Fix RoundRect radius.
2015-03-25 00:29:50 +00:00
Deepanshu Gupta
cb580742e3 am 659413d6: am 5c03cd8a: am 96a67430: am 2b98abde: am 8f9ebc65: am 3bd5cbb1: Merge "Use right colors for status bar and nav bar." into lmp-dev
* commit '659413d6a2ccd8c8ade06bc3420ca90def3e3be6':
  Use right colors for status bar and nav bar.
2015-03-25 00:29:42 +00:00
Deepanshu Gupta
88c2fdc00c am eb96b231: am 25557e0a: am 5f0252de: am 6fa9d554: am 0b76cf6f: am 34751c79: Merge "Better shadows." into lmp-dev
* commit 'eb96b231b2755d50db4f931cc11203fd32a90820':
  Better shadows.
2015-03-25 00:29:34 +00:00
Deepanshu Gupta
5eda5a3d22 am f0e713a6: am 01f9ad1c: am 2ceb310d: am 5bc625d8: am a62a18e3: am 311a0f54: Merge "Fix layoutlib tests." into lmp-dev
* commit 'f0e713a67a0b5ea5f146900b3d4e53f6e1481c49':
  Fix layoutlib tests.
2015-03-25 00:29:23 +00:00
Deepanshu Gupta
693236b367 am c263a07a: am 862f5900: am 44b5a1c8: am e541f350: Merge "Update JRE for runConfigurations." into lmp-dev
* commit 'c263a07a55a9806147304a1420ceec2d27a6b49d':
  Update JRE for runConfigurations.
2015-03-25 00:15:44 +00:00
Deepanshu Gupta
ce2b74f729 am e51f5cdc: am e97079d9: am a16bb347: am 44fea603: Merge "Fix RoundRect radius." into lmp-dev
* commit 'e51f5cdcf34fe127792a177a3953dad03ef23647':
  Fix RoundRect radius.
2015-03-25 00:15:33 +00:00
Deepanshu Gupta
5c03cd8aad am 96a67430: am 2b98abde: am 8f9ebc65: am 3bd5cbb1: Merge "Use right colors for status bar and nav bar." into lmp-dev
* commit '96a67430c0088168f21b230c64c348a53e672538':
  Use right colors for status bar and nav bar.
2015-03-25 00:15:28 +00:00
Deepanshu Gupta
25557e0a96 am 5f0252de: am 6fa9d554: am 0b76cf6f: am 34751c79: Merge "Better shadows." into lmp-dev
* commit '5f0252dee43a1cd0f1591b3c9bea2d47ad1f3df0':
  Better shadows.
2015-03-25 00:15:22 +00:00
Deepanshu Gupta
01f9ad1c67 am 2ceb310d: am 5bc625d8: am a62a18e3: am 311a0f54: Merge "Fix layoutlib tests." into lmp-dev
* commit '2ceb310d09a865c56145ba8b5d643a11a7ad2ce5':
  Fix layoutlib tests.
2015-03-25 00:15:14 +00:00
Deepanshu Gupta
c263a07a55 am 862f5900: am 44b5a1c8: am e541f350: Merge "Update JRE for runConfigurations." into lmp-dev
* commit '862f5900e8abce1cc20979a4dca76e1f0b982880':
  Update JRE for runConfigurations.
2015-03-25 00:09:01 +00:00
Deepanshu Gupta
e51f5cdcf3 am e97079d9: am a16bb347: am 44fea603: Merge "Fix RoundRect radius." into lmp-dev
* commit 'e97079d97a5c914d06c24cb9deda1da9bea88aeb':
  Fix RoundRect radius.
2015-03-25 00:08:47 +00:00
Deepanshu Gupta
96a67430c0 am 2b98abde: am 8f9ebc65: am 3bd5cbb1: Merge "Use right colors for status bar and nav bar." into lmp-dev
* commit '2b98abde26aa2033562b48d635d6f2ba11c48908':
  Use right colors for status bar and nav bar.
2015-03-25 00:08:41 +00:00
Deepanshu Gupta
5f0252dee4 am 6fa9d554: am 0b76cf6f: am 34751c79: Merge "Better shadows." into lmp-dev
* commit '6fa9d5546fa27665de3f64564897a77735b2a1b0':
  Better shadows.
2015-03-25 00:08:35 +00:00
Deepanshu Gupta
2ceb310d09 am 5bc625d8: am a62a18e3: am 311a0f54: Merge "Fix layoutlib tests." into lmp-dev
* commit '5bc625d83d60fbb27ab2297051971be91fb3e415':
  Fix layoutlib tests.
2015-03-25 00:08:28 +00:00
Deepanshu Gupta
862f5900e8 am 44b5a1c8: am e541f350: Merge "Update JRE for runConfigurations." into lmp-dev
* commit '44b5a1c8471ef5e1cd3dcfffec5a9e439f228766':
  Update JRE for runConfigurations.
2015-03-25 00:02:18 +00:00