2231 Commits

Author SHA1 Message Date
Deepanshu Gupta
d915dcac36 Layoutlib tests now check methods return value [DO NOT MERGE]
The change is a cherry-pick from klp-dev.

The change also fixes the errors found by fixing the tests.

Change-Id: I87cef323c4eaee4e9f60475f01156b276593fa50
(cherry-picked from commit 2bd65db15fa6a265ccc4023161611088bc791b4e)
2014-05-06 14:02:47 -07:00
Deepanshu Gupta
877ae53586 Set default text style in layoutlib as NORMAL [DO NOT MERGE]
If a style doesn't specify text style (normal/bold/italic/bold-italic)
then default to normal instead of throwing an error.

Bug: http://b.android.com/61358
Change-Id: I0138c73807a5ff6e4d938a99ece3044333110aa1
(cherry-picked from bcbeaf83ca75e4a819377938fdf3ec1e07fa30a7)
2014-05-06 14:02:46 -07:00
Deepanshu Gupta
669792b303 Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
For these font families, text was always rendered as italic. This
changeset fixes the issue.

Bug: http://b.android.com/57221
Change-Id: Ic8a299bd1e555f5bb914cd3d2fe72917ec7f471a
(cherry-picked from 5be65fda15c6f66067da3cc623811427e9d541e4)
2014-05-06 14:02:46 -07:00
Deepanshu Gupta
cda89ca025 Fix a bug in Nine Patch library. [DO NOT MERGE]
The nine patches were not drawn correctly if they were not positioned at
the top left corner of the canvas.

Bug: http://b.android.com/29959
Change-Id: Icfed522ea07322a3ee9f3955067d3da26c4b0b5b
(cherry-picked from 5bb3414d148f1309dade9333fe9b89c8d1c2f308)
2014-05-06 14:02:46 -07:00
Deepanshu Gupta
a2b34c96f1 Optimize layout rendering in layoutlib [DO NOT MERGE]
The height of a layout should be zero if it is assigned a layout_weight.
This way, the layout is measured only once and prevents spurious errors.

Bug: https://code.google.com/p/android/issues/detail?id=58398
Change-Id: If49a7480e5eb82cb86780e00f2f5b65ee053fc2a
(cherry-picked from 5712b5fc3fec0dc376e84f660f2fe0d1102c0cbb)
2014-05-06 14:02:45 -07:00
Deepanshu Gupta
e183855c1e Add methods for Time_Delegate [DO NOT MERGE]
Bug: http://b.android.com/65359
Change-Id: I7c2d09286d6bcd9899444aaa5a4a5a342e39d923
(cherry-picked from 02cde9ceeb4c052ee273a5d809816dfd355ebb56)
2014-05-06 14:02:45 -07:00
Deepanshu Gupta
e5a2347bc6 Fix NPE in layoutlib. [DO NOT MERGE]
Change-Id: I36623304d83b344ea078044001577b8005a63c02
(cherry picked from commit 689c0dfe72a57c0555560012cbc6806375e7d4b7)
2014-05-06 14:02:45 -07:00
Deepanshu Gupta
30505abeb6 Fix text size in Fake Action Bar. [DO NOT MERGE]
The density multiplier was being applied twice to the title text in
the fake action bar.

Bug: 11436018
Change-Id: Id74c11037cb43d01f6cd79126623c84edfc37aaf
(cherry-picked from 083d1562e00631630b5594462ce4a867a3508d8d)
2014-05-06 14:02:44 -07:00
Deepanshu Gupta
5a7b3b65b6 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. This also
includes the following change that includes some changes that the
original cherrypick missed.
Change-Id: I76c87c74ee088778b37d1a7a7d531e0fde5c758f
commit: 1ed75bde09275c9f2bd1f81830e381ea864ac7f5

Change-Id: Iac5b272652e2780c9bb72d19f415d150948ca589
(cherry picked from 80c668f2a076e91d887dbf77776cd503ff88b0b4)
2014-05-06 13:55:56 -07:00
Elliott Hughes
f3e7945c79 am 86768034: am b593ad60: am f1f28d1d: Merge "Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice."
* commit '867680342e12af59a26756f30cf817a131724943':
  Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice.
2014-05-06 02:34:40 +00:00
Elliott Hughes
867680342e am b593ad60: am f1f28d1d: Merge "Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice."
* commit 'b593ad60682a6f8c945c4c2ffc3d278df3f6e360':
  Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice.
2014-05-06 02:31:03 +00:00
Elliott Hughes
b593ad6068 am f1f28d1d: Merge "Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice."
* commit 'f1f28d1d86aea6dd1419e94aadf051e433914680':
  Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice.
2014-05-06 02:27:44 +00:00
Deepanshu Gupta
4b5da86d04 Fix DatePicker and Calendar widget in layoutlib. [DO NOT MERGE]
Issue: https://code.google.com/p/android/issues/detail?id=59732

Change-Id: I281b3fdad88c591281a3645592c84f3e2cb61d09
(cherry picked from commit 6335590aa8997944cc7fb358a315dbb9b789f87f)
2014-05-05 18:42:28 -07:00
Deepanshu Gupta
5c166c9c04 Layoutlib: Update the wifi icon in the status bar. [DO NOT MERGE]
Issue: https://code.google.com/p/android/issues/detail?id=60993

Change-Id: Ia43ed40b42c79f67dcd5809b827d4fecbc823c25
(cherry picked from commit 11ee746dc5e77f4f33aac45ac9e344444223012d)
2014-05-05 18:33:08 -07: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
64dc038012 Fix layoutlib [DO NOT MERGE]
Fix a NPE.

The cherry-pick differs slightly from the original to remove changes not
relevant to the current branch.

Bug: 11140701
Change-Id: Id92fc5359acf6dde1bcdbc781aaf637fdb6eecbf
(cherry-picked from 87be67f91719234cbd381ff0242b5efc8b6aa257)
2014-05-05 18:23:15 -07:00
Deepanshu Gupta
a59c27dd66 Fix ClassCastException when rendering ListView [DO NOT MERGE]
Bug: b.android.com/59300
Change-Id: Ia350adb3308daa8170bff755302760790163c811
(cherry picked from commit 7b5d54f05be61a7ab40021644a91c466e2897627)
2014-05-05 18:21:41 -07:00
Deepanshu Gupta
8a39c3afb2 Add orientation to configuration for layoutlib. [DO NOT MERGE]
Update the configuration with the device orientation before rendering.

Change-Id: Icd40901204fd13f90b18353e53a15e25e5b2176c
(cherry picked from commit d4875e19f5b7c69226783b0a6590831466159f84)
2014-05-05 18:17:13 -07:00
Igor Viarheichyk
47843df11f Skip resource files for locales en-XA and ar-XB
during packaging if pseudolocalization was done automatically.
This prevents attemts to add same resource twice.

Change-Id: I51e17f961ac44047bf466ce4aa0d4d17f4ded0d6
2014-05-05 18:13:41 -07:00
Adam Lesinski
ce8083fc51 am 0472fb58: am 34dd2cdd: am f2d2c871: AAPT should not process XML that failed to compile
* commit '0472fb5882cfe55577a169a0f0ff4b8920a839b0':
  AAPT should not process XML that failed to compile
2014-05-05 21:19:04 +00:00
Adam Lesinski
0472fb5882 am 34dd2cdd: am f2d2c871: AAPT should not process XML that failed to compile
* commit '34dd2cdd4142ca8c7463b9f831429b4366fa222a':
  AAPT should not process XML that failed to compile
2014-05-05 21:13:28 +00:00
Adam Lesinski
34dd2cdd41 am f2d2c871: AAPT should not process XML that failed to compile
* commit 'f2d2c871813656012420faa89080d8e3cda1f308':
  AAPT should not process XML that failed to compile
2014-05-05 21:09:49 +00:00
Adam Lesinski
f2d2c87181 AAPT should not process XML that failed to compile
AAPT would attempt to warn if an unprefixed 'id'
attribute was used in an XML resource file even
if that XML file failed to compile. The result
was undefined behaviour, including crashing the
process.

Change-Id: I1a9464ec937760e8d38bbe1af8d1b5d6b2c105a2
2014-05-05 12:01:21 -07:00
Deepanshu Gupta
099f40a950 Support actionProviderClass attribute for menus [DO NOT MERGE]
The change adds support for view cookies for actionProviderClasses (for
example, ShareActionProvider) in the action bar menus.

This also provides a more robust search for the overflowMenuButton.

Change-Id: I316c8b9a69e2e337b41ba0fe4e61af9fe850f750
(cherry picked from commit 7f56beb8403b597a676faf12643fef585a31007e)
2014-05-04 13:30:50 -07:00
Deepanshu Gupta
60b52ee929 Fix class name for OverflowMenuButton [DO NOT MERGE]
Change-Id: Ie3e709e7aadb2193397df8befef0c55624d7e4e3
(cherry picked from commit f61bd0020642cf0868486d307f2e68c8c02d6102)
2014-05-04 13:30:33 -07:00
Deepanshu Gupta
7c6f6481f4 Add special system view cookie to OverflowButton. [DO NOT MERGE]
Add a special view cookie to enable the IDE to identify the overflow
menu button in the Action Bar.

Change-Id: Ida3ed776afb8c9fa8af23b73d4cf6d47eef0ab87
(cherry picked from commit d558ebdb433af498a87e25673f7dd828a0e7439a)
2014-05-04 13:30:11 -07:00
Deepanshu Gupta
22de7c4c3d Fix style warnings in RenderSessionImpl [DO NOT MERGE]
Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit a98121ef5251b5ebdb8c1b0b6780d570844284b2)
2014-05-04 13:29:51 -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
7f56beb840 Support actionProviderClass attribute for menus [DO NOT MERGE]
The change adds support for view cookies for actionProviderClasses (for
example, ShareActionProvider) in the action bar menus.

This also provides a more robust search for the overflowMenuButton.

Change-Id: I316c8b9a69e2e337b41ba0fe4e61af9fe850f750
(cherry picked from commit 28fa661f79e18fc9fc46bf112edded9c0d07696f)
2014-05-02 18:01:11 -07:00
Deepanshu Gupta
f61bd00206 Fix class name for OverflowMenuButton [DO NOT MERGE]
Change-Id: Ie3e709e7aadb2193397df8befef0c55624d7e4e3
(cherry picked from commit 4b5fa4d318e7efaffdc678e0cb8953ffc78c2b1e)
2014-05-02 17:52:04 -07:00
Deepanshu Gupta
d558ebdb43 Add special system view cookie to OverflowButton. [DO NOT MERGE]
Add a special view cookie to enable the IDE to identify the overflow
menu button in the Action Bar.

Change-Id: Ida3ed776afb8c9fa8af23b73d4cf6d47eef0ab87
(cherry picked from commit c967d8dc62c429ecf3e27bf3714a953636e75cbf)
2014-05-02 17:43:25 -07:00
Deepanshu Gupta
a98121ef52 Fix style warnings in RenderSessionImpl [DO NOT MERGE]
Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit fbfeb1a90b6f8f3966c60a69d50ce8f608d9d861)
2014-05-02 17:34:00 -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
56759be896 Overflow menu popup for Action Bar in Layoutlib [DO NOT MERGE]
In addition to the cherrypicked changes, appropriate changes due to
changes to com.android.internal.widget.ActionBarView are made.

The icon used in the Action Bar may not always be the right one due to
the above resolution.

Change-Id: Ib7cc314079099c010f7d53849e204db36c410357
(cherry-picked from commit 1b87390c9426c4bc9119829e9375d712dfde11c3)
2014-05-02 16:23:14 -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
cc5340bc63 Add missing dependency in layoutlib build file [DO NOT MERGE]
Add missing dependency on built_ext_data

Change-Id: I4e7cca7f6cbc7f5b7416ac9b85a9aec01e61ecd4
(cherry-picked from commit b85d30a2c88b6a23e251347b14a75456c4daeca9)
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
2bd65db15f Layoutlib tests now check methods return value [DO NOT MERGE]
The change is a cherry-pick from klp-dev.

The change also fixes the errors found by fixing the tests.

Change-Id: I87cef323c4eaee4e9f60475f01156b276593fa50
(cherry-picked from commit 89fdc0c556cf0fe2562fb8f0476e03cd51045164)
2014-05-02 14:19:47 -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
8ad4b8b1fe am 9932e589: am 9e2dadae: am bcbeaf83: Set default text style in layoutlib as NORMAL [DO NOT MERGE]
* commit '9932e589b0f604b1c553e043cd6a60adbc1b7055':
  Set default text style in layoutlib as NORMAL [DO NOT MERGE]
2014-05-02 19:31:56 +00:00
Deepanshu Gupta
826a215c8b am 320f1126: am cf3f108e: am 5be65fda: Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
* commit '320f1126a35fae6e5c2f72f75db5b38bdb207a76':
  Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
2014-05-02 19:31:53 +00:00
Deepanshu Gupta
0a37981cad am 1b28d8d4: am d642de58: am ec4623d0: Improve text rendering and measurement. [DO NOT MERGE]
* commit '1b28d8d4a0b4193b23ed4647a18c4242beb74038':
  Improve text rendering and measurement. [DO NOT MERGE]
2014-05-02 19:31:50 +00:00
Deepanshu Gupta
f4b35c6a83 am ef822b3f: am 62a4a1f9: am 2a82a48f: Fix the measurement of text bounds. [DO NOT MERGE]
* commit 'ef822b3f13204d084196c1124d22a153868b017f':
  Fix the measurement of text bounds. [DO NOT MERGE]
2014-05-02 19:31:48 +00:00
Deepanshu Gupta
e0537c1d49 am c7f8e64c: am 1830a58f: am 5bb3414d: Fix a bug in Nine Patch library. [DO NOT MERGE]
* commit 'c7f8e64cb9b6ff81b2188a31c3d804b763c63fe8':
  Fix a bug in Nine Patch library. [DO NOT MERGE]
2014-05-02 19:31:44 +00:00
Deepanshu Gupta
5e6a299080 am 4d887ec3: am bcd50a7c: am 5712b5fc: Optimize layout rendering in layoutlib [DO NOT MERGE]
* commit '4d887ec388da13c6b65455416a0b829d81e0160a':
  Optimize layout rendering in layoutlib [DO NOT MERGE]
2014-05-02 19:31:42 +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
88a12f5744 am 43034b54: am 62591cff: am 689c0dfe: Fix NPE in layoutlib. [DO NOT MERGE]
* commit '43034b541cecd924b4b79a5caff850a53516ec26':
  Fix NPE in layoutlib. [DO NOT MERGE]
2014-05-02 19:31:18 +00:00