872 Commits

Author SHA1 Message Date
Deepanshu Gupta
44cc867f7d am 9a1f13a4: am afc623e3: am bd9e181b: Fix layout rendering for RTL locales [DO NOT MERGE]
* commit '9a1f13a47bfe29e344efc05f0ecabbfcb5671e06':
  Fix layout rendering for RTL locales [DO NOT MERGE]
2014-05-02 19:19:42 +00:00
Deepanshu Gupta
1197605876 am b80247d3: am 811b331a: am d4875e19: Add orientation to configuration for layoutlib. [DO NOT MERGE]
* commit 'b80247d351b88f69192260a661dbf3d4d71e9527':
  Add orientation to configuration for layoutlib. [DO NOT MERGE]
2014-05-02 19:19:39 +00:00
Deepanshu Gupta
e821d0cc54 am b27d8814: am 21cf9843: am d1084cc0: Add missing native methods. [DO NOT MERGE]
* commit 'b27d881467869539a5c8ec2510e8415912abb617':
  Add missing native methods. [DO NOT MERGE]
2014-05-02 19:19:36 +00:00
Deepanshu Gupta
bcbeaf83ca 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 c63e87d53deb24c4286036313db11719173419b3)
2014-05-02 11:46:42 -07:00
Deepanshu Gupta
5be65fda15 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 5fb41528a6192c41f7e2bb30161cc5af6061d5b8)
2014-05-02 11:46:42 -07:00
Deepanshu Gupta
ec4623d0d4 Improve text rendering and measurement. [DO NOT MERGE]
1. Fix a bug where baseline of the run was modified while rendering
resulting in crooked text in some cases.

2. Use GlyphVector.getLogicalBounds() for text measurement which is more
accurate than getVisualBounds().

3. This change also optimizes text rendering by not computing the advances
for individual glyphs when not needed.

Change-Id: I66792c4d8f50eaf29afa70bccca1e6c812a3fa28
(cherry-picked from 88301948c92fe1261cfa19383d4aaa5d5d0195ac)
2014-05-02 11:46:42 -07:00
Deepanshu Gupta
2a82a48fef Fix the measurement of text bounds. [DO NOT MERGE]
Bug: 12366230
Change-Id: I203b678363dc7b688c744503ee10216baca658a9
(cherry-picked from eb1fae940df0117deb0dc891f9f9bfeca35b1ac1)
2014-05-02 11:46:41 -07:00
Deepanshu Gupta
5bb3414d14 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 ee1187a94feb61adbfade2505b2f92418a1b1038)
2014-05-02 11:46:41 -07:00
Deepanshu Gupta
5712b5fc3f 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 9e5e993c7969ad60ff70cfdcf707247f38a705a1)
2014-05-02 11:46:41 -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
689c0dfe72 Fix NPE in layoutlib. [DO NOT MERGE]
Change-Id: I36623304d83b344ea078044001577b8005a63c02
(cherry picked from commit 80c55109b6351049498df294234dc0a75e75ec44)
2014-05-02 11:46:40 -07:00
Deepanshu Gupta
083d1562e0 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 0b7d80765c21dbd9294a0245f92a655fdd61514e)
2014-05-02 11:46:39 -07:00
Deepanshu Gupta
6335590aa8 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 81f74f4bc96ea4266cebe1b785d095558f540800)
2014-05-02 11:46:38 -07:00
Deepanshu Gupta
11ee746dc5 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 9cb5f5b5233f2331748d108d71f4b685762f32a7)
2014-05-02 11:46:38 -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
87be67f917 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 28873c1f008f4fe24441923e14f30e55d6f0967a)
2014-05-02 11:46:37 -07:00
Deepanshu Gupta
7b5d54f05b Fix ClassCastException when rendering ListView [DO NOT MERGE]
Bug: b.android.com/59300
Change-Id: Ia350adb3308daa8170bff755302760790163c811
(cherry picked from commit 54d88f7678387a6eb871ec2dccd36af4ff35b1fe)
2014-05-02 11:46:37 -07:00
Deepanshu Gupta
ce22440d4c Fix text rendering [DO NOT MERGE]
There are still some errors
1. Little vertical clippping for extra tall glyphs.
2. Breaking into scripts isn't perfect which results in incorrect layout
of text.

Change-Id: I54de3c05eca5e8affb1135c120eea24c3afe8a47
(cherry picked from commit 92a169fa2e1bab7d93089196c33c2de12f9eae82)
2014-05-02 11:46:05 -07:00
Deepanshu Gupta
bd9e181b29 Fix layout rendering for RTL locales [DO NOT MERGE]
This changeset adds the framework resources for RTL locales and mirrors
the layout if the application is RTL aware.

Use ICU to check the character orientation of the locale - right to left
or left to right. Set the layout direction on the top level layout
accordingly. Also, load the RTL resources for Nav Bar when the locale is
RTL.

Change-Id: I1ed0d516ab64120a0abca413ba678036661508f8
(cherry picked from commit eee0ea7a0b85ea6345eb7b8da5dbf17306c7339c)
2014-05-02 11:45:37 -07:00
Deepanshu Gupta
d4875e19f5 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 d97d60c0fa4613a47d591d45736299702be1cc7a)
2014-05-02 11:45:00 -07:00
Deepanshu Gupta
d25d33cdeb 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-01 20:13:06 -07:00
Deepanshu Gupta
1f5e678c08 Support actionProviderClass attribute for menus.
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
2014-05-01 16:24:24 -07:00
Deepanshu Gupta
cd50f72946 am c046c767: am c0c96012: am 4b5fa4d3: Fix class name for OverflowMenuButton [DO NOT MERGE]
* commit 'c046c76739b210d912dae38bf945d60b8d69ab11':
  Fix class name for OverflowMenuButton [DO NOT MERGE]
2014-04-30 20:38:49 +00:00
Deepanshu Gupta
c046c76739 am c0c96012: am 4b5fa4d3: Fix class name for OverflowMenuButton [DO NOT MERGE]
* commit 'c0c96012c667d1d91d8f6b763df45e566cae0eaf':
  Fix class name for OverflowMenuButton [DO NOT MERGE]
2014-04-30 20:35:04 +00:00
Deepanshu Gupta
4b5fa4d318 Fix class name for OverflowMenuButton [DO NOT MERGE]
Change-Id: Ie3e709e7aadb2193397df8befef0c55624d7e4e3
2014-04-29 19:37:09 -07:00
Deepanshu Gupta
4bf3c93068 am 92bc0753: am 8c15cd0d: am c967d8dc: Add special system view cookie to OverflowButton. [DO NOT MERGE]
* commit '92bc07534e511b9afa7edaffe867d2674c504d73':
  Add special system view cookie to OverflowButton. [DO NOT MERGE]
2014-04-30 00:41:26 +00:00
Deepanshu Gupta
92bc07534e am 8c15cd0d: am c967d8dc: Add special system view cookie to OverflowButton. [DO NOT MERGE]
* commit '8c15cd0dc1d04490b82fd7d8da7611ff3219a1f0':
  Add special system view cookie to OverflowButton. [DO NOT MERGE]
2014-04-30 00:38:35 +00:00
Deepanshu Gupta
c967d8dc62 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 674af92fd3a618695448ff88568b03390e90bc66)
2014-04-29 16:49:21 -07:00
Deepanshu Gupta
d1084cc025 Add missing native methods. [DO NOT MERGE]
Also contains fixes for native methods specific to the branch.

Change-Id: I7b34e2ec0164520efc658053a80f307791a992b1
(cherry-picked from commit: 279c00e8e0abb20f7e10577c77937c058da080bf)
2014-04-28 15:18:05 -07:00
Deepanshu Gupta
b5cdfd97a5 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-04-25 19:45:33 -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
89fdc0c556 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 bdd0ad79b9b027280bd371c7b6795b04ed89ac8f)
2014-04-25 18:50:39 -07:00
Deepanshu Gupta
674af92fd3 Add special system view cookie to OverflowButton.
Add a special view cookie to enable the IDE to identify the overflow
menu button in the Action Bar.

Change-Id: Ida3ed776afb8c9fa8af23b73d4cf6d47eef0ab87
2014-04-25 12:24:25 -07:00
Deepanshu Gupta
8f9d92c4ca am 7406e4b8: am 7947ec71: am b64732d9: Merge "Fix style warnings in RenderSessionImpl [DO NOT MERGE]" into klp-dev
* commit '7406e4b8102ffd71affd55a9f453c0ecce13a097':
  Fix style warnings in RenderSessionImpl [DO NOT MERGE]
2014-04-24 01:36:22 +00:00
Deepanshu Gupta
5dee1a093a am e17ed922: am 126f4057: am 5ba2f230: Add view cookies for action bar menus. [DO NOT MERGE]
* commit 'e17ed922001cf70c48969eb7b10ee2e2557b41f9':
  Add view cookies for action bar menus. [DO NOT MERGE]
2014-04-24 01:36:14 +00:00
Deepanshu Gupta
7406e4b810 am 7947ec71: am b64732d9: Merge "Fix style warnings in RenderSessionImpl [DO NOT MERGE]" into klp-dev
* commit '7947ec715d8b4a0c82135553abb4947b61bf802b':
  Fix style warnings in RenderSessionImpl [DO NOT MERGE]
2014-04-24 01:31:24 +00:00
Deepanshu Gupta
e17ed92200 am 126f4057: am 5ba2f230: Add view cookies for action bar menus. [DO NOT MERGE]
* commit '126f4057a06756fbb1c194b5d9d40f9f922d14ee':
  Add view cookies for action bar menus. [DO NOT MERGE]
2014-04-24 01:31:15 +00:00
Deepanshu Gupta
7d3ae4f17d Bug fix in layoutlib
Renaming a method wasn't completed properly.
The bug was introduced in the following change:
Idcfc263a8ebe0a4f25afa3a1eb085fa628fd03ca
(1001961f904bac5294aaf73a47c2497aa764bf7f)

Change-Id: I698437b428d696c656e2268ded654a612a3e0c80
2014-04-23 18:07:07 -07:00
Deepanshu Gupta
1ea1b21acd Fix style warnings in RenderSessionImpl [DO NOT MERGE]
Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit fbfeb1a90b6f8f3966c60a69d50ce8f608d9d861)
2014-04-23 18:04:26 -07:00
Deepanshu Gupta
5ba2f230fa 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 1001961f904bac5294aaf73a47c2497aa764bf7f)
2014-04-23 18:04:21 -07:00
Deepanshu Gupta
fbfeb1a90b Fix style warnings in RenderSessionImpl
Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
2014-04-23 13:07:44 -07:00
Deepanshu Gupta
1001961f90 Add view cookies for action bar menus.
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.

Change-Id: Idcfc263a8ebe0a4f25afa3a1eb085fa628fd03ca
2014-04-23 12:27:30 -07:00
Deepanshu Gupta
76bc2bb4c7 Merge "Update Matrix_Delegate native methods." 2014-04-22 23:47:58 +00:00
Deepanshu Gupta
6416152f7e am be06a418: am cf5c3fc7: am 53b7df19: Merge "Add missing ICU_Delegate methods."
* commit 'be06a4182b9ff44a276f56d04b907672ee9e149a':
  Add missing ICU_Delegate methods.
2014-04-22 23:19:13 +00:00
Deepanshu Gupta
be06a4182b am cf5c3fc7: am 53b7df19: Merge "Add missing ICU_Delegate methods."
* commit 'cf5c3fc70d4dcd5dc3c6054d0f7415ded0070e4f':
  Add missing ICU_Delegate methods.
2014-04-22 23:15:05 +00:00
Deepanshu Gupta
e2b67777ad Add missing ICU_Delegate methods.
Update the ICU_Delegate to add methods originally added in
I5de58be7e8a701f2c40182ea54bceff85ec1aad2

Change-Id: I536834fe76cbc7dae05580182fee1bea956e3e77
2014-04-21 14:33:33 -07:00
Deepanshu Gupta
385c6b3b6c Update Matrix_Delegate native methods.
Update the Matrix_Delegate native methods in layoutlib. The original
change is I5cdcea827ebff587df0bbddc0965e3e0fbf48002.

Change-Id: I2c94741fdaeb0c2279caefee0188f432267bb37d
2014-04-21 14:28:56 -07:00
Deepanshu Gupta
311efc146c Merge "Add DisplayManager service to BridgeContext" 2014-04-18 23:11:57 +00:00
Deepanshu Gupta
664d6f1fe4 Add DisplayManager service to BridgeContext
ViewRoot now holds a reference to the DisplayManager. The change updates
the BridgeContext to provide the DisplayManager instance.

Change-Id: I4a5f00eda337939c72bad47b0ca6a7403454228d
2014-04-18 16:03:11 -07:00