158 Commits

Author SHA1 Message Date
Deepanshu Gupta
8f92d92a09 Build layoutlib create tests as part of sdk build.
LayoutLib Create tests are now built whenever LayoutLib create is built.

Change-Id: Id215e8690e435019579dba1734090a0d585f37e1
2014-09-08 18:38:57 -07:00
Deepanshu Gupta
a0904bf7aa Add layoutlib tests to DIST_DIR
Add the layoutlib and layoutlib-create tests to DIST_DIR for sdk
targets. These can be used for continuous testing on the build server.

Change-Id: I747dddcddfd8009937668bec4d75cb99bf63235f
2014-09-05 14:01:27 -07:00
Deepanshu Gupta
b988c8fa66 Build layoutlib_create tests.
Change-Id: Ia13a090f8ec29b2b2a107825b6a13d7db77e6d61
2014-09-03 12:57:12 -07:00
Deepanshu Gupta
0c5cd96522 Add SystemProperties native method implementations.
Bug: http://b.android.com/73046
Change-Id: Ia695e7beb81f426509b646cfd929201f7e0a4ade
2014-08-05 21:13:00 +00:00
Deepanshu Gupta
45aab0eb8f LayoutLib: Use ICU's line break algo.
Change-Id: I7e5b0ab7423a72f5a4b0e1163d0a537f0b03ba07
2014-08-05 21:12:16 +00:00
Deepanshu Gupta
b80e42f93f Replace more Locale methods.
This change replaces some methods of java.util.Locale. Some of them were
added in 1.7 and some are not present in the Desktop VM.

Change-Id: Ifdf8451bb2acf55e01dce8b5e15c40c8160107cc
2014-08-04 23:02:02 +00:00
Deepanshu Gupta
d2a411840c Fix LayoutLib Create tests.
Change-Id: Ica3efe417d54da7dc74b21d28215199d37600744
2014-08-04 22:59:38 +00:00
Deepanshu Gupta
86eb8b4e29 Add testing framework to LayoutLib.
This change adds an end to end test which loads the framework resources
and a test app and ensures that no exceptions or warnings are thrown.

The change also adds project configuration for intelliJ.

Change-Id: I7b67c0f1a2af2dac95df7f3231cab537b9826d7d
2014-08-04 22:58:39 +00:00
Deepanshu Gupta
72c60ab7d4 Fix classpath for AndroidLocale
Change-Id: I9af9ac05ec26f12529d51e566bf38789a2579390
2014-07-31 05:10:03 +00:00
Deepanshu Gupta
5cd9dde5a2 Support Locale.toLanguageTag on Java 6
Change-Id: I255e79e2c288cd24b350b7c26128bbbb0b2cb9a3
2014-07-15 12:56:04 -07:00
Deepanshu Gupta
c5a58437e6 Style improvements to LayoutLib create.
This change doesn't change the functionality but removes dead code and
simplifies various places to remove warnings.

Change-Id: I371e06bfbd587dbf0eeafc69787b9805f7008f62
2014-07-11 21:40:46 +00:00
Deepanshu Gupta
e1960cc0b5 LayoutLib: Fix System.arraycopy()
Framework has specialized versions of java.lang.System.arraycopy() for
all primitive data types. These versions are not present on the Desktop
VM. This change replaces calls to any of the specialized versions with
the more general alternative - the one using Objects.

Note that this was already being done for char.

Change-Id: If1584125fea8ecc080fb39a5ee6cdb4d922d0c98
2014-07-11 10:27:36 -07:00
Deepanshu Gupta
3c989eaa0a Add VMRuntime_Delegate
Framework now uses libart which moved the implementation of
newUnpaddedArray() to native. This copies over the implementation of the
method from libdvm to restore the old behaviour.

Change-Id: Ic062aeb01f9ea52b6ed35517f742058d0ba8c804
2014-07-01 12:22:13 -07:00
Deepanshu Gupta
1160e6d2f7 LayoutLib: Fix EditText rendering
Framework has overloaded java.lang.System.arraycopy() for char[]. The
method is not present on the Desktop VMs. This change replaces the calls
to this method by its more general alternative - the one using Objects.

TODO: Make it more configurable and flexible to allow rewrite of any
such methods in the future.

Change-Id: I6823b13e52b1c555eb257d02b79707d84e73236f
2014-06-10 17:44:14 -07:00
Deepanshu Gupta
baef8c1ffe Layoutlib fixes for L [DO NOT MERGE]
This adds the new delegates that were missing. This starts the work on
changes related to Minikin Fonts.

There are some changes related to TypedArray that still need to be
fixed.

Change-Id: Ic2397b64aa3f1f48926e849b14689c47d9ee7f8c
(cherry picked from commit 7ca3612094270183243938e79337c84effea7ad0)
2014-05-27 18:01:34 -07:00
Deepanshu Gupta
6376c407d4 Layoutlib: Update delegates for L
Update delegate method signatures for L.

Change-Id: Ie607293bcae60b2d3a61d1cad3ac5f04bda2a238
2014-05-15 09:30:11 -07:00
Deepanshu Gupta
425645c738 am 567f948b: am 872a5a1a: am 01fefec9: am 5fc8f945: am b0f2ded5: am 40db4a13: am 9ddb073b: am c70ce72a: am af9fde96: am 425addb9: am a43aaf00: resolved conflicts for merge of 9c00e673 to jb-mr1.1-dev
* commit '567f948b60e9a647610454745b0629c136d492db':
  Fix CalendarView to show the right labels. [DO NOT MERGE]
2014-05-13 18:15:58 +00:00
Deepanshu Gupta
5fc8f945ee am b0f2ded5: am 40db4a13: am 9ddb073b: am c70ce72a: am af9fde96: am 425addb9: am a43aaf00: resolved conflicts for merge of 9c00e673 to jb-mr1.1-dev
* commit 'b0f2ded5e9e84fb51ec5b2cb6b419b040b008276':
  Fix CalendarView to show the right labels. [DO NOT MERGE]
2014-05-13 17:45:43 +00:00
Deepanshu Gupta
9ddb073bf7 am c70ce72a: am af9fde96: am 425addb9: am a43aaf00: resolved conflicts for merge of 9c00e673 to jb-mr1.1-dev
* commit 'c70ce72a986f029c9f8c43b4060001624176068d':
  Fix CalendarView to show the right labels. [DO NOT MERGE]
2014-05-13 17:29:13 +00:00
Deepanshu Gupta
c70ce72a98 am af9fde96: am 425addb9: am a43aaf00: resolved conflicts for merge of 9c00e673 to jb-mr1.1-dev
* commit 'af9fde9680922f072981a4853e37ccfcf974920a':
  Fix CalendarView to show the right labels. [DO NOT MERGE]
2014-05-13 17:24:10 +00:00
Deepanshu Gupta
a43aaf00b5 resolved conflicts for merge of 9c00e673 to jb-mr1.1-dev
Change-Id: I4ab1b0a71b99692458efc3a67c8a8da3690afb7b
2014-05-13 09:49:18 -07:00
Deepanshu Gupta
9c00e6739c am 2fb139e0: resolved conflicts for merge of 9f2f5e77 to jb-mr1-dev
* commit '2fb139e02c1e9d2d7c92acf813445a063e73d94f':
  Fix CalendarView to show the right labels. [DO NOT MERGE]
2014-05-13 16:31:05 +00:00
Deepanshu Gupta
2fb139e02c resolved conflicts for merge of 9f2f5e77 to jb-mr1-dev
Change-Id: Id8cb5e2e9d0c41bdaf767563ebd6e3951ae68a3c
2014-05-12 19:01:41 -07:00
Deepanshu Gupta
6f6989f353 am 80f2914b: am b67b1b45: am 094fd8ec: Add view cookies for action bar menus. [DO NOT MERGE]
* commit '80f2914b4b12340ff590882125789144d4f00ce0':
  Add view cookies for action bar menus. [DO NOT MERGE]
2014-05-13 02:00:17 +00:00
Deepanshu Gupta
e7c3ed4427 am 21404483: am 0bb06b91: am fe38489f: Action bar rendering in layoutlib [DO NOT MERGE]
* commit '21404483adbd4f26b5a2c7ebee7c09e83f42607e':
  Action bar rendering in layoutlib [DO NOT MERGE]
2014-05-13 02:00:11 +00:00
Deepanshu Gupta
57c0cf454a am 71acfa6c: am 49d47a02: am 76dccb7f: Fix theme/style resolution in Layoutlib [DO NOT MERGE]
* commit '71acfa6c1933806a080fc6efb820833f8de68d54':
  Fix theme/style resolution in Layoutlib [DO NOT MERGE]
2014-05-13 02:00:06 +00:00
Deepanshu Gupta
3195ff0afa am b90db3e6: am de3b2c06: am 1ed75bde: Remove references to non-std Java classes. [DO NOT MERGE]
* commit 'b90db3e6ab1bc89752ce8d7bd286268c41843693':
  Remove references to non-std Java classes. [DO NOT MERGE]
2014-05-13 02:00:03 +00:00
Deepanshu Gupta
4654bfc14c am c2a6f3b1: am 2f94c1db: am 6136af32: Fix visitFieldInsn in layoutlib_create. [DO NOT MERGE]
* commit 'c2a6f3b1eda89365eec2508aec4a3a5024c140e5':
  Fix visitFieldInsn in layoutlib_create. [DO NOT MERGE]
2014-05-13 01:59:58 +00:00
Deepanshu Gupta
9f2f5e776a am 2d82586b: Fix CalendarView to show the right labels. [DO NOT MERGE]
* commit '2d82586b96593b1b3b5280d77d5ae9a09df9d1fd':
  Fix CalendarView to show the right labels. [DO NOT MERGE]
2014-05-13 01:52:25 +00:00
Deepanshu Gupta
2d82586b96 Fix CalendarView to show the right labels. [DO NOT MERGE]
Change-Id: I95431f1054678d4192bd1621c1f69b29268f55e9
(cherry picked from commit 44bcd64e5b9fd211dd56b0598693a0559f65dc1a)
2014-05-05 18:32:04 -07:00
Deepanshu Gupta
094fd8ecb6 Add view cookies for action bar menus. [DO NOT MERGE]
The change adds the view cookies for the menus rendered in the action
bar. This enables the IDE to map the menu to the relevant XML Tag in the
menu xml and show the highlighting accordingly.

The change also contains a bugfix where a method wasn't renamed
properly.

Change-Id: Idcfc263a8ebe0a4f25afa3a1eb085fa628fd03ca
(cherry-picked from commit 7704837947455909f295b088a3d15a20e107dbd7)
2014-05-04 13:29:14 -07:00
Deepanshu Gupta
7704837947 Add view cookies for action bar menus. [DO NOT MERGE]
The change adds the view cookies for the menus rendered in the action
bar. This enables the IDE to map the menu to the relevant XML Tag in the
menu xml and show the highlighting accordingly.

The change also contains a bugfix where a method wasn't renamed
properly.

Change-Id: Idcfc263a8ebe0a4f25afa3a1eb085fa628fd03ca
(cherry-picked from commit 5ba2f230faa355eb9bc1e90f6c48eeeb437f390c)
2014-05-02 17:33:05 -07:00
Deepanshu Gupta
fe38489f67 Action bar rendering in layoutlib [DO NOT MERGE]
This also makes a couple of changes to the framework:
1. ShareActionProvider - Use edit mode to execute activity chooser code.
2. ActionBarImpl - add a new constructor for use by layoutlib.

This also relies on some changes to the plugin to pass the correct params.

Change-Id: Ia30fef816afd91ec1e439734d56b59b1323bfee2
(cherry-picked from 20e0695b554e883b095f5223be10b6e1097db49f)
2014-05-02 16:23:14 -07:00
Deepanshu Gupta
76dccb7f43 Fix theme/style resolution in Layoutlib [DO NOT MERGE]
Change-Id: Icfb91e566666408802dadc0e2070991151b16b9d
(cherry picked from commit 3c00b28bf60ab01b449e16df045238f4bae4d700)
2014-05-02 16:23:13 -07:00
Deepanshu Gupta
1ed75bde09 Remove references to non-std Java classes. [DO NOT MERGE]
This change adds a substitute for the Charsets class in java namespace.
The original cherry pick of the change had dropped this substitute. But
the substitute is required for bug b.android.com/59732

The original cherry-pick is 6335590aa8997944cc7fb358a315dbb9b789f87f and
the original change is 81f74f4bc96ea4266cebe1b785d095558f540800
The original Change-Id is Iac5b272652e2780c9bb72d19f415d150948ca589

Change-Id: I76c87c74ee088778b37d1a7a7d531e0fde5c758f
2014-05-02 16:22:14 -07:00
Deepanshu Gupta
6136af326e Fix visitFieldInsn in layoutlib_create. [DO NOT MERGE]
The bug caused some classes to be missed when computing the dependencies
of the existing classes.

Change-Id: I7285ff67e016ce5d73a8550501f49acc73cfadfa
(cherry-picked from 6f9baea47757fef4745de434e09bd552fddc1f03)
2014-05-02 15:38:42 -07:00
Deepanshu Gupta
495c14d8b8 am 47ad22ed: am 961e3281: am 6df2860b: Add missing files to fix libphonenumber for layoutlib. [DO NOT MERGE]
* commit '47ad22edb7df502356598d417adbce0b0ce35616':
  Add missing files to fix libphonenumber for layoutlib. [DO NOT MERGE]
2014-05-02 19:31:59 +00:00
Deepanshu Gupta
73f9e4675c am edd67cb1: am 7c02c6e2: am 02cde9ce: Add methods for Time_Delegate [DO NOT MERGE]
* commit 'edd67cb194b54bb7c6c25eb570d28614900446cf':
  Add methods for Time_Delegate [DO NOT MERGE]
2014-05-02 19:31:39 +00:00
Deepanshu Gupta
95fd97aa82 am 84e7a6b8: am 443372dd: am 9d7b5165: Add libphonenumber to layoutlib.jar. [DO NOT MERGE]
* commit '84e7a6b82303b52c7b44f1a2a295177361edf9ea':
  Add libphonenumber to layoutlib.jar. [DO NOT MERGE]
2014-05-02 19:31:36 +00:00
Deepanshu Gupta
aab9d9a75c am 1a434aa8: am 697c511d: am 80c668f2: Remove references to non-std Java classes. [DO NOT MERGE]
* commit '1a434aa8fcc118df13bea58e112da081d47ae73b':
  Remove references to non-std Java classes. [DO NOT MERGE]
2014-05-02 19:31:11 +00:00
Deepanshu Gupta
2bb672a208 am 582bb0dc: am fbb1561a: am 44bcd64e: Fix CalendarView to show the right labels. [DO NOT MERGE]
* commit '582bb0dc7498997f441c5209b1558a4640b5a107':
  Fix CalendarView to show the right labels. [DO NOT MERGE]
2014-05-02 19:19:55 +00:00
Deepanshu Gupta
6df2860b23 Add missing files to fix libphonenumber for layoutlib. [DO NOT MERGE]
Change-Id: I8102da6c1c4625e887293a8823770d199521c53f
(cherry-picked from 8a16f8e29a67c383e065ba9c47d5d1e80d7d2db9)
2014-05-02 12:03:46 -07:00
Deepanshu Gupta
02cde9ceeb Add methods for Time_Delegate [DO NOT MERGE]
Bug: http://b.android.com/65359
Change-Id: I7c2d09286d6bcd9899444aaa5a4a5a342e39d923
(cherry-picked from ddb7f3273c3c00e6520794dcaabdaad20fd98e26)
2014-05-02 11:46:40 -07:00
Deepanshu Gupta
9d7b516557 Add libphonenumber to layoutlib.jar. [DO NOT MERGE]
Issue: http://b.android.com/59497
Change-Id: Ief11e602703b6041db66241f1699cc1de72e65a5
(cherry picked from commit 317f304893c58c5e50255bd712448ca233ae5cec)
2014-05-02 11:46:40 -07:00
Deepanshu Gupta
80c668f2a0 Remove references to non-std Java classes. [DO NOT MERGE]
Do not add the non-standard Java classes. Updates the references to all
non-standard classes to new classes in
com.android.tools.layoulib.create package. This also treats
java.lang.AutoCloseable which is part of Java 7 similarly so that we can
still run on Java 6.

This also adapts the cherrypick for this branch by updating references
to the non-standard Java classes present in this branch.

Change-Id: Iac5b272652e2780c9bb72d19f415d150948ca589
(cherry picked from 0b7d80765c21dbd9294a0245f92a655fdd61514e)
2014-05-02 11:46:39 -07:00
Deepanshu Gupta
44bcd64e5b Fix CalendarView to show the right labels. [DO NOT MERGE]
Change-Id: I95431f1054678d4192bd1621c1f69b29268f55e9
(cherry picked from commit 083e3caf66c21f7cc9511db479726c38d90e2d2f)
2014-05-02 11:46:37 -07:00
Deepanshu Gupta
20e0695b55 Action bar rendering in layoutlib [DO NOT MERGE]
This also makes a couple of changes to the framework:
1. ShareActionProvider - Use edit mode to execute activity chooser code.
2. ActionBarImpl - add a new constructor for use by layoutlib.

This also relies on some changes to the plugin to pass the correct params.

Change-Id: Ia30fef816afd91ec1e439734d56b59b1323bfee2
(cherry-picked from 4ccc4bd54f85d86818f61d728c6361d2003ddd8e)
2014-04-25 19:22:14 -07:00
Deepanshu Gupta
3c00b28bf6 Fix theme/style resolution in Layoutlib [DO NOT MERGE]
Cherry picked from klp-dev from
Change-Id: If1e7187645f0b0388f7b97d742395efd228b347a which was
cherrypicked from master with the following

Change-Id: Icfb91e566666408802dadc0e2070991151b16b9d
(cherry picked from commit f1e7187645f0b0388f7b97d742395efd228b347a)
2014-04-25 18:58:15 -07:00
Deepanshu Gupta
f8144032d1 Fix visitFieldInsn in layoutlib_create. [DO NOT MERGE]
The bug caused some classes to be missed when computing the dependencies
of the existing classes.

Change-Id: I7285ff67e016ce5d73a8550501f49acc73cfadfa
(cherry-picked from 6f9baea47757fef4745de434e09bd552fddc1f03)
2014-04-25 18:53:38 -07:00
Deepanshu Gupta
d4f0073f48 Remove references to java package class Objects. [DO NOT MERGE]
Remove references to Java 7 class java.util.Objects and replace it with
a new class that can be loaded on Java 6.

Change-Id: Ibbd9b20b8bc89e247f1d0c48d743d06d1a4f0704
(cherry-picked from commit 45f5cd49fa898a59484edfd8e291dbe10df82db2)
2014-04-25 18:49:40 -07:00