• Home
  • History
  • Annotate
  • only in /frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/
History log of /frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
790e5f6c1cab43fb377d86d3c9189a509b28b217 24-May-2016 Diego Perez <diegoperez@google.com> Workaround to display menus for AppCompat themes

Layoutlib currently does not implement menus for the support Toolbar.
When it detects that an AppCompat theme is being used, it will try to
use by default the support Toolbar which breaks the display of menus.
This works around the problem by forcing layoutlib
to use the framework toolbar in menu previews (regular activities
won't display the menu if they use AppCompat).

Bug: http://b.android.com/210946
Change-Id: Ic1d162c6d74119ef42895776c3bc3851a9549120
ayout.java
5ca21e4ceca42be633031809b8ee43fd8688389b 10-May-2016 Diego Perez <diegoperez@google.com> Fix VectorDrawable_Delegate and DrawerLayout

Modify the nDraw call that has been changed in the framework to return
an int with the number of pixels allocated.
Modify the animation initialization render call to use the actual
measured size (instead of 0,0) so the DrawerLayout is setup
correctly.

Change-Id: I198de05206382c6489056f7c3d9a1d328864321c
enderSessionImpl.java
39e540caffca2584aa6c4cb74ce42dceb24a93f7 12-Apr-2016 Diego Perez <diegoperez@google.com> Separate measure so it can only run inflate if needed

This allows to only do inflate + measure and not to render.

Change-Id: I4be08513728b656f699e9115e14cf618d95b538a
enderSessionImpl.java
eaf1853b98d7bf2c3d693ad702050968ef0a404c 14-Apr-2016 Deepanshu Gupta <deepanshu@google.com> Return complete properties map instead of per view

Change-Id: Ib7c71606d1bf43bbaa80f5601a8508d7aa49d953
enderAction.java
enderSessionImpl.java
79c59fe4a8544bdda5c56efecf9c2bc72f2f0e4e 12-Apr-2016 Deepanshu Gupta <deepanshu@google.com> Add post resolve property values

Change-Id: Ia86b7dfc479cc5313cce36b6b3066fbb1d00c292
enderAction.java
enderSessionImpl.java
39f1311b545f1f8732ee3a8b565018dcd0da7323 06-Apr-2016 Deepanshu Gupta <deepanshu@google.com> Merge "Clear ThreadLocal storage from Choreographer" into nyc-dev
61ccc9198ab09363edbf500d7669dbcfafc5fa28 06-Apr-2016 Deepanshu Gupta <deepanshu@google.com> Clear ThreadLocal storage from Choreographer

Change-Id: I5abb5c68a635e7808b0a036ba4d9971cd0139aa3
enderSessionImpl.java
2605f91f705fbf51800c6fde8ee8cd5f199447b4 04-Apr-2016 Diego Perez <diegoperez@google.com> Separate inflate from render step

Up until now, createSession will always do a first render. With the new
embedded layoutlib we might want to actually call objects from the
inflated view before doing a render or even do it between renders.
This allows to avoid the first initial render unless needed.

This CL also fixes a bug that would only happen when multiple render
calls are issued. When scrolling, use scrollTo since we likely want
absolute positions, not relative.

Change-Id: I4b1d8388d7218a8de33e25cd546fd965fcb07dc7
enderSessionImpl.java
fc970ab65ad8c860dd0654d59b70bbe271f95784 26-Feb-2016 Diego Perez <diegoperez@google.com> Implement VirtualRefBasePtr native methods

The VirtualRefBasePtr is used to track the usage of native objects from
the java side by reference counting. Implementing the class delegate to
make sure we dispose the objects correctly.

Change-Id: I3dd4717944b0dbe79f30e49b3083bf65c6e5276d
elegateManager.java
ceb1ab1d2a71c6d4e0cccf110a198ff83cb97e5a 24-Mar-2016 Deepanshu Gupta <deepanshu@google.com> Add tests for getResource*Name()

Change-Id: I02170b2b68c76f817aa0771a5333abf2aee456c0
enderAction.java
cd6e47e4455cec8daa4570ac8073d93bd567d139 21-Mar-2016 Deepanshu Gupta <deepanshu@google.com> Add guard around getXmlFileParser() call

Prevents the need to update the LayoutLib API level.

Bug: http://b.android.com/202942
Change-Id: I507239148ab8d6d45406624dba569c8b7197f979
esourceHelper.java
d15459197f71f8cc940e2b057b399117df282f2c 04-Mar-2016 Diego Perez <diegoperez@google.com> Account for parent scroll position

When calculating the ViewInfo bounding box, account for the parent
scroll position.
Also make renderAndVerify return a RenderResult to verify some data
about the result layout.

Change-Id: I965e393c49b5030c80083daf5e058fa31400ce93
enderSessionImpl.java
566b303365078fac9a454f1595add19e02631db3 01-Mar-2016 Diego Perez <diegoperez@google.com> Add support for GradientColor in layoutlib

Change-Id: Ia9a55a9e00d7ddb5263f3dbe46b5da8dde457526
esourceHelper.java
5d1013cf13e59b7f8dc8f16b5811cb29982e0ef3 23-Feb-2016 Diego Perez <diegoperez@google.com> Implement native methods in VectorDrawable

Most of the VectorDrawable implementation has been moved to native code.
This CL implements most of the required functionality that existed in
Marshmallow.

Change-Id: I009bcd5c166f2bfa0795d2718fabab4a549eba9f
enderSessionImpl.java
f5650cf3a3a1a8d6ced9fc7b0f399689c9adc1b8 01-Feb-2016 Diego Perez <diegoperez@google.com> Fix Canvas memory leak

Every RenderSession would call the AttachInfo.setAttachInfo but wouldn't
issue a View.dispatchDetachedFromWindow.
This caused some Canvas to be slowly leaked in the DelegateManager in
every session.

Change-Id: Iec418a86f5c5e55c2a2860ef945268c51c0e8173
enderSessionImpl.java
4f2103631a44303257e3adbe89fa2a6854841bbb 19-Feb-2016 Diego Perez <diegoperez@google.com> Merge "Revert "Fix Canvas memory leak"" into mnc-ub-dev
am: 44f92b00d1

* commit '44f92b00d1a060773625de5884fc86e7218e2dd5':
Revert "Fix Canvas memory leak"
44f92b00d1a060773625de5884fc86e7218e2dd5 19-Feb-2016 Diego Perez <diegoperez@google.com> Merge "Revert "Fix Canvas memory leak"" into mnc-ub-dev
cf935728897e9f208e250d3bb57296c84cfa0ef9 19-Feb-2016 Diego Perez <diegoperez@google.com> Revert "Fix Canvas memory leak"

This reverts commit e82bd72b6e7ab3135d3b28fc2c2694d08af45c3d.

Change-Id: Ie9ef25b17d5f725d5054c039992a8cd2912868a6
enderSessionImpl.java
1d3c41e563c30d85d5524df598f4bd6e6a226362 19-Feb-2016 Diego Perez <diegoperez@google.com> Merge "Fix Canvas memory leak" into mnc-ub-dev
am: bad0e07ee9

* commit 'bad0e07ee9163d6b0f0bf73ad591ff6e453199ef':
Fix Canvas memory leak
bad0e07ee9163d6b0f0bf73ad591ff6e453199ef 19-Feb-2016 Diego Perez <diegoperez@google.com> Merge "Fix Canvas memory leak" into mnc-ub-dev
e82bd72b6e7ab3135d3b28fc2c2694d08af45c3d 01-Feb-2016 Diego Perez <diegoperez@google.com> Fix Canvas memory leak

Every RenderSession would call the AttachInfo.setAttachInfo but wouldn't
issue a View.dispatchDetachedFromWindow.
This caused some Canvas to be slowly leaked in the DelegateManager in
every session.

Change-Id: I0322767e5fffc6053ce1be852dd8ca904dfaa137
enderSessionImpl.java
491523d52cd8368ef9a92e95fb3e9332bf86a996 07-Oct-2015 Deepanshu Gupta <deepanshu@google.com> LayoutLib fixes for N

Moves LayoutLib to Java 8 - YAY!
Fix delegates

Change-Id: I098996e43e330e995d33f12df1c16355bbc02f0f
inding/AdapterHelper.java
aa9c9fb29e0630f252fb60e1972d333bbc54d70d 17-Feb-2016 Diego Perez <diegoperez@google.com> Replace SimpleDateFormat implementation

This will process all the classes and replace all the uses of
java.text.DateFormat and java.text.SimpleDateFormat with the
android.icu.text. package implementations. The original ones do not
match the Android platform behaviour.

Change-Id: Id55f103c21117a8d6403bf2124b6c1a0e1fb2f71
enderAction.java
08df538482f00611133a0b3aba64e8fed663afc3 01-Feb-2016 Deepanshu Gupta <deepanshu@google.com> Remove obsolete try catch am: ebdcc80ac2
am: 29e8071d2e

* commit '29e8071d2e9f3a8171624fd63b849f5c14360b21':
Remove obsolete try catch
ebdcc80ac26ae51ba27d9469a501a6242256aa50 01-Feb-2016 Deepanshu Gupta <deepanshu@google.com> Remove obsolete try catch

The try catch was to prevent crashing on preview releases of Android
Studio. We don't support them anymore.

Change-Id: I8e33cae98117c0034aea1b56903b623fcb64435e
enderAction.java
8b4a6981fdd7849a57de2f56203cfd81e9eb6e99 15-Jan-2016 Tor Norbye <tnorbye@google.com> Minor fix to wrong error message

Change-Id: I3d34c90d37d35d0649a6ef8a73ca0d9320f975dd
inding/AdapterHelper.java
48748c5d5b84920c95156ef711ccffe852b6b7ff 11-Dec-2015 Jerome Gaillard <jgaillard@google.com> Use RenderDrawable to render mipmaps am: 4b0fe7f14b
am: e298bcf755

* commit 'e298bcf7552d95475ab3ca9195e12bc14768fdb5':
Use RenderDrawable to render mipmaps
4b0fe7f14bb36769ef30c59c407bd6ed5b3d5cf7 11-Dec-2015 Jerome Gaillard <jgaillard@google.com> Use RenderDrawable to render mipmaps

Bug: http://b.android.com/179714
Change-Id: If05e71b33ee3a95590eb892f4fffbff4cfca1867
enderDrawable.java
7c4420bd04f8f56f6044f88e34616d8c5d96c7e9 02-Dec-2015 Deepanshu Gupta <deepanshu@google.com> Revert "Revert "Add support for Choreographer animations""

This reverts commit 8390b2ac85765e768d4b685077a96e6395d208b4.

The build break should now be fixed by
cbb1ba7f493116882b79578ec68646366f29cde4

Change-Id: I9bf21cc6dbdb5d515a665384dc6dfa464c3e6e2e
enderSessionImpl.java
8390b2ac85765e768d4b685077a96e6395d208b4 02-Dec-2015 Diego Perez <diegoperez@google.com> Revert "Add support for Choreographer animations"

This reverts commit 29ed07524ce0fc2e5950f5340d306247145d0efa.
enderSessionImpl.java
2ee825f507bec9c01667787ce11ddb5d8786d863 02-Dec-2015 Diego Perez <diegoperez@google.com> resolve merge conflicts of 956cad8870 to master.

Change-Id: Iebad149b2768bcd7a52ee2c7c8c260a9279d1742
29ed07524ce0fc2e5950f5340d306247145d0efa 14-Oct-2015 Diego Perez <diegoperez@google.com> Add support for Choreographer animations

First step to add support for Choreographer based animations. The
Choreographer_Delegate avoid using a handler so the animation callbacks
can be called on-demand (by using doFrame). This allows things like
frame by frame animation or selecting a specific frame, and doesn't need
a separate thread to run.

The CL also changes the System and SystemClock implementations to allow
to set specific times. Because animations heavily rely on the system
time, this allows controlling it. It can also be useful to ensure that
the rendering produces a deterministic result when using controls like
the Calendar widget.

Change-Id: Iff221d2698a82075cafbb60f341be01741f7aa13
enderSessionImpl.java
ae03bc0be3357b4a11861f211d2c1d3a3a4e52d8 18-Nov-2015 Deepanshu Gupta <deepanshu@google.com> Revert "LayoutLib: Fix true transparency in status bar." am: 4ea74d2960
am: 377cc4887d

* commit '377cc4887d3557377f63bfe9d179623985c9484e':
Revert "LayoutLib: Fix true transparency in status bar."
4ea74d2960688db6aa13452765dd5f2d07a40189 17-Nov-2015 Deepanshu Gupta <deepanshu@google.com> Revert "LayoutLib: Fix true transparency in status bar."

This reverts commit 4eb298a941c3f465944b63f1a06518e911681c89.

Even though this is techinically closer to what the framework does, the
fix is not complete. As a result, it looks worse when using AppCompat
themes. Revert the change for the release.

Change-Id: I67c1002ea17dee7234d78e2d13aab876467bd70f
enderSessionImpl.java
2b23bc32cc17082edb41c99f3d97e208ce521bec 05-Nov-2015 Deepanshu Gupta <deepanshu@google.com> Merge "Fix Switch colors" into mnc-ub-dev am: 71093465ab
am: ceb2b54909

* commit 'ceb2b549095b5f9a70baef6a0a847b453735f97a':
Fix Switch colors
c9b8f95c99688c71184d90f53dcf90e52816d02f 05-Nov-2015 Deepanshu Gupta <deepanshu@google.com> Fix Switch colors

The conversion of the PorterDuff mode from int to enum was incorrect
resulting in the wrong PorterDuff Mode being used.

Change-Id: I7607d505b6e4382e6101869971154f6a77db279c
orterDuffUtility.java
0cdfc4d273061dcc7e10a8cd403ea08a536e5063 01-Oct-2015 Deepanshu Gupta <deepanshu@google.com> am 21af84d3: am 7a9f771f: Merge "Don\'t break error string (easier grepping)" into mnc-ub-dev

* commit '21af84d3e4bf82e9dd8b5087b60630f29668bda3':
Don't break error string (easier grepping)
1bd276f6f7ddce7959dc2e9e6f480d9be1e26fef 30-Sep-2015 Deepanshu Gupta <deepanshu@google.com> Don't break error string (easier grepping)

Change-Id: If52097ba90481644707dd0323ec63ca3ddf0986b
ayoutParserWrapper.java
cd4b26c8a9fb629efc8d2e7b907537c549eeef72 30-Sep-2015 Deepanshu Gupta <deepanshu@google.com> am 3dde4493: am 4e27221d: Merge "Support databinding in listitem layouts." into mnc-ub-dev

* commit '3dde44935df567f840de2600a3e408f9ba7c7b1f':
Support databinding in listitem layouts.
e91096c03dda225240b1487f019bf3d082854587 29-Sep-2015 Deepanshu Gupta <deepanshu@google.com> Support databinding in listitem layouts.

Add a wrapper around the PullParser to support stripping out databinding
parts.

Bug: http://b.android.com/187428
Change-Id: I88080d8f4108cb5ae27a137ad20c5dd7d516f3ea
ayoutParserWrapper.java
arserFactory.java
184427444b335dc2fd67a8df4147c6d8a18dbf4d 22-Sep-2015 Diego Perez <diegoperez@google.com> am 36152328: am 0e766de7: Avoid calling scrollBy(0,0) on render

* commit '361523281c88a7e453e0eef961ed7f16a55785a5':
Avoid calling scrollBy(0,0) on render
0e766de7c52d7e375e04676c93a872cb2d6eea63 22-Sep-2015 Diego Perez <diegoperez@google.com> Avoid calling scrollBy(0,0) on render

Usually scrollBy(0, 0) won't have any effect but when called on the
NumberPicker but, in some cases, it seems to cause an endless loop.
When called from layoutlib, this will hold the read lock causing all
operations trying to acquire the write lock to block forever.

Bug: http://b.android.com/182506
Change-Id: Ib25427d3f32d804d1c481d979795eee71fbdbc6d
enderSessionImpl.java
c81612250136b60e37674d88785265f99440e402 28-Aug-2015 Deepanshu Gupta <deepanshu@google.com> Merge "Revert "LayoutLib: Switch SimpleDateFormat to icu.""
4eb298a941c3f465944b63f1a06518e911681c89 22-Aug-2015 Deepanshu Gupta <deepanshu@google.com> LayoutLib: Fix true transparency in status bar.

Change-Id: Ieedf23cde9ab3e36c77501d30cc7e808e66a4782
enderSessionImpl.java
7d85b5435d01f8d4856a718d655e30fb5a703560 11-Aug-2015 Diego Perez <diegoperez@google.com> Merge "Make DelegateManager thread safe" into mnc-dev
847b0d3ad22a47e0bca3d8bc8168fea7a0ba2f80 07-Aug-2015 Deepanshu Gupta <deepanshu@google.com> Revert "LayoutLib: Switch SimpleDateFormat to icu."

This reverts commit b556decf75b2b084e1aed54ac7fa23a141eedb7f.

This is no longer needed as the SimpleDateFormat has been switched in
the framework. Also, the revert leaves the change to intellij inspection
profiles as is, because that change was independent of the main issue.

Change-Id: I6f4d7d9ddc10262b087ad6a2604fa50562fac043
enderAction.java
511e48728a4b8f8736fcb2ea28dd1ab7cc699972 06-Aug-2015 Diego Perez <diegoperez@google.com> Make DelegateManager thread safe

We have been seeing crashes on the Theme editor related to an assertion
on getDelegate when the object does not exist
(http://b.android.com/181951).
When debugging, the crash was happening without seeing a previous call
to removeJavaReference. This seems to completely remove that crash.
Since the DelegateManager can be called at least from two threads
(main thread and the finalizer), it should be thread safe.

Bug: http://b.android.com/181951
Change-Id: I1b28f863ff198f8592f170a98f9de391b2ac3ea2
elegateManager.java
b556decf75b2b084e1aed54ac7fa23a141eedb7f 07-Aug-2015 Deepanshu Gupta <deepanshu@google.com> LayoutLib: Switch SimpleDateFormat to icu.

Use ICU's implementation of SimpleDateFormat in LayoutLib. The format
patterns used are not supported by java.text.SimpleDateFormat.

The change required adding a mechanism for promoting visibility of
fields in the framework in the create tool.
TODO: Add additional tests in the create tool for this new
functionality.

Change-Id: Id0f4be41f9731c42a28919c32cc5ef271a656982
enderAction.java
82c7fdb1f6346862de373c95c618e370f81d8df6 05-Aug-2015 Deepanshu Gupta <deepanshu@google.com> Replace Locale.getDefault with custom impl.

In LayoutLib the default locale should always be the locale set the
rendering params. This change replaces all calls to Locale.getDefault in
the framework with calls to AndroidLocale.getDefault() which tries to
find the locale from the current context, but falls back to the original
call.

Change-Id: I496b35dcfc17fd61fedee21c7495541ab870b1fc
enderAction.java
a9090705efcc44f015486944e5aeb926173a7968 04-Aug-2015 Deepanshu Gupta <deepanshu@google.com> Fix layout mirroring.

Change-Id: I7db398aa2d11dac1210e84922138f78f0c23bb9b
ayout.java
405eceb20a3f3e7a22d922fc2d0fb8283be337fa 03-Aug-2015 Diego Perez <diegoperez@google.com> Merge "Restore session params "no decoration" flag" into mnc-dev
71a85575d41d08e1fcde5cd5c996e948b368a1ff 03-Aug-2015 Diego Perez <diegoperez@google.com> Restore session params "no decoration" flag

This seems to have removed from a previous version and the theme editor
relies on it to remove the decoration around the preview.

Change-Id: Ifab99e9c1689bfe44ca593e8c66c24e57c3e8c4c
ayout.java
5a8f33f1b09b0311f1bbd1ec6b90db706edb5219 31-Jul-2015 Deepanshu Gupta <deepanshu@google.com> Fix typo: s/FullScreen/Fullscreen/ in LayoutLib.

Change-Id: Ia8d223ae01f08df945ab05615b07075b98a54a32
ayout.java
671b7f9b99316f7224c1213d6923d449a2de9b62 27-Jul-2015 Deepanshu Gupta <deepanshu@google.com> Fix imports.

Also remove null checks on return value of ReflectionUtils.getMethod()
as the method always return non null.

Change-Id: Ib476302c2cf0504a0f54db4e795955ad10e5df3f
ayout.java
6e8d8ad2b7cffed751b2a382ac7b761954767188 29-Jul-2015 Deepanshu Gupta <deepanshu@google.com> LayoutLib: fix layout when nav bar is absent.

Change-Id: I0d3ee6fd5a4656156a630d3b298533ea13eb8415
ayout.java
49fcfdd4ba6b9e19139b0650542d573cf493dc5b 24-Jul-2015 Deepanshu Gupta <deepanshu@google.com> Merge changes I9c294329,Ie4db5d28 into mnc-dev

* changes:
LayoutLib: translucent sys ui bars
Move the layout code out of RenderSessionImpl.
fc8f4aad7395eca11f6d9b82eb266b1f4ee5041b 23-Jul-2015 Deepanshu Gupta <deepanshu@google.com> LayoutLib: translucent sys ui bars

Change-Id: I9c294329fc78418c505a5115bc9c07da29595af2
ayout.java
enderSessionImpl.java
esourceHelper.java
b1484862e2367d87d3ccbd0fd0a6d2598ed5918a 22-Jul-2015 Deepanshu Gupta <deepanshu@google.com> Move the layout code out of RenderSessionImpl.

Also, switch to using a RelativeLayout from a LinearLayout. The change
will help in future when enabling transparent status and nav bar.

Change-Id: Ie4db5d28313f1c5ef775603788598a56409f92c7
ayout.java
enderSessionImpl.java
b9935889b1be2aac4a47d1acbf7547a832edf9f3 21-Jul-2015 Diego Perez <diegoperez@google.com> resolved conflicts for merge of 112d8a36 to mnc-dev

Change-Id: Ic9511a57db8a96f54dba0704800789a8602b9dd2
7720eb18c1c2fe06e8f4b2f6e2936a4072494da8 21-Jul-2015 Diego Perez <diegoperez@google.com> Merge "Render to measured size when using expand mode" into lmp-mr1-dev
ccbc11770397888cf7780925bb4c7cf1d2f2f80e 11-Jul-2015 Deepanshu Gupta <deepanshu@google.com> Add tools:openDrawer to open a DrawerLayout.

Store a list of drawer layouts with tools:openDrawer encountered and
call openDrawer on them during the post-inflation processing.

Change-Id: Idee299a9af1bb106509a03bb2e8424c372b93dc5
enderSessionImpl.java
61f23e9bf7d784e7a52168196758c4f6c6853e77 07-Jul-2015 Deepanshu Gupta <deepanshu@google.com> Implement tools:list_item for RecyclerView.

It's now possible to use tools:list_item attribute for RecyclerView to
point to a default layout, rather than always using a TextView.

Change-Id: I5d522b2f0ca38b420fddfcb0f73a26d95707da79
enderSessionImpl.java
295ef6be084d1c2f22ef25a87e508c1f5c14ee5a 07-Jul-2015 Deepanshu Gupta <deepanshu@google.com> Add roundess to configuration

Change-Id: Icc85b38dd091fc5aa13092d6abb06ac169f7b0b5
enderAction.java
dc929e28acd32f7adebdc0d5afd3dc7eaa1a09fe 15-Jun-2015 Diego Perez <diegoperez@google.com> am 40a216d9: am df6f63ba: am 2422011d: am b2411c62: am ead59b0d: Merge "Fix GcSnapshot drawInLayer when clipping is used." into lmp-mr1-dev

* commit '40a216d95973bb897ee0d755ef260a616f176798':
Fix GcSnapshot drawInLayer when clipping is used.
ead59b0d479c3a911be87261b523255e8e51f76a 15-Jun-2015 Diego Perez <diegoperez@google.com> Merge "Fix GcSnapshot drawInLayer when clipping is used." into lmp-mr1-dev
4dfe4d43ce5634f059a3ba669e3cac4551c3a3ee 05-Jun-2015 Jens Ole Lauridsen <jlauridsen@google.com> Support AppBar from Material Design.

This CL is a start for making the design able to render the AppBar.
We are still missing support for: system menu and the app icon.

Change-Id: I19600f8ee1e7e6492186a0b7ae7fb38c82e15c02
enderSessionImpl.java
4362443cd9a5df6c5cc012881a0aaf96c927b923 02-Jun-2015 Diego Perez <diegoperez@google.com> Render to measured size when using expand mode

When using RenderingMode.V_SCROLL or RenderingMode.H_SCROLL, if the
screen size is smaller than the measured size but as large as the
desired size, the layout will render incorrectly and won't expand.
This changes that to expand to at least the size of the screen.

Added tests for the V_SCROLL and H_SCROLL modes.

Bug: http://b.android.com/174928
Change-Id: I22686903560775e2e4f362af1d7b50c9b985467d
enderSessionImpl.java
996458b76c944f78eee26d7bd8cb4d39303b9119 30-May-2015 Deepanshu Gupta <deepanshu@google.com> Fix ParserFactory not initialized error.

Bug: http://b.android.com/175129
Change-Id: I2111673767e0f62ee910560022b559a177d55abd
enderAction.java
476e582d2ffdf25102d4c55f8c242baa3d21d37f 22-May-2015 Deepanshu Gupta <deepanshu@google.com> LayoutLib: Change nullity annotations.

Switch from using tools nullity annotations (com.android.annotations)
to android framework annotations (android.annotation).

A new sdk-common prebuilt is required for LayoutLib tests. The new
sdk-common requires an updated tools-common. The updated tools-common
doesn't have nullity annotations. So, instead of adding the annotation
dependency, just reuse the platform ones. This also paves the way to
include other platform annotations like IdRes etc.

Change-Id: I87b8f767d3681d914abe7d1329e26a87f49f50a7
elegateManager.java
arserFactory.java
enderSessionImpl.java
esourceHelper.java
f8ea750455eec81e4e6d877b3e18e29a86d4ec95 19-May-2015 Deepanshu Gupta <deepanshu@google.com> Make Context.getClassLoader() work.

Context.getClassLoader() is used by the LayoutInflater and can be used
by custom views. However, when called from the LayoutInflater, this
needs to return only the Framework classes. This is so that the IDE gets
a chance to instantiate the custom views, which helps in better error
reporting and better fallback in case of exceptions, like MockView.

To workaround this need of the same method returning different results
based on where it's called from, the method call in LayoutInflater is
renamed to getFrameworkClassLoader() and the new method is injected in
Context. The implementation of getFrameworkClassLoader() maintains the
existing behaviour of getClassLoader().

Context.getClassLoader() is now modified to return classes from both
Framework and the app namespace.

Also, update the list of packages to search for Framework views.

Change-Id: I1a6be4aa1fc5c1c5520b5440a348a52f10b6eb3b
enderAction.java
5f1bf496948fb6383ae17e5467a26a00489d7564 18-May-2015 Deepanshu Gupta <deepanshu@google.com> Show better error message for color attr not found.

Change-Id: I1ca32989522d30fec336eb607ee81f9e5cb5f48f
esourceHelper.java
f2d408b51debadca830eefbf8131185ac55ce699 15-May-2015 Deepanshu Gupta <deepanshu@google.com> Don't keep LayoutlibCallback reference.

Switch to the newer API that enables keeping a reference only to the
ParserFactory which is a much leaner object as compared to
LayoutlibCallback.

Change-Id: I9b7afd93226db23786a00b2951cbf5ae5b8f3e5f
arserFactory.java
enderAction.java
d77b9ed7dcc42efca33b225c4594a30aab9e709c 12-May-2015 Deepanshu Gupta <deepanshu@google.com> Add missing delegates for M preview.

- Remove ICU dependency (use the version bundled with platform).
- Restructure intelliJ project to move dependencies to module.
- Minor fixes to layoutlib tests.

TODO:
- Load ICU data.
- Hyphenator doesn't work.
- High quality line breaker not present.

Change-Id: I965e096e17bfc97ee995a649c3f4f6f64bb4f70d
elegateManager.java
78af25584633462e4ab8cf9bafe10f43e7cb2d83 09-May-2015 Deepanshu Gupta <deepanshu@google.com> Remove kxml dependency.

Create XmlPullParser using callback provided by the client. This enables
clients to choose which XmlPullParser implementation they want.

Change-Id: I9ad97a4777820cdbe5c8fc3716f74ddec9065c70
arserFactory.java
enderAction.java
70280a20f379e416d9cff20b7c6764844e7c2ff4 07-May-2015 Diego Perez <diegoperez@google.com> am 0fe14486: am 2021c877: am 33e54563: am 4b125836: Merge "Added function to render a drawable in all available states" into lmp-mr1-dev

* commit '0fe14486211e3ade7f29ea76e16211853fe9cd7a':
Added function to render a drawable in all available states
4b12583653561f69a5780126485380cac187c478 07-May-2015 Diego Perez <diegoperez@google.com> Merge "Added function to render a drawable in all available states" into lmp-mr1-dev
681c7d142a6d25d3215d5f879074cd4359c6f106 05-Mar-2015 Andrew Shulaev <ddrone@google.com> Added function to render a drawable in all available states

This reverts commit 01cdf8b135be3bf67b9386dc929109c3db82c730.

Change-Id: I596855047d78c3c718744ad61432fc45e1239634
(cherry picked from commit 1f158819bc7cf58f97e47fabfaf23b2fb838f2eb)
enderDrawable.java
8ab069f3aed15c7e5de32ff52a3b4710218f9895 22-Apr-2015 Diego Perez <diegoperez@google.com> Fix GcSnapshot drawInLayer when clipping is used.

GcSnapshot only allocates an image for tinting that is the size of the
current clipping area. When drawing to that image, the wrong
coordinate system was used since now we are dealing with only the
clipping rect we need to translate -clipX, -clipY the drawing so it's
painted at 0,0 of the new BufferedImage.

Change-Id: Id8639d5ea9bef36ac07743df332161d6eadc6a81
cSnapshot.java
d7a53dab44babb38acc7cd0cc3067ae95152614d 07-May-2015 Diego Perez <diegoperez@google.com> am 9efcb308: am 21246bd9: am 8e75e307: am 1bc7fb2d: Merge "Fix isThemeAppCompat NPE when using an invalid theme" into lmp-mr1-dev

* commit '9efcb308615c0adaf418d430adabea3d271bcbb4':
Fix isThemeAppCompat NPE when using an invalid theme
dbcedeea2031554d5ebf9b3c09df90374b3273a7 07-May-2015 Deepanshu Gupta <deepanshu@google.com> am b2951490: am b19325be: am 2e3c41a4: am 92e79868: Merge "Fix title bar showing when not required." into lmp-mr1-dev

* commit 'b2951490eabf71e14c8fc5d50397adf869a2a291':
Fix title bar showing when not required.
0e20bd8e50724ab264425ba830cdf1beb96f7404 07-May-2015 Diego Perez <diegoperez@google.com> Merge changes I60c09f33,Ie0134c2b into lmp-mr1-dev

* changes:
Add new parameter to the render method to allow forcing a measure pass.
Avoid caching mImage on the main render loop and use clipping.
b4ca896f05eed9d36ac9971810d102a9139502f9 07-May-2015 Deepanshu Gupta <deepanshu@google.com> Merge "RecyclerView in LayoutLib: better XML attrs." into lmp-mr1-dev
1bc7fb2dcc954caac78d3fc02eb98ec30658d4d0 07-May-2015 Diego Perez <diegoperez@google.com> Merge "Fix isThemeAppCompat NPE when using an invalid theme" into lmp-mr1-dev
8ff8de2cf2ebc136d3dd8d8a8b5e4912e483bb2b 05-Nov-2014 Diego Perez <diegoperez@google.com> Add new parameter to the render method to allow forcing a measure pass.

Change-Id: I60c09f3375fc85c257a449f4372220741e01db54
(cherry picked from commit c13aa0c035cd226d27323bc0e533632ba32f6a84)
enderSessionImpl.java
f3cb4ba213a0fa4d1c184c430a2eaac7e27ccf6f 16-Feb-2015 Diego Perez <diegoperez@google.com> Avoid caching mImage on the main render loop and use clipping.

+ Added a session flag that avoids caching mImage. This is useful when
mImage is just a Graphics2D wrapper that might change at any time.
+ Make GcSnapshot aware of the clipping so it doesn't need to render the
whole area if not needed.

Change-Id: Ie0134c2bc2741b5fa6648313864c851bbac066cf
(cherry picked from commit 2c5e85b303077d2120b428bd4c7e6ecb6970935b)
cSnapshot.java
enderSessionImpl.java
6aa5a44d9b65ee608df03df29dad640258548f10 21-Apr-2015 Diego Perez <diegoperez@google.com> Fix isThemeAppCompat NPE when using an invalid theme

When the theme does not longer exists on the Android Studio side,
getDefaultTheme will return null causing isThemeAppCompat to crash.

Change-Id: I5a5c17126dce72e9872522643219b9438666bc04
enderSessionImpl.java
2bc2daa74eef01135f717eadfab87538a9bef29f 31-Mar-2015 Deepanshu Gupta <deepanshu@google.com> RecyclerView in LayoutLib: better XML attrs.

- RecyclerView now supports XML attributes natively. Thus, remove the
custom support via tools attribute. Users with older versions of
RecyclerView should update.
- Add Context.getPackageName() support used by RecyclerView.
- Update SessionParamsFlags with the new changes and rename it to
RenderParamsFlags.

The attribute behaves slightly different from the original tools
attribute. For usage, see commit 044b5b61e96 in frameworks/support.

Change-Id: I12073e37a2ba411558ca1d3e30c399e3d9a0b144
enderSessionImpl.java
666748728f40e0638860663eabb7a6c66248ad82 16-Apr-2015 Deepanshu Gupta <deepanshu@google.com> Fix title bar showing when not required.

Bug: http://b.android.com/166383
Change-Id: I5ea051ffdbf9a2d73a83f62d56a0f4006b014348
enderSessionImpl.java
4967201a2c524906b90739c9a549174fb1175a24 16-Apr-2015 Deepanshu Gupta <deepanshu@google.com> resolved conflicts for merge of 186fe7b1 to master

Change-Id: I60886d3e44ae23a11c8f129517df87ee29625ada
37dbb8b7f3c069196040eed3a03006647db7fa5b 15-Apr-2015 Deepanshu Gupta <deepanshu@google.com> Update to using LayoutlibCallback.

Change-Id: Ia89d418b0d40ca8efef8968a4a2a635616b945ac
enderAction.java
enderSessionImpl.java
inding/AdapterHelper.java
inding/FakeAdapter.java
inding/FakeExpandableAdapter.java
49ce36e1754243eedc124b4f7e68af1b458c821c 15-Apr-2015 Deepanshu Gupta <deepanshu@google.com> Remove implementation of deprecated method.

BridgeResources.getDrawable(int) is not needed anymore, since the super
method is deprecated and it calls the alternative
getDrawable(int, Theme), which we override.

Change-Id: I00c0bfaef6c4167a787bb74990b91cebb951c847
enderSessionImpl.java
a0c3191b74d1119999d94c71de8d916e128ea009 17-Mar-2015 Deepanshu Gupta <deepanshu@google.com> am 0f8c9d1d: am a5be9a7d: am 38467b5f: am 9a00f1c8: am 79f7fce7: am 2e4d9324: Fix NoActionBar themes rendering.

* commit '0f8c9d1df28ed10b1c9013ddd315b306868e349d':
Fix NoActionBar themes rendering.
9a00f1c84b7a7936a12415a08604ac8fb98ec5ea 17-Mar-2015 Deepanshu Gupta <deepanshu@google.com> am 79f7fce7: am 2e4d9324: Fix NoActionBar themes rendering.

* commit '79f7fce7a49e7b7cd414ff5c3fdb5cbaae45c1f1':
Fix NoActionBar themes rendering.
2e4d93245764a1c1d7515361ddbb8fc1665f814e 13-Mar-2015 Deepanshu Gupta <deepanshu@google.com> Fix NoActionBar themes rendering.

Also fix some warnings.

Bug: http://b.android.com/159780
Change-Id: I64fd4259b802722af7a271f51d5943018ed11e9e
enderSessionImpl.java
d88a9bc821a660bd86056e39fe8189d521b0f860 13-Mar-2015 Andreas Gampe <agampe@google.com> resolved conflicts for merge of ef1741d2 to master

Change-Id: I5379d5f756695f5176d92249ac6304bffcf95751
d345f44a87de1088fcd19e021238852bbffbbaec 06-Mar-2015 Deepanshu Gupta <deepanshu@google.com> Add RecyclerView support.

Bug: http://b.android.com/72117
Change-Id: Iba95baff59f1b715f91da25e15acf27bc052d95e
enderDrawable.java
enderSessionImpl.java
1f158819bc7cf58f97e47fabfaf23b2fb838f2eb 05-Mar-2015 Andrew Shulaev <ddrone@google.com> Added function to render a drawable in all available states

This reverts commit 01cdf8b135be3bf67b9386dc929109c3db82c730.

Change-Id: I596855047d78c3c718744ad61432fc45e1239634
enderDrawable.java
enderSessionImpl.java
01cdf8b135be3bf67b9386dc929109c3db82c730 04-Mar-2015 Andrew Shulaev <ddrone@google.com> Revert "Added function to render a drawable in all available states"

This reverts commit 63483e17de4d2441acaabcee4185b0bb25e1d94c.

Change-Id: I07fced229759e63d4fa4f94b7dac48b3e9342b18
enderDrawable.java
enderSessionImpl.java
63483e17de4d2441acaabcee4185b0bb25e1d94c 04-Mar-2015 Andrew Shulaev <ddrone@google.com> Added function to render a drawable in all available states

Change-Id: I230cc5775a09120efe9c82a4017b001aa510ddff
enderDrawable.java
enderSessionImpl.java
2c5e85b303077d2120b428bd4c7e6ecb6970935b 16-Feb-2015 Diego Perez <diegoperez@google.com> Avoid caching mImage on the main render loop and use clipping.

+ Added a session flag that avoids caching mImage. This is useful when
mImage is just a Graphics2D wrapper that might change at any time.
+ Make GcSnapshot aware of the clipping so it doesn't need to render the
whole area if not needed.

Change-Id: Ie0134c2bc2741b5fa6648313864c851bbac066cf
cSnapshot.java
enderSessionImpl.java
dc630c64be672b9330a272a40cee699e463fd248 18-Feb-2015 Deepanshu Gupta <deepanshu@google.com> am 0a300b89: am ad879adb: Merge "Add Asset management support for fonts." into lmp-dev automerge: 0684991 automerge: c2fa5e2
automerge: 7bf58d0

* commit '7bf58d0c5523a9b76ab1d570acb92514e8fff8ba':
Add Asset management support for fonts.
ad879adb65ffa577844738522ab6d7d30aba2ead 13-Feb-2015 Deepanshu Gupta <deepanshu@google.com> Merge "Add Asset management support for fonts." into lmp-dev
d51834bdfad0cd3142ac464ab3a3b0db14f884c3 28-Jan-2015 Deepanshu Gupta <deepanshu@google.com> Add Asset management support for fonts.

Change-Id: I10ca67dcffe244667d4ae0bda65dbc1aa6691d50
enderAction.java
b4506586dc4374697220408a63b6a5b293cb89f4 31-Jan-2015 Deepanshu Gupta <deepanshu@google.com> am 3d5535cf: Merge "Limited AppCompat support" into lmp-dev automerge: 7789447 automerge: 580937f automerge: c053438
automerge: df5a198

* commit 'df5a1987108539c703477adff3749d647ba313c5':
Limited AppCompat support
224e931fed1220f175805fdec71a882649270aa7 16-Jan-2015 Deepanshu Gupta <deepanshu@google.com> Limited AppCompat support

Change-Id: I4ac7234c9533b9f47f070335c4cb6ae605d8a89f
enderSessionImpl.java
c8807ebbd2f9a129372b4142b6db1378dad44127 10-Jan-2015 Deepanshu Gupta <deepanshu@google.com> am f2e04ac7: am c598047d: am ca67a249: am bb600de6: am 74147527: am 8505c387: Special case AppCompat to show action bar. automerge: 8e2dd14
automerge: 2223018

* commit '22230189be8e811881ba24de1cde97f9882a7d45':
Special case AppCompat to show action bar.
ca67a249293d021808f349fa2e2f799451aeafe8 10-Jan-2015 Deepanshu Gupta <deepanshu@google.com> am bb600de6: am 74147527: am 8505c387: Special case AppCompat to show action bar.

* commit 'bb600de6e7c5c7a0a1d4b872d2ee100ccc353213':
Special case AppCompat to show action bar.
bb600de6e7c5c7a0a1d4b872d2ee100ccc353213 10-Jan-2015 Deepanshu Gupta <deepanshu@google.com> am 74147527: am 8505c387: Special case AppCompat to show action bar.

* commit '74147527357b9abd9d30b3a2dbd72a5172a35625':
Special case AppCompat to show action bar.
8505c3870a17f41d23329344fe381cd9ff324bd2 09-Jan-2015 Deepanshu Gupta <deepanshu@google.com> Special case AppCompat to show action bar.

Bug: http://b.android.com/78944
Change-Id: I02d68d592d812016744716f99376cfefd519b21b
enderSessionImpl.java
08de06ddf7ca806161c2403e97634e6076051119 07-Jan-2015 Deepanshu Gupta <deepanshu@google.com> am adcd2241: am c7fe9793: am 48ab6bec: am 8c686ddd: am d20a518c: Merge "Make Preference-cookie map non static." into lmp-dev

* commit 'adcd224135e3c12f483547ffa8bb2cb0250ba923':
Make Preference-cookie map non static.
b95475404e70f4f0c7a8d4a6a452439223ffe297 07-Jan-2015 Deepanshu Gupta <deepanshu@google.com> resolved conflicts for merge of 20db8770 to master

Change-Id: Ifffcf8e2741ec242d940c3ba81244d4df57642fc
0ff4568ca07c16f2ad4c61872995200115292ecf 08-Oct-2014 Deepanshu Gupta <deepanshu@google.com> Make Preference-cookie map non static.

Moved the map from Preference to View Cookie to BridgeContext. This
means the map need not be static anymore.

NO_SQ: Depends on unsubmitted changes.
Change-Id: I662513def17bd6ec3a2646c3bec9bf4f9f89fc15
enderSessionImpl.java
10bb1371dca38b5b59f083ee963f7987da6511f2 05-Oct-2014 Deepanshu Gupta <deepanshu@google.com> Add preferences rendering.

NO_SQ: Depends on updating layoutlib-api-prebuilt.jar
Change-Id: Iae93ab74c478e6f2158e1528467bec9ee2d7ee9b
enderSessionImpl.java
4985297bd7452376afa8f3c06490431fc03bf310 11-Nov-2014 Diego Perez <diegoperez@google.com> Merge "Add new parameter to the render method to allow forcing a measure pass."
9173c8a2e90a48959dedc9d4aa415482f5014844 04-Nov-2014 Deepanshu Gupta <deepanshu@google.com> Remove needlessly thrown IOException.

Change-Id: If34986367554c98f96f6f9a1088f5e25077a1be1
enderDrawable.java
c13aa0c035cd226d27323bc0e533632ba32f6a84 05-Nov-2014 Diego Perez <diegoperez@google.com> Add new parameter to the render method to allow forcing a measure pass.

Change-Id: I60c09f3375fc85c257a449f4372220741e01db54
enderSessionImpl.java
0bffc736e1f260724764d31f7499cbc09471a535 27-Oct-2014 Deepanshu Gupta <deepanshu@google.com> Use the right layout for inflating Action Bar.

The choice of Action Bar layout depends on the theme. This also affects
the widget used to render the Action Bar.

Bug: http://b.android.com/77853
Change-Id: I6219a02853b4cd207a6125a5ed96fa5d16699460
enderSessionImpl.java
4a605c6fa0027ee116beb29fbc9625721f0441f0 28-Oct-2014 Deepanshu Gupta <deepanshu@google.com> Use right theme for drawable inflation.

The theme information was lost when inflating drawables. As a result,
drawables inflated in the ActionBar did not have the right tint.

Change-Id: I13d5c78039e35085ed4902289fcb735bb15d972e
esourceHelper.java
171804201dd556f8ce7ee7618661a5c8ee71507a 29-Sep-2014 Deepanshu Gupta <deepanshu@google.com> Always resolve enum when resolving resources.

Enums were resolved only for integers and dimensions. This change
resolves enums for all resource types. Well, almost all. For color and
colorStateList, enums are still not referenced.

Bug: http://b.android.com/76091
Change-Id: Ie43bd1b54fb9877655d31773bdf71d9a6a65c473
esourceHelper.java
1a12b805698c7cba9c2daa78c76c055afbdfa9fc 27-Aug-2014 Deepanshu Gupta <deepanshu@google.com> LayoutLib: Fix warnings in ResourceHelper.

Fix intelliJ warnings in ResourceHelper. Most of them just change
boolean checks "x == false" with "!x".

Change-Id: I278645e2807affd8b3183a4a6f5e4fa2ab7b3d21
esourceHelper.java
458f2a7bbbcc45d12b575fe9f3b2f8e1a20f9b1c 27-Aug-2014 Deepanshu Gupta <deepanshu@google.com> LayoutLib: Allow '+' in float attributes.

Earlier change to fix the invalid conditional check inadvertedly
disallowed '+'.

Change-Id: I75a37926681fe3a496482d6fb75161ac75326109
esourceHelper.java
ca22ba9eafe4193d213c5897f9303d02062effb4 27-Aug-2014 Deepanshu Gupta <deepanshu@google.com> Fix invalid conditional check.

The check was always false. This wasn't really a problem since the regex
check later took care of it. But it's just wrong to leave such mistakes
in the code once they are noticed.

Change-Id: I84270a96141428bf15949ce8c881d2e4a2aa95f6
esourceHelper.java
8ee6bcf8096803fe5c4fbc3838a296a692173e49 16-Jul-2014 Deepanshu Gupta <deepanshu@google.com> Use BlendComposite for advanced PorterDuff Modes. [DO NOT MERGE]

Not all PorterDuff modes are supported by Java's AlphaComposite. Use
BlendComposite for such modes.

Change-Id: I51486a40f09186cf8a87ce1e6a3d1cfcf39fb2d3
(cherry picked from commit b15709cd36d28c47660b0ae30918642bfd3d85f7)
orterDuffUtility.java
3a57d506e9a3ca621f43482eeff98b44e8dea97d 02-Jul-2014 Deepanshu Gupta <deepanshu@google.com> am 036557b6: Merge "Update system icon resolution in LayoutLib." into lmp-preview-dev

* commit '036557b60df5e5425b3563e99ffb21685160e4ab':
Update system icon resolution in LayoutLib.
1076be31f1c14f39295cc2ce7a747ee9ad96ee73 27-Jun-2014 Deepanshu Gupta <deepanshu@google.com> Update system icon resolution in LayoutLib.

This fixes some bugs with the resolution of icons for Status Bar and
Navigation Bar by separating the icons into v21 and v11 directories. An
icon is searched in v21 directory by default. For simulating older
platforms, v11 directory is searched first and then v21 is used as a
fallback.

This also adds xxhdpi versions of home, back and recent icons.

Change-Id: Ia6eafc83856eacafc4fb0b13d87793d4aa24f106
onfig.java
enderSessionImpl.java
42c7ce02f4023c94b315253754a20c20800be731 23-Jun-2014 Deepanshu Gupta <deepanshu@google.com> Add navigtaion bar icons to simulate older platforms.

LayoutLib can simulate older versions of the platform to a very limited
extent. This change adds the old navigtaion bar icons back and moves the
latest ones to directories suffixed with "-v21". The code handles this
resolution in a very crude way.

This also removes a bunch of unused code and fixes some style warnings.

Change-Id: Ib6e7bfd8dfb34b2ccd87f660ca979eb5ef14bae7
enderSessionImpl.java
08b59fcb217d06d10fc67f376ebfa183d8d759db 24-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am 04703acd: Merge "Add navigtaion bar icons to simulate older platforms." into lmp-preview-dev

* commit '04703acdd214cd17aaf5757da75a862fb1797d1e':
Add navigtaion bar icons to simulate older platforms.
3510c58ad6db0ab06f0e63507fbc34205e3b04a6 24-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am e558d180: Merge "LayoutLib: Support PorterDuffColorFilter" into lmp-preview-dev

* commit 'e558d1806b29385aa14ba60f18e103e2c9aeef1b':
LayoutLib: Support PorterDuffColorFilter
f2af1f5d8aaff684f8cc6d8e31454c945e190976 22-Jun-2014 Deepanshu Gupta <deepanshu@google.com> LayoutLib: Support PorterDuffColorFilter

Add support for select modes for PorterDuffColorFilter.

Change-Id: Ia7b4a6a92c326be977dd87a70f54c1f8954b546d
cSnapshot.java
orterDuffUtility.java
d0ca7b623b873b4159d7d77be1771ab573e22028 05-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am dfc3bc9b: Fix build.

* commit 'dfc3bc9b3cf27a72dfd133ce62f5e791ef74659d':
Fix build.
33dff284df61ed3a2d74839ff4c1f3cb93ab093b 05-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am 4c0d33f2: Merge "Add basic support for simulating older versions." into lmp-preview-dev

* commit '4c0d33f29f295e5ae27ba057fc8cb2270295865a':
Add basic support for simulating older versions.
58ff7de971a8172e40c09c3a8489eb276441e1b6 05-Jun-2014 Deepanshu Gupta <deepanshu@google.com> Fix build.

Change-Id: I877532b5056a035dbd4b0c6c55b5969d6292846a
enderSessionImpl.java
648a309d9badc405bc969bcb4461369bf89fe7ef 05-Jun-2014 Deepanshu Gupta <deepanshu@google.com> Merge "Add basic support for simulating older versions." into lmp-preview-dev
9288548527e318f748d0bcbe7e99647a85703ac8 04-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am e478c562: am 905e113f: am 03df93bc: am 5cde33a6: am dcfba78f: am ed5ab0f0: am 022d8a9f: am bad112f2: am c8235b8e: am ffcad247: am 904b89c5: am 295184bc: am 8782a120: resolved conflicts for merge of 61fb5784 to jb-mr1-dev

* commit 'e478c5624d5eeca5adc088d9328582bd5b487963':
Distinguish between menus in ActionBar and popup. [DO NOT MERGE]
905e113f97560dbcf71cab517ab4c1ee4faaa4d3 04-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am 03df93bc: am 5cde33a6: am dcfba78f: am ed5ab0f0: am 022d8a9f: am bad112f2: am c8235b8e: am ffcad247: am 904b89c5: am 295184bc: am 8782a120: resolved conflicts for merge of 61fb5784 to jb-mr1-dev

* commit '03df93bcb854eedc600ef0120fd238ec974c44a1':
Distinguish between menus in ActionBar and popup. [DO NOT MERGE]
5cde33a6ffd6a3be87f6622e67c3d83fb61519cb 04-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am dcfba78f: am ed5ab0f0: am 022d8a9f: am bad112f2: am c8235b8e: am ffcad247: am 904b89c5: am 295184bc: am 8782a120: resolved conflicts for merge of 61fb5784 to jb-mr1-dev

* commit 'dcfba78fbb4dad6792113383b2d32eff7f2c1f88':
Distinguish between menus in ActionBar and popup. [DO NOT MERGE]
022d8a9f4400dc7ec2926b133fc7151d8a5c24a3 04-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am bad112f2: am c8235b8e: am ffcad247: am 904b89c5: am 295184bc: am 8782a120: resolved conflicts for merge of 61fb5784 to jb-mr1-dev

* commit 'bad112f23f09f8839b4b7294439b0fe725cc2034':
Distinguish between menus in ActionBar and popup. [DO NOT MERGE]
14104896770dd26195cd9ccfac8c1604cb95dbc6 04-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am e4aa3138: am a9e82914: Merge branch \'klp-dev\' of https://googleplex-android.googlesource.com/_direct/platform/frameworks/base into klp-dev

* commit 'e4aa31382139ee2e319110fbfff402e0c6315952':
Distinguish between menus in ActionBar and popup. [DO NOT MERGE]
bac0d9ae796920360ee2f2babd8f2c03d4c3c2b8 15-May-2014 Deepanshu Gupta <deepanshu@google.com> Distinguish between menus in ActionBar and popup.

Mark the menus in the ActionBar and the ones in the Overflow popup
separately. This enables the IDE to differentiate between the two and
enable gestures such as double-click to open the menu xml for menus in
the ActionBar and single click for the menus in the Overflow popup.

Change-Id: I7a23f87d34d618a134ffbe3a665be695915d4bae
(cherry picked from commit f542f28a31b38a4e454535a1fea63968811b418c)
enderSessionImpl.java
ystemViewInfo.java
904b89c58465b0d0822478be514572ec752df3e8 04-Jun-2014 Deepanshu Gupta <deepanshu@google.com> am 295184bc: am 8782a120: resolved conflicts for merge of 61fb5784 to jb-mr1-dev

* commit '295184bc71a32a4e9418d34b2adeb0cef4b39781':
Distinguish between menus in ActionBar and popup. [DO NOT MERGE]
8782a12005e90bbd49be579fb8ede3a42a007380 04-Jun-2014 Deepanshu Gupta <deepanshu@google.com> resolved conflicts for merge of 61fb5784 to jb-mr1-dev

Change-Id: I079d5db0d69fd1972e6754cdd1829dfd1645202d
3ff08eb6bf68868d4f4e872fbbf1ecaf521934a9 15-May-2014 Deepanshu Gupta <deepanshu@google.com> Distinguish between menus in ActionBar and popup. [DO NOT MERGE]

Mark the menus in the ActionBar and the ones in the Overflow popup
separately. This enables the IDE to differentiate between the two and
enable gestures such as double-click to open the menu xml for menus in
the ActionBar and single click for the menus in the Overflow popup.

Change-Id: I7a23f87d34d618a134ffbe3a665be695915d4bae
(cherry picked from commit 03c0735017a34bac9ea69600b8cf980775331f0e)
enderSessionImpl.java
ystemViewInfo.java
03c0735017a34bac9ea69600b8cf980775331f0e 15-May-2014 Deepanshu Gupta <deepanshu@google.com> Distinguish between menus in ActionBar and popup. [DO NOT MERGE]

Mark the menus in the ActionBar and the ones in the Overflow popup
separately. This enables the IDE to differentiate between the two and
enable gestures such as double-click to open the menu xml for menus in
the ActionBar and single click for the menus in the Overflow popup.

Change-Id: I7a23f87d34d618a134ffbe3a665be695915d4bae
(cherry picked from commit 866d40fc39f7364d95085650244db59f52d4c002)
enderSessionImpl.java
ystemViewInfo.java
866d40fc39f7364d95085650244db59f52d4c002 15-May-2014 Deepanshu Gupta <deepanshu@google.com> Distinguish between menus in ActionBar and popup. [DO NOT MERGE]

Mark the menus in the ActionBar and the ones in the Overflow popup
separately. This enables the IDE to differentiate between the two and
enable gestures such as double-click to open the menu xml for menus in
the ActionBar and single click for the menus in the Overflow popup.

Change-Id: I7a23f87d34d618a134ffbe3a665be695915d4bae
(cherry picked from commit 79f45b43db4dfd605d1e7ddd2c71be4ef8285269)
enderSessionImpl.java
ystemViewInfo.java
79f45b43db4dfd605d1e7ddd2c71be4ef8285269 15-May-2014 Deepanshu Gupta <deepanshu@google.com> Distinguish between menus in ActionBar and popup. [DO NOT MERGE]

Mark the menus in the ActionBar and the ones in the Overflow popup
separately. This enables the IDE to differentiate between the two and
enable gestures such as double-click to open the menu xml for menus in
the ActionBar and single click for the menus in the Overflow popup.

Change-Id: I7a23f87d34d618a134ffbe3a665be695915d4bae
(cherry picked from commit f542f28a31b38a4e454535a1fea63968811b418c)
enderSessionImpl.java
ystemViewInfo.java
3885220ed562b82d9109bb305c2f9db75853c6ed 15-May-2014 Deepanshu Gupta <deepanshu@google.com> Distinguish between menus in ActionBar and popup.

Mark the menus in the ActionBar and the ones in the Overflow popup
separately. This enables the IDE to differentiate between the two and
enable gestures such as double-click to open the menu xml for menus in
the ActionBar and single click for the menus in the Overflow popup.

Change-Id: I7a23f87d34d618a134ffbe3a665be695915d4bae
enderSessionImpl.java
ystemViewInfo.java
5a734548455e5bcc8a5fd6b3972017086d3c1287 29-May-2014 Deepanshu Gupta <deepanshu@google.com> Add basic support for simulating older versions.

This adds rudimentary support for older versions of layoutlib by
changing the color of the status bar to white for froyo and earlier and
omitting the navigation bar for pre-ICS devices.

The color of the icons in the status bar is not changed yet.

Change-Id: I56a16b206ad357b6f3bc5c3d10701d03551847bc
onfig.java
enderSessionImpl.java
baef8c1ffe5c900fb0da9512654bf249b5fc9269 20-May-2014 Deepanshu Gupta <deepanshu@google.com> 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)
ontLoader.java
130d2353edda445b8e36a6b5e4b176fd748035b0 20-May-2014 Deepanshu Gupta <deepanshu@google.com> Layoutlib fixes for L

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
ontLoader.java
7dfe1fdac6f0306e1e31417d58a1a36d4280d2cc 14-May-2014 Deepanshu Gupta <deepanshu@google.com> am c289ec6b: am 3a559d56: am b5b47565: am 98822f0e: am 6e923e1b: am 90d57721: am 209745a3: am c251147a: am 85ec1445: am f266873c: am 1c55797d: Fix build

* commit 'c289ec6b465648d7d93e6f2dc9ed28822683f7d6':
Fix build
3a559d56a627687d56dc06cc459ef1e7e6b1cd79 14-May-2014 Deepanshu Gupta <deepanshu@google.com> am b5b47565: am 98822f0e: am 6e923e1b: am 90d57721: am 209745a3: am c251147a: am 85ec1445: am f266873c: am 1c55797d: Fix build

* commit 'b5b4756565a5f74c6eb2ca7f90ac839a4289daae':
Fix build
6e923e1b51c87e7b20a98dfc2fff52ca9115c9d4 14-May-2014 Deepanshu Gupta <deepanshu@google.com> am 90d57721: am 209745a3: am c251147a: am 85ec1445: am f266873c: am 1c55797d: Fix build

* commit '90d57721692e45fe6259136296e3cd5b669443fc':
Fix build
85ec144538de6c27b22dff1bd45491a334f626ef 14-May-2014 Deepanshu Gupta <deepanshu@google.com> am f266873c: am 1c55797d: Fix build

* commit 'f266873c8059e78410bf43c83fb8f0fd5bfe3362':
Fix build
40bfb60efa0e92259a417a5cbfd6095759c678b7 14-May-2014 Deepanshu Gupta <deepanshu@google.com> Fix build due to incorrect merges [DO NOT MERGE]

Change-Id: Ib3b4dafeed6ba4c07450d13d9908fb05a1a4542f
enderSessionImpl.java
1c55797d0e786b6594e769c2fa424e1b8386648e 14-May-2014 Deepanshu Gupta <deepanshu@google.com> Fix build

remove a line that shouldn't have been merged into this branch.

The build will still be broken for this branch, but this will fix it for
many branches downstream.

Change-Id: I2f556636640eb823dc2834afae7b536e79b79607
enderSessionImpl.java
21dc46b14df9456eede9d4eb7082c85bec732058 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 569dc64c: am 69ab5946: am fcfb8801: am 18b1525a: am ef24a509: am 900954e3: am 2100476a: am 31a3760a: am 964023c5: am 8bf73eae: am 0ad4f2ce: resolved conflicts for merge of 7377c7be to jb-mr1-dev

* commit '569dc64cd6b0bb7bdfec97967b192d2a706e3f81':
Add Navigation Bar to BridgeWindowManager [DO NOT MERGE]
69ab594625e274ed4ca6d4a1dc7f8fb19d44f020 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am fcfb8801: am 18b1525a: am ef24a509: am 900954e3: am 2100476a: am 31a3760a: am 964023c5: am 8bf73eae: am 0ad4f2ce: resolved conflicts for merge of 7377c7be to jb-mr1-dev

* commit 'fcfb8801b27fd40ff27c380b8bad9b9a210effca':
Add Navigation Bar to BridgeWindowManager [DO NOT MERGE]
ef24a5091b63fb512d4ca9eb34df6394c3842d33 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 900954e3: am 2100476a: am 31a3760a: am 964023c5: am 8bf73eae: am 0ad4f2ce: resolved conflicts for merge of 7377c7be to jb-mr1-dev

* commit '900954e3cd135bf43db975961056e7661f26a6c6':
Add Navigation Bar to BridgeWindowManager [DO NOT MERGE]
964023c5dcd0334cdcf624eff26d791d9c9617a8 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 8bf73eae: am 0ad4f2ce: resolved conflicts for merge of 7377c7be to jb-mr1-dev

* commit '8bf73eae6c98532c8a597b885b948b9878555441':
Add Navigation Bar to BridgeWindowManager [DO NOT MERGE]
0ad4f2cedde037c2b09a7f09c5f95f0984267c64 13-May-2014 Deepanshu Gupta <deepanshu@google.com> resolved conflicts for merge of 7377c7be to jb-mr1-dev

Change-Id: I26d2e3478536826608413094e17cd36da43b4e23
673d9734c2d9b62ecd41dcac3c730d242952989e 13-May-2014 Deepanshu Gupta <deepanshu@google.com> resolved conflicts for merge of 00d09649 to jb-mr1-dev

Change-Id: Ib3c34a1989d4251c3ac4755c52fe05a81644930a
5280c911d81a7db5ec8854850bef60d8b0951358 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 0df5ae65: am 0f209967: Add view cookies for action bar menus. [DO NOT MERGE]

* commit '0df5ae65a91174c99d1af633b45b3a1a7861cd1c':
Add view cookies for action bar menus. [DO NOT MERGE]
1867f58d6ceebac899b60b029e34f3a1fcabba7f 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 3027b69e: am f7e57949: Overflow menu popup for Action Bar in Layoutlib [DO NOT MERGE]

* commit '3027b69e154cffc6e286caf90b0f9af01c473c14':
Overflow menu popup for Action Bar in Layoutlib [DO NOT MERGE]
a5461ebfaebf3337a0cf1c752334f23de145a6d1 13-May-2014 Deepanshu Gupta <deepanshu@google.com> resolved conflicts for merge of 6d3c4ab2 to jb-mr1-dev

Change-Id: I5c4634897882deb663f32d8148202d7c9189521d
45ca5ba7dc3b70dd39991217894eed114eefb1b8 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 01cdd312: am 669792b3: Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]

* commit '01cdd3123f408dc41a2bd4786f3a943157ab6c69':
Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
8c5c2410ae9df60d9462784370965a0417e06fa4 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 7bb8de58: am a2b34c96: Optimize layout rendering in layoutlib [DO NOT MERGE]

* commit '7bb8de580a451621480913d7839fd7eb784ab689':
Optimize layout rendering in layoutlib [DO NOT MERGE]
94d33cfce1f32af4480f941fdd6c9942bb203d2c 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 82d5bd98: am e5a2347b: Fix NPE in layoutlib. [DO NOT MERGE]

* commit '82d5bd98b77a9955e375b075e262639625c40232':
Fix NPE in layoutlib. [DO NOT MERGE]
f20c9c660edcce0fe90ba5f8464f726dcd51229e 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am 06c4f23d: am 64dc0380: Fix layoutlib [DO NOT MERGE]

* commit '06c4f23d737082717f37f5f3583d9c12f4b64bf2':
Fix layoutlib [DO NOT MERGE]
3990ec3490cc43a2690163f2a973b5ac6c4bdc46 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am cdb87d8d: am a59c27dd: Fix ClassCastException when rendering ListView [DO NOT MERGE]

* commit 'cdb87d8d83e8a76a4cf78d24d5c49ee8548eba1f':
Fix ClassCastException when rendering ListView [DO NOT MERGE]
4d69ca223b268d4ed93baf9d3c354e1df79d55ce 13-May-2014 Deepanshu Gupta <deepanshu@google.com> am edae4e69: am 8a39c3af: Add orientation to configuration for layoutlib. [DO NOT MERGE]

* commit 'edae4e69512a7c9df1076fde70de83e15053a30a':
Add orientation to configuration for layoutlib. [DO NOT MERGE]
3a115628236ee9051518d4f96840cbb76070cf92 07-May-2014 Deepanshu Gupta <deepanshu@google.com> Add Navigation Bar to BridgeWindowManager [DO NOT MERGE]

Return the right value for presence of software navigation bar in
BridgeWindowManager. This is required to render the overflow menu button
correctly in the Action Bar.

Change-Id: I73de3b299f6a3a113425c436a59e800cd1d6b97f
enderSessionImpl.java
85f53c3335daf0e55cec757fd66fe560e0b020ef 23-Apr-2014 Deepanshu Gupta <deepanshu@google.com> Fix style warnings in RenderSessionImpl [DO NOT MERGE]

Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit 22de7c4c3d44e51aef6937e1b39540703ad01f5c)
enderSessionImpl.java
0f209967bfc4a6f1eec46cc34a39cfe8af9f8af9 18-Apr-2014 Deepanshu Gupta <deepanshu@google.com> 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 094fd8ecb6f4b666be6c9e7332679bce28fdc3ca)
enderSessionImpl.java
f7e5794990831df87d4097126f6d24455da50efe 13-Feb-2014 Deepanshu Gupta <deepanshu@google.com> 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 56759be8960ea1b5dc8b6de1810a84e2f10e2058)
enderSessionImpl.java
43b15371f9f1da7d97fe0500eb1536d981097e31 12-Dec-2013 Deepanshu Gupta <deepanshu@google.com> 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 fe38489f6734fefd0a216e9cfe12f8f978ff371f)
enderSessionImpl.java
esourceHelper.java
ystemViewInfo.java
669792b303b99a003bbcbf8d962f5be1debf9b63 19-Feb-2014 Deepanshu Gupta <deepanshu@google.com> 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)
ontLoader.java
a2b34c96f1ef24d96854d1e23426dec7774510e8 21-Jan-2014 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
e5a2347bc6cf1506799136af4c9724275ca0247e 12-Nov-2013 Deepanshu Gupta <deepanshu@google.com> Fix NPE in layoutlib. [DO NOT MERGE]

Change-Id: I36623304d83b344ea078044001577b8005a63c02
(cherry picked from commit 689c0dfe72a57c0555560012cbc6806375e7d4b7)
enderAction.java
64dc0380127047ffcf135b6848c9150aa8dbed85 17-Oct-2013 Deepanshu Gupta <deepanshu@google.com> 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)
enderAction.java
a59c27dd6674a31c875b0baa86519caec628ca2d 11-Sep-2013 Deepanshu Gupta <deepanshu@google.com> Fix ClassCastException when rendering ListView [DO NOT MERGE]

Bug: b.android.com/59300
Change-Id: Ia350adb3308daa8170bff755302760790163c811
(cherry picked from commit 7b5d54f05be61a7ab40021644a91c466e2897627)
inding/AdapterHelper.java
inding/AdapterItem.java
inding/BaseAdapter.java
inding/FakeAdapter.java
inding/FakeExpandableAdapter.java
8a39c3afb29f2540b05319042e758dd4d5f73a1e 13-Jul-2013 Deepanshu Gupta <deepanshu@google.com> 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)
enderAction.java
22de7c4c3d44e51aef6937e1b39540703ad01f5c 23-Apr-2014 Deepanshu Gupta <deepanshu@google.com> Fix style warnings in RenderSessionImpl [DO NOT MERGE]

Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit a98121ef5251b5ebdb8c1b0b6780d570844284b2)
enderSessionImpl.java
094fd8ecb6f4b666be6c9e7332679bce28fdc3ca 18-Apr-2014 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
a98121ef5251b5ebdb8c1b0b6780d570844284b2 23-Apr-2014 Deepanshu Gupta <deepanshu@google.com> Fix style warnings in RenderSessionImpl [DO NOT MERGE]

Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit fbfeb1a90b6f8f3966c60a69d50ce8f608d9d861)
enderSessionImpl.java
7704837947455909f295b088a3d15a20e107dbd7 18-Apr-2014 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
56759be8960ea1b5dc8b6de1810a84e2f10e2058 13-Feb-2014 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
fe38489f6734fefd0a216e9cfe12f8f978ff371f 12-Dec-2013 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
esourceHelper.java
ystemViewInfo.java
5be65fda15c6f66067da3cc623811427e9d541e4 19-Feb-2014 Deepanshu Gupta <deepanshu@google.com> 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)
ontLoader.java
5712b5fc3fec0dc376e84f660f2fe0d1102c0cbb 21-Jan-2014 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
689c0dfe72a57c0555560012cbc6806375e7d4b7 12-Nov-2013 Deepanshu Gupta <deepanshu@google.com> Fix NPE in layoutlib. [DO NOT MERGE]

Change-Id: I36623304d83b344ea078044001577b8005a63c02
(cherry picked from commit 80c55109b6351049498df294234dc0a75e75ec44)
enderAction.java
87be67f91719234cbd381ff0242b5efc8b6aa257 17-Oct-2013 Deepanshu Gupta <deepanshu@google.com> 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)
enderAction.java
7b5d54f05be61a7ab40021644a91c466e2897627 11-Sep-2013 Deepanshu Gupta <deepanshu@google.com> Fix ClassCastException when rendering ListView [DO NOT MERGE]

Bug: b.android.com/59300
Change-Id: Ia350adb3308daa8170bff755302760790163c811
(cherry picked from commit 54d88f7678387a6eb871ec2dccd36af4ff35b1fe)
inding/AdapterHelper.java
inding/AdapterItem.java
inding/BaseAdapter.java
inding/FakeAdapter.java
inding/FakeExpandableAdapter.java
ce22440d4ca94009a4fb22c3d4f924cfbf422a66 12-Jul-2013 Deepanshu Gupta <deepanshu@google.com> 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)
ontLoader.java
bd9e181b291af34f9d70db42715136f3c16ddbde 20-Jun-2013 Deepanshu Gupta <deepanshu@google.com> 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)
enderAction.java
enderSessionImpl.java
d4875e19f5b7c69226783b0a6590831466159f84 13-Jul-2013 Deepanshu Gupta <deepanshu@google.com> 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)
enderAction.java
b5cdfd97a5bbc2c52dec907467362550aff8afc4 13-Feb-2014 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
20e0695b554e883b095f5223be10b6e1097db49f 12-Dec-2013 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
esourceHelper.java
ystemViewInfo.java
7406e4b8102ffd71affd55a9f453c0ecce13a097 24-Apr-2014 Deepanshu Gupta <deepanshu@google.com> 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]
e17ed922001cf70c48969eb7b10ee2e2557b41f9 24-Apr-2014 Deepanshu Gupta <deepanshu@google.com> 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]
1ea1b21acd5517d5405bd3338ba24d5a03a8d792 23-Apr-2014 Deepanshu Gupta <deepanshu@google.com> Fix style warnings in RenderSessionImpl [DO NOT MERGE]

Change-Id: I9d3cb23e4ea692f737a3e3d6c18cc8de18b66a3c
(cherry-picked from commit fbfeb1a90b6f8f3966c60a69d50ce8f608d9d861)
enderSessionImpl.java
5ba2f230faa355eb9bc1e90f6c48eeeb437f390c 18-Apr-2014 Deepanshu Gupta <deepanshu@google.com> 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)
enderSessionImpl.java
e5d0fce7aeb60c44849cd09815ccecda702422ef 16-Apr-2014 Deepanshu Gupta <deepanshu@google.com> am 685b7d41: am 1b87390c: Overflow menu popup for Action Bar in Layoutlib [DO NOT MERGE]

* commit '685b7d4165c417ce20b1f6c49190eabcfda09940':
Overflow menu popup for Action Bar in Layoutlib [DO NOT MERGE]
d023360aa03db1a7831a5697d49faa2575e4a9c3 16-Apr-2014 Deepanshu Gupta <deepanshu@google.com> am 484c88c3: am 4ccc4bd5: Action bar rendering in layoutlib [DO NOT MERGE]

* commit '484c88c3655991759dc64276404d0cf7e33b455f':
Action bar rendering in layoutlib [DO NOT MERGE]
b7fd6315328c3a38fd7928f3dbb43f44227eb78b 16-Apr-2014 Deepanshu Gupta <deepanshu@google.com> Merge "Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]" into jb-mr2-dev
f14cbb26edcf0838cee333bf0d6ee686bf6de333 16-Apr-2014 Deepanshu Gupta <deepanshu@google.com> Merge "Optimize layout rendering in layoutlib [DO NOT MERGE]" into jb-mr2-dev
1b87390c9426c4bc9119829e9375d712dfde11c3 13-Feb-2014 Deepanshu Gupta <deepanshu@google.com> Overflow menu popup for Action Bar in Layoutlib [DO NOT MERGE]

Adds MenuBuilderAccessor in addition to the cherry-picked changes.

Change-Id: Ib7cc314079099c010f7d53849e204db36c410357
(cherry-picked from commit 929eea6bc1824bf98d244550c0984ecf8ea98811)
enderSessionImpl.java
4ccc4bd54f85d86818f61d728c6361d2003ddd8e 12-Dec-2013 Deepanshu Gupta <deepanshu@google.com> 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 14bf0cef7eeed572a67c29a328581afac4decc20)
enderSessionImpl.java
esourceHelper.java
ystemViewInfo.java
5fb41528a6192c41f7e2bb30161cc5af6061d5b8 19-Feb-2014 Deepanshu Gupta <deepanshu@google.com> 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 e327212adde1136807bbdf052e8cc3861f8a6aba)
ontLoader.java
9e5e993c7969ad60ff70cfdcf707247f38a705a1 21-Jan-2014 Deepanshu Gupta <deepanshu@google.com> 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 35d56c0d67537e56fafebd8edf790026644fe8de)
enderSessionImpl.java
80c55109b6351049498df294234dc0a75e75ec44 12-Nov-2013 Deepanshu Gupta <deepanshu@google.com> Fix NPE in layoutlib. [DO NOT MERGE]

Change-Id: I36623304d83b344ea078044001577b8005a63c02
(cherry-picked from d0581d271e814670d81a6550aa7b1e86864d5710)
enderAction.java
28873c1f008f4fe24441923e14f30e55d6f0967a 17-Oct-2013 Deepanshu Gupta <deepanshu@google.com> Fix layoutlib [DO NOT MERGE]

Fix a NPE, and update an ICU method to return the right value as
required by DatePicker widget.

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 39e75835399f4d979cf82069dae2bd1ec496fb81)
enderAction.java
ca4b9a77e7d20703287b33b203b2582bd43f7792 20-Feb-2014 Deepanshu Gupta <deepanshu@google.com> am e92c8542: am 01825b7a: Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]

* commit 'e92c8542a5cf1160a1b701b9f176af64ba46d68d':
Fix sans-serif-thin and sans-serif-light fonts in layoutlib. [DO NOT MERGE]
01825b7aa3c864426c78c08c2f6004a8362c2b47 19-Feb-2014 Deepanshu Gupta <deepanshu@google.com> 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 commit e327212adde1136807bbdf052e8cc3861f8a6aba)
ontLoader.java
23de8dc2625d4aeb4dc9085c5865ed571f96261a 06-Feb-2014 Deepanshu Gupta <deepanshu@google.com> am 28e049ef: am 0db6e6a5: Merge "Optimize layout rendering in layoutlib" into klp-dev

* commit '28e049ef73f5d9301a198ac53535442b697b7ef4':
Optimize layout rendering in layoutlib
84151432e7ead6666eb8cf6377bff577b2027694 27-Jan-2014 Narayan Kamath <narayan@google.com> Track 64bit changes to android/graphics.

All pointers are now 64bits wide, so should be
represented as java longs and not ints.

Also changed DelegateManager and SparseWeakArray to
reflect the new world order.

(cherry picked from commit 88a8364c386c694f7ad56662ef89713dbf7c9d63)

Change-Id: Ic2f55dd6235751169c5014f9d2ccf3f544259a87
elegateManager.java
35d56c0d67537e56fafebd8edf790026644fe8de 21-Jan-2014 Deepanshu Gupta <deepanshu@google.com> Optimize layout rendering in layoutlib

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
enderSessionImpl.java
d0581d271e814670d81a6550aa7b1e86864d5710 12-Nov-2013 Deepanshu Gupta <deepanshu@google.com> Fix NPE in layoutlib. DO NOT MERGE

Change-Id: I36623304d83b344ea078044001577b8005a63c02
enderAction.java
39e75835399f4d979cf82069dae2bd1ec496fb81 17-Oct-2013 Deepanshu Gupta <deepanshu@google.com> Fix layoutlib for KK

Fix a NPE, update the native methods for NinePatch and update an ICU
method to return the right value as required by DatePicker widget.

Bug: 11140701
Change-Id: Id92fc5359acf6dde1bcdbc781aaf637fdb6eecbf
enderAction.java
79a1a7c367214e86d1ea18fe07bc4d2d5bc00f76 14-Sep-2013 Deepanshu Gupta <deepanshu@google.com> am 31207780: am 0ecfe381: am 54d88f76: Fix ClassCastException when rendering ListView

* commit '31207780338b97e396927701ca0da7a61d6d44b2':
Fix ClassCastException when rendering ListView
54d88f7678387a6eb871ec2dccd36af4ff35b1fe 11-Sep-2013 Deepanshu Gupta <deepanshu@google.com> Fix ClassCastException when rendering ListView

Bug: b.android.com/59300
Change-Id: Ia350adb3308daa8170bff755302760790163c811
inding/AdapterHelper.java
inding/AdapterItem.java
inding/BaseAdapter.java
inding/FakeAdapter.java
inding/FakeExpandableAdapter.java
0851945a72e10e1d31aafa459f7e69cdf7087bee 05-Sep-2013 Deepanshu Gupta <deepanshu@google.com> am b50de495: am dd4efc22: am 3a762d8b: Merge "Fix text rendering" into jb-mr2-dev

* commit 'b50de4951aaea6d6f01432dc17b7c5de778a2e71':
Fix text rendering
b654556213513885ff5be05d4d2808e34d50233e 05-Sep-2013 Deepanshu Gupta <deepanshu@google.com> am 97c88368: am c78d173b: am 68411471: Merge "Fix layout rendering for RTL locales" into jb-mr2-dev

* commit '97c88368e0036665507c8cd84c71d26953784c85':
Fix layout rendering for RTL locales
0d9c922c9614147d1277cb36cfb7296774415d15 12-Jul-2013 Deepanshu Gupta <deepanshu@google.com> Fix text rendering

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
ontLoader.java
88db0ee2afbae38b53a0527506f0890914a7f115 20-Jun-2013 Deepanshu Gupta <deepanshu@google.com> Fix layout rendering for RTL locales

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
enderAction.java
enderSessionImpl.java
903709d738a92de467e22f3923d2a7e4e92e9148 19-Jul-2013 Deepanshu Gupta <deepanshu@google.com> am 388f85eb: am a2f41b23: am bf8be2ee: Merge "Add orientation to configuration for layoutlib." into jb-mr2-dev

* commit '388f85eb451bd0b61c8f48b500de5db6bca941f1':
Add orientation to configuration for layoutlib.
d97d60c0fa4613a47d591d45736299702be1cc7a 13-Jul-2013 Deepanshu Gupta <deepanshu@google.com> Add orientation to configuration for layoutlib.

Update the configuration with the device orientation before rendering.

Change-Id: Icd40901204fd13f90b18353e53a15e25e5b2176c
enderAction.java
80f00c1f2375796dab09bc4ed5b7631c62f7e158 13-Jun-2013 John Spurlock <jspurlock@google.com> Remove concept of system bar from window manager.

It was already hardcoded to false, this change removes the dead code.

Change-Id: I5e543344e60f69cb9882a70ba29f7c09404ad9fc
enderSessionImpl.java
f9e989d5f09e72f5c9a59d713521f37d3fdd93dd 05-Apr-2013 Jeff Brown <jeffbrown@google.com> Queues, queues, queues and input.

Redesigned how ViewRootImpl delivers input events to views,
the IME and to native activities to fix several issues.

The prior change to make IME input event delegation use
InputChannels failed to take into account that InputMethodManager
is a singleton attached to the main looper whereas UI may be
attached to any looper. Consequently interactions with the
InputChannel might occur on the wrong thread. Fixed this
problem by checking the current thread and posting input
events or callbacks to the correct looper when necessary.

NativeActivity has also been broken for a while because the
default event handling logic for joysticks and touch navigation
was unable to dispatch events back into the native activity.
In particular, this meant that DPad synthesis from touch navigation
would not work in any native activity. The plan is to fix
this problem by passing all events through ViewRootImpl as usual
then forwarding them to native activity as needed. This should
greatly simplify IME pre-dispatch and system key handling
and make everything more robust overall.

Fixed issues related to when input events are synthesized.
In particular, added a more robust mechanism to ensure that
synthetic events are canceled appropriately when we discover
that events are no longer being resynthesized (because the
application or IME is handling or dropping them).

The new design is structured as a pipeline with a chain of
responsibility consisting of InputStage objects. Each InputStage
is responsible for some part of handling each input event
such as dispatching to the view hierarchy or to the IME.
As a stage processes an input event, it has the option of
finishing the event, forwarding the event to the next stage
or handling the event asynchronously. Some queueing logic
takes care to ensure that events are forwarded downstream in
the correct order even if they are handled out of order
by a given stage.

Cleaned up the InputMethodManager singleton initialization logic
to make it clearer that it must be attached to the main looper.
We don't actually need to pass this looper around.

Deleted the LatencyTimer class since no one uses it and we have
better ways of measuring latency these days using systrace.

Added a hidden helper to Looper to determine whether the current
thread is the indicated Looper thread.

Note: NativeActivity's IME dispatch is broken by this patch.
This will be fixed later in another patch.

Bug: 8473020
Change-Id: Iac2a1277545195a7a0137bbbdf04514c29165c60
enderAction.java
135b5ba52431b147d51a81b807784009cd0510dd 18-Oct-2012 Xavier Ducrohet <xav@android.com> Layoutlib: Read and close XML files as soon as possible. do not merge.

Because passing an InputStream to KXML does not close the
stream after the file has been parsed, the files are staying
locked on windows until the gc and finalizers are run.

This change preload the XML files and close their stream,
and then pass the content in a stream to the parser.

(cherry picked from commit c48b0b940d632b9862ff6aa32665e37fe9e50845)

Change-Id: I1b225454c166026c1aab6290c55ac8279e8862d5
arserFactory.java
c48b0b940d632b9862ff6aa32665e37fe9e50845 18-Oct-2012 Xavier Ducrohet <xav@android.com> Layoutlib: Read and close XML files as soon as possible.

Because passing an InputStream to KXML does not close the
stream after the file has been parsed, the files are staying
locked on windows until the gc and finalizers are run.

This change preload the XML files and close their stream,
and then pass the content in a stream to the parser.

Change-Id: Iabe27989dc616ec9e7de88e52b1ec3af9f007f7c
arserFactory.java
434cd38f96a4a87220a8218901622f31e567354a 17-Oct-2012 Xavier Ducrohet <xav@android.com> Update layoutlib for jb mr1. do not merge.

Status bar displayed on all devices.
Update logic for displaying nav bar to whether or not
device has soft button.

Update navigation buttons to new look.
Remove battery and signal from navigation bar.

(cherry picked from commit 891b703f7b1e0e396d16477cc66a286da7161b49)

Change-Id: Id7cc9ad4255d2c4d2e6461a565dfe2cc17e12e75
enderAction.java
enderDrawable.java
enderSessionImpl.java
891b703f7b1e0e396d16477cc66a286da7161b49 17-Oct-2012 Xavier Ducrohet <xav@android.com> Update layoutlib for jb mr1.

Status bar displayed on all devices.
Update logic for displaying nav bar to whether or not
device has soft button.

Update navigation buttons to new look.
Remove battery and signal from navigation bar.

Change-Id: I8241d71269a17126218a3062ba727e379a8e6c25
enderAction.java
enderDrawable.java
enderSessionImpl.java
6dfd0b39a63559999a769f93d5cdb48abe675344 15-Oct-2012 Xavier Ducrohet <xav@android.com> Fix SDK layout rendering in Eclipse.

Change-Id: I0e9e85632012c0929b987ee9d0ccf7c25eece322
enderSessionImpl.java
908aecc3a63c5520d5b11da14a9383f885b7d126 01-Aug-2012 Dianne Hackborn <hackbod@google.com> Start moving away from DisplayMetrics.DENSITY_DEVICE.

This puts in most of the infrastructure needed to allow us to
switch between different densities at run time. The main remaining
uses of the global are to initialize the Bitmap object (not sure
what to do about that since it doesn't have anything passed in
the constructor to get this information from), and being able to
load drawables if we need a different density than what was preloaded
by zygote.

Change-Id: Ifdbfd6b7a5c59e6aa22e63b95b78d96af3d96848
enderAction.java
54a18ef7ad9da65a95f4d383952ae6268f8a4f34 10-Jul-2012 Xavier Ducrohet <xav@android.com> Replace LruCache implementation for layoutlib. do not merge.

The android version depends on a custom version of LinkedHashMap
which is not present on desktop VMs. This new implementation is done
in a way that minimizes the difference between the two.

Also some minor fixes.

(cherry picked from commit 01b6c755dbcf24e71192dc44757e2eea2a426091)

Change-Id: Idc7bca820e472e281a3024a5b610fd55606cf428
enderSessionImpl.java
01b6c755dbcf24e71192dc44757e2eea2a426091 10-Jul-2012 Xavier Ducrohet <xav@android.com> Replace LruCache implementation for layoutlib.

The android version depends on a custom version of LinkedHashMap
which is not present on desktop VMs. This new implementation is done
in a way that minimizes the difference between the two.

Also some minor fixes.

Change-Id: Ib27b0419f9d0e6ba4d4abb26b2ccd968af59eba8
enderSessionImpl.java
46d43ccfd8cef75b4315828073c094cf1efb05ff 03-Feb-2012 Xavier Ducrohet <xav@android.com> Make Layoutlib compile on Java 6.

Change-Id: Ic8f0e321c6c218de83664fc01f253a07fa80852c
enderSessionImpl.java
inding/FakeAdapter.java
inding/FakeExpandableAdapter.java
14094097329b3bdcbf26392141111d74c8b89718 04-Aug-2011 Xavier Ducrohet <xav@android.com> Layoutlib: Typeface support for loading fonts manually.

If the font being loaded is a system font, then we can find the font
file and manually load it.

Change-Id: I95473b1f1b88df64316b77c41ed05d4d09ab61ed
ontLoader.java
178006a0e05b41b4c4de93aec30368a9102ca140 05-Oct-2011 Xavier Ducrohet <xav@android.com> Layoutlib now parses system_fonts.xml instead of its own.

Also parse fallback_fonts.
This lets layoutlib automatically use the same fonts as the base
platforms, for instance it now uses the new ICS fonts.

Change-Id: Id6e778dc0e3f2a9112601e0eaf8499a9713ec433
ontLoader.java
7f9f99ea11051614a7727dfb9f9578b518e76e3c 11-Aug-2011 Xavier Ducrohet <xav@android.com> Make some methods/fields package private so that layoutlib can access them.

Change-Id: I4aeadfbaf8a4f6a459fa19937c21ac23d9e5fb64
nimationThread.java
layAnimationThread.java
enderAction.java
enderDrawable.java
enderSessionImpl.java
96131eef3869f2be1300e1620f5c3874b41bb534 12-Jul-2011 Xavier Ducrohet <xav@android.com> LayoutLib: updated fake accessbility manager and ensure there's an InputMethodManager

We had replaced the accessibility Manager but it lacked some new API. Obvisouly
this is fragile and should be fixed, but this works for now.

After fixing this there was another issue with the lack of InputMethodManager.
To fix this I had to create an implementation of IInputMethodManager which
normally comes from a binder object.

I may want to do a similar trick with the accessibility manager later.

Change-Id: I28c6494e333f39072f348d0199124efac93256a5
enderAction.java
0a49635b171f3ba366b1a7ebf28791c4661829bd 12-Jul-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Delegate for Display and IWindowManager implementation.

This allows ViewConfiguration to be properly implemented which is now
required for the rendering to happen.

Change-Id: I55629689fa8f5f874b43fcac2aa0789ce02d58f4
enderAction.java
9340ab4a213093bd59c79159011d131c9cd6996f 16-Jun-2011 Xavier Ducrohet <xav@android.com> am 0be8522b: am d1abd94f: am 04ce8111: Bring in more layout lib changes from hc-mr1.

* commit '0be8522b430aca8d90023d7c7e5ef510aa48adc7':
Bring in more layout lib changes from hc-mr1.
04ce81113107d2bfa0b8248b13145b4cf24cb943 10-Jun-2011 Xavier Ducrohet <xav@android.com> Bring in more layout lib changes from hc-mr1.

fe051bb2 : Change the way the layoutlib instantiate its XmlPullParser.

A lot of the init code was duplicated so I made a ParserFactory class.

Also created an extension of the KXmlPullParser to override toString().
This allows easier debugging when dealing with multiple parsers (which
is always the case).

Also added some (disabled) debugging printf to deal with parser stack
as it can be tricky figuring out which parsers are in the stack at
which point.

8969147c : Fix case where the int[] attrs doesn't directly match a styleable.

In the case of the FastScroller the int[] is a custom mix of attr
instead of a int[] that exists as R.styleable.foo.

This makes our reflection based mechanism used to find the styleable
fail, so instead we search for each attribute separately (like
we probably should have done from the beginning).

0c264b35: Fix various cases of getDimension to report error if unit is missing.

if getDimention###() is called for a string that has no unit,
then an error is output through LayoutLog, but the rendering keeps
going by using dp as a default.

0beb7eea: Make (Bridge)TypedArray.getInteger() call out to getInt()

Only getInt() resolved attribute flags/enum and I'm not sure why
there's two to begin with.
arserFactory.java
enderSessionImpl.java
esourceHelper.java
f18e311ee5d35db0cae96f0b216a88e5b42604dc 08-Jun-2011 Xavier Ducrohet <xav@android.com> am abc83871: am f6e47999: am 2a6dc7f1: Merge "Import the Layoutlib from hc-mr1." into honeycomb-mr2

* commit 'abc838716816107754ab0479242d03807ce79fc2':
Import the Layoutlib from hc-mr1.
fb93ce9684120a36862b5b5e67b1865a652907e9 04-Jun-2011 Xavier Ducrohet <xav@android.com> Import the Layoutlib from hc-mr1.

This is squash commit of all the missing patches.

Change-Id: Ie081c46a173290646deddbde503a720d50c4400f
enderAction.java
esourceHelper.java
9f23e60b20f0419e6ca5ff55db9d6282596e7fe8 19-May-2011 Xavier Ducrohet <xav@android.com> am a13462a9: am 582841e7: am b18e700c: am aa0834e3: Merge "LayoutLib: support the new baseline/margin query API." into honeycomb-mr1

* commit 'a13462a947e634a6893119146a7271369e509586':
LayoutLib: support the new baseline/margin query API.
05b7b69c6c5d418e18db644feed1ec2ca83291cc 17-May-2011 Xavier Ducrohet <xav@android.com> LayoutLib: support the new baseline/margin query API.

Change-Id: I856489df655960820b8eaa4c6179515a5c069b00
enderSessionImpl.java
8c2f85d94145a96f53e9041c609e283be7412a0f 14-May-2011 Xavier Ducrohet <xav@android.com> am d0054160: am 6d040a7f: am 738c5e60: am 2fae858d: LayoutLib: implement data binding for most AdapterView

* commit 'd00541603fbbb4e38264e75a2b6abf8705efeb49':
LayoutLib: implement data binding for most AdapterView
2fae858db55fc6984ef923a6226b9408c37c72cb 29-Mar-2011 Xavier Ducrohet <xav@android.com> LayoutLib: implement data binding for most AdapterView

Change-Id: I27be96ed2c37573eb22cfbb391d96b6137b3df8c
enderSessionImpl.java
esourceHelper.java
inding/BaseAdapter.java
inding/FakeAdapter.java
inding/FakeExpandableAdapter.java
515a08b01851a1ab9386f85dee6d9fd7b65ee7ad 07-Apr-2011 Xavier Ducrohet <xav@android.com> Merge 59aad78e from master. do not merge.

LayoutLib: don't render when shader's local matrix is set to 0 scale.

Change-Id: I02c0ddd856026357f468dcc8b81e0520470118de
cSnapshot.java
c5aeac7f157e3cb9e29ab8c126f74e26493501f5 06-Apr-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Fix issue with rendering mode.

When the layout content is embedded inside a decor layout
to emulate system bar (top or bottom) and title bar (or action bar)
then the code computing the full required size based on the RenderingMode
would fail because the decor layout would prevents the content layout to
take as much room as possible.
There is also an issue with the way we know render dialogs as the
dialogs usually as a frame with some padding and the previous measurements
would not take into account the dialog padding when increasing the
screen size.

This fix makes the code measure the size of the content layout in the
normal rendering, and then separately from the root layout with the proper
MeasureSpec to let the content grown. The difference in size is then added
to the screen size.

Bug: http://code.google.com/p/android/issues/detail?id=15892

Change-Id: Ibb9ca2a67c6c450d10d9f9a8050536e094650f8b
enderSessionImpl.java
6f2fb570642189ec2b6068632c25f02391007bb5 08-Mar-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Fix dimension parsing to handle negative value.

Also make TypedArray.getDimensionPixelSize properly
handle negative values (which are not allowed).

Change-Id: I960fc1c9e8ad97852d4a14e4f0f71a2c2034b4e7
esourceHelper.java
f0a53435f14d23d9555fc46014352ee6a7baa647 24-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Add debug mode.

Change-Id: If4263c7dba63a063f84e0c6988c270eb6d291ac3
elegateManager.java
cc4977d0fdaf657907912fd6cc2f9426dc8d2e36 22-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Hold onto delegate references.

When an object is given a delegate to hold onto, keep
the reference to the delegate instead of its native integer.

Also change the way the finalizer works by not explicitely deleting
the delegate. Instead we want the delegate to be deleted when
nothing holds a reference to it. To do this, instead of using
a regular SparseArray, we use a SparseArray of WeakReferences.
Because the main Java object that "owns" the delegate does not
actually holds a reference to the delegate, we fake this by
having the delegate manager hold a reference to delegates for
the main object. This is added/removed as the object is created
and the native finalized is called.

This makes layoutlib behave more like the JNI code where the native
objects are reference counted, and where the Java object can be
deleted but the delegate it owns is kept around (usually because
another type of delegates hold a reference on it.)

To properly handle the WeakReferences, we need to be able to
regularly clear the SparseArray of WeakReference that were
referencing objects that have been GC'ed.
Since the SparseArray is regularly being compacted (actually only
when items are removed), we use a custom SparseWeakArray (started
as a straight copy of SparseArray) that handles the WeakReference
and takes care of compacting the array by removing deleted indices
and WeakReference that returns null. Since our specific use case
doesn't call actually delete() or remove(), the compacting
only happens when the array needs to be resized.

Change-Id: Iacc5c1ff5b21732b8816fda87eb090da12d034e0
elegateManager.java
10df650f0d4bdf086dae9ac29fafd8a1ded06c23 17-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: add support for layout_only render.

Change-Id: I1cd791cf9560156c1ac488f8e454240c84e29cc6
enderSessionImpl.java
02d2b5a4031c80bfe1012ce2f4f7b3695762abd9 14-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: When possible ensure parsers are popped from the stack.

Some parser consumers (seems to be mostly resource inflation)
don't use the pull parser up to the END_DOCUMENT tag, making
the parser not pop itself from the parser stack automatically.

This is likely due to the XML resources being very shallow (1-2 levels
max), and the inflater just reading the content that it expects instead
of parsing till the document is done.

This ensures that *some* parsers are pop'ed from the stack when
used. Some other parsers we don't really control and hope the
user will parse till END_DOCUMENT.

Change-Id: Ie1f5762983fed2b2ae97b896218ae12b493e7ad9
enderSessionImpl.java
esourceHelper.java
abc33e014d4490dc993d1453e2589f538dbd7bbe 08-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: fix the background of title/action bars.

The bars are supposed to sit on top of the window so
that if they are transparent (which is the default case
for the action bar), the window background shows through.

Fix this using a layout to represent the window content
(all but the system bar) in which the title/action bars
and the layout content sits. This layout receives the
windowBackground drawable.

Change-Id: I8072c5ff52f585fa32acb589d8526e1c13cbcd94
enderSessionImpl.java
13bdc3355c781dc2614f2810a42d3a9e73f5bed9 06-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: improved rendering for system/title/action bars.

Change-Id: I926531e9ad4a7b98e04e23cac3837794f7c89449
esourceHelper.java
fd18f573280bbbcc549b35b548580a562bd960e2 05-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: add implementation of Bridge.renderDrawable()

Change-Id: Ic4d96488fd1a2e5b7d24353bebc8fdb24262c1d1
enderAction.java
enderDrawable.java
b0d34f9c99cbd43e8238c5952b19d032f02dd168 05-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: split RenderSession's base method into RenderAction.

This will allow us to create RenderDrawable that extends RenderAction.

Change-Id: If9cd350453ceffae4859a925a7b436502b311f9c
enderAction.java
enderSessionImpl.java
1126422ee1f532d8582a4e3b56dbfe505c15e775 05-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: update to the new API.

Change-Id: Ice028933cd2270c81c3d17f7bef7c5a9d14bd802
enderSessionImpl.java
bbbb8326020368958a3f1d248878329e9d6b10c0 28-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: render system/title/action bars.

Also a few generic fixes in the layoutlib itself to support
this.

Change-Id: Ie3f24c9056bd3cc72f39f8a4f2c0861be15bff55
enderSessionImpl.java
esourceHelper.java
33758ef8c98efb669c65eb9404b99ee5df09c6b5 03-Feb-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Fix some rendering issues

Change-Id: I662a39a783de5bc7f3063f46cedaab11c7e6496e
enderSessionImpl.java
345f866bfd09476fd62aa10345a0670cc110b63c 02-Feb-2011 Xavier Ducrohet <xav@android.com> Make TimePicker/DatePicker/CalendarView render in Eclipse.

Change-Id: Id5313a6f0f53bf45f6eaabc0e10fcf0660eeac08
enderSessionImpl.java
b353495192ba1acce94b8ab8aeeffe3c9a3bcfac 28-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: update with Pair API.

Change-Id: Iba945153f7544872ea84e3311584223aea740e2e
enderSessionImpl.java
esourceHelper.java
35ea7cd4c0c89122fda0b57af20061645082ffb9 28-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Update with the new resource map APIs.

Change-Id: I30d83c2bb4569513f4f5e22670cffe938706f105
ontLoader.java
enderSessionImpl.java
esourceHelper.java
16584225125acba18b74920b902c798dfead0328 28-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Properly compute available space to layouts.

Also display placeholders for status/title/action bars depending
on if the app is a tablet and its theme.

Change-Id: I651c1a2e5cfde165e004c11b236e6df056853dec
enderSessionImpl.java
esourceHelper.java
31fd1cf7697ef777b41c7a6a20e37ff5d573d732 27-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: put a default image on the quickcontactbadge.

Change-Id: I64b3f4004801ec03f374460384f9a492e66bfaf0
enderSessionImpl.java
5a82d8c58bf91c357c37a82b9f5e5c26f676d847 27-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: properly erase the bitmap when rendering a new session.

This fix the issue where going from a full theme to a dialog theme
would show the dialog on top of the previous rendering.

Change-Id: Ib52b9719f44b04969423547b9de8d039f90b6f46
nimationThread.java
enderSessionImpl.java
7d7016e72431ad7ee595d857a19231c69efeb6de 26-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: return ViewInfo for all merged items + Build init.

android.os.Build is now initialized from the build properties
parsed from the SDK build.prop file.

Change-Id: If16953215ca90fb0beacb51bf405b89a5c8a34fa
enderSessionImpl.java
9d0577ec0c285c055da4c910dcb597fdae5bc5e5 18-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: properly configure ApplicationInfo with targetSdkVersion.

Change-Id: I1bfef890206552843d1a7a8d0564741f2a37494f
enderSessionImpl.java
796992a942f3508a15ee62d34d6c7ec5de045d83 18-Jan-2011 Tor Norbye <tnorbye@google.com> Allow TabHosts to have no children in the tabcontent widget

Replace the code which throws an exception if there are no children in
the FrameLayout that is the tabcontent, with code to add a single
dummy tab.

This makes the TabHost renderable in those scenarios where the real
tabs are added dynamically rather than via XML.

Change-Id: I72442bd7d40eddd875b3507585c1f372fcae3329
enderSessionImpl.java
70552fb92dbc5cb5b1d53b20f92f2a64969a50c4 17-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Update to use the new RenderResources API.

Change-Id: Ic64eff3f324c4519da89bab10e6d59f0a9341a04
enderSessionImpl.java
d1d6fafc7fc63543b10552dadf202dd6fa40fe6b 16-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: extract resource resolution into its own class.

Next step is to make it a jar that will also live in
ADT.
The version in layoutlib will be through a prebuilt jar
file, like ninepatch.

Also add ninepatch.jar inside the layoutlib.jar file.

Change-Id: I4a0cc9f2dd99709de6408386054c6d4abae7c824
enderSessionImpl.java
51a7e5447de94791c464cda5cc6ebbf616d73c80 15-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: update logs to use new data bundle

Also change some resource.resolve tags to resource.format

Change-Id: I3f0b0d2eb69a5ec98375e4014a3bb1bfceb8c855
cSnapshot.java
enderSessionImpl.java
esourceHelper.java
0831b3fae504e8fa94e6b1cc0d4e6c3fccaef231 15-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Misc fixes.

- Fix resource resolution for framework
resources of type "id" that are dynamically generated
through "@+id/..."

- Proper implementation of setBitmap on a canvas that
already has a bitmap. Transform/clip are kepts but the
existing layers are replaced with the new bitmap

- return a null service for INPUT_METHOD_SERVICE in
Context.getSystemService

Change-Id: I35e46fff50e6492a8995e95427d5f38bc945429d
cSnapshot.java
918aaa5717fce6081557c82ce1c439b6922737d5 13-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Use the new log tag constants from LayoutLog

Change-Id: I29dd578ae16405358d3673caf13528be393f0967
cSnapshot.java
enderSessionImpl.java
esourceHelper.java
56222cfbe9973c518f7e8c9113c614de80b5a4b2 13-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: use tags in logs.

Change-Id: Ib85272249d285ecef409bf063903bcd91514a424
nimationThread.java
cSnapshot.java
enderSessionImpl.java
esourceHelper.java
6c740cf71e5ce5ba7c8493c545c3a57c57ac7024 11-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Improve error reporting.

Change-Id: I37cad7e2efb959202960c57b271c55c759867139
enderSessionImpl.java
esourceHelper.java
b3830b8978aa05746912210932e26ebf1836aab5 11-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: only support animator-type animations.

Change-Id: Ia3609fc5d11555190bc323d61a3577144a4692fd
enderSessionImpl.java
eb87b3bb53a8a9e9a246b4b70ea40172e2229c85 11-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: fix some issue with resource resolution.

TypedArray.getResourceId() is not only about id/foo,
it can be any type of resources.

Change-Id: Ia5e147bc078bb349a3fa500a04c596ae44ea34ce
enderSessionImpl.java
479101a9b4142d21d42351684bc9bc65ec3471be 09-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: Fix moveChild animation.

Only support animation for view move inside
the same layout.

Also fix animation thread to property support multiple
animation running at once.

Change-Id: I45cad84e7b9f3a4f281c956d32934eb74e807afb
nimationThread.java
enderSessionImpl.java
46a329244db12b6f7afc3c9a6409d420241a1058 08-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: finish Typeface and unload them in dispose.

Change-Id: I3a48f84678f62d669d303fc73b041bb3fe5f333b
enderSessionImpl.java
7550ec1d8e526c4ae8c0bb08b06e1b6e799eacec 08-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: remove fade in/out transition on moveChild.

Change-Id: I69a70ecb165f19feca55fc30a3f48ebea896daa3
enderSessionImpl.java
d7cc1244d7f0901688545c8535fa531fbb68669a 08-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: fix moveChild again.

Change-Id: Ib69a06e44be1e332f0f43c36c795c86270cb1b71
nimationThread.java
enderSessionImpl.java
2b9c38ab62abc8d5b2f956e961087f259caf25ff 07-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: fix animated moveChild.

The child can only be added to the new viewgroup
after it's been removed from the previous one, which
is delayed if there's an animation.

Change-Id: I9123a2670d0d17b3eb6f8f89085ebab8ca2b800f
nimationThread.java
enderSessionImpl.java
a7cac5e0542779cadf0f5ccf71584e4b4425f7a6 07-Jan-2011 Xavier Ducrohet <xav@android.com> LayoutLib: fix clipping issues.

There were two issues:
- Graphics2D.setClip only works on rectangular shapes.
This means doing a setClip on a non rectangular shape should
basically reset the clip and intersect with the new shape.

- the current clip can be null, so the combineShape method
must handle it.

Change-Id: Id2cd7475e991d8b533ff2e8850cc2c27663f9e52
cSnapshot.java
b44b43b1579486ff7ecd0f7528f17711acdeae98 23-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Support Region through delegates.

also finish supporting some clip operation
on the canvas.

Change-Id: I743b9e52a7aa6e9340506f1c904cc1cfbf3ff81f
cSnapshot.java
d43909c7503e11eb335a452d296a10804bb01fd6 23-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: add support for unsupported drawing modifiers.

DrawFilter, Rasterizer, ColorFilter and MaskFilter
are not supported but we need to provide their
JNI counterparts anyway, to at least display warnings
when they are used.

Also improved the API to query Paint for Shaders
and PathEffects, and clean up some code by
moving asserts into the DelegateManager.

Change-Id: I8942514565d28576d5608c6373bda25d86d42ff2
elegateManager.java
cSnapshot.java
20805343296eef04081fee82fd04547f51225fe3 23-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Fix Canvas layer support with 2+ layers

- When drawing is not clipped to the top layers,
drawing should not happen automatically on all
existing layers. Instead each layer's flags dictate
whether drawing should happen on layers beneath, starting
with the top layer.
- upon restore, the same mechanism is taken. Only blit
a layer into the layer beneath if it was drawn into
using the logic above.

Also fixed:
- saveLayer() does not, in fact, always save matrix
and clip info. The flag dictate this, the same way
it does in save()
- drawing code didn't properly detect the case of drawing
into layers if a save() was called after saveLayer().
Now the code only looks at the layer list which provide
all the needed info (flags mostly), and doesn't rely
on mLocalLayer (which is used during restore only now).
- Properly handle HAS_ALPHA_LAYER_SAVE_FLAG (or lack
thereof) when creating the BufferedImage for the layer.

Change-Id: I2fbbcc0f5d3a3dd208763705bc23e6658fd4e573
cSnapshot.java
b1da1afa7418960b650780250bbd34c81af61aa3 22-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: improve bitmap support.

Change-Id: I703c2bdf51380b54fd5c20b08d3bc74833d9bc6e
cSnapshot.java
d38e776a3cc8cb53945cbebafbe6f6c2e3501fa5 21-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: support for layers.

Layers require that drawing methods potentially
draw in more than one bitmaps.

To handle this this patch offers the following:
- move all drawing methods to use Drawable
- Drawables are now handled by GcSnapshot since
its the one handling the layers
- moved Canvas_Delegate.createCustomGraphics to
GcSnapshot which does not expose the Graphics2D
objects anymore so its draw() methods are the only
way to draw.
- handles creating layers in GcSnapshot.save() and
blitting them in restore()

Other changes:
- Clean up the create/save API in GcSnapshot
- Fixed drawing bitmaps with alpha and other
composite modes.

Change-Id: I1e230087493d044a10de71f4b6d29083e3f3bf64
cSnapshot.java
19a021038f2f4683dddef651543d7298f5bd7218 16-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Update layoutlib with revised API.

Change-Id: I78929df621f48e85d9cbefe1f5590f9ce99bbaff
nimationThread.java
ayoutSceneImpl.java
layAnimationThread.java
enderSessionImpl.java
esourceHelper.java
cfdc784b6cdcbbb2bf2ba4d53d9a9eb2c37278a3 15-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: replace the stack of Graphics2D with custom snapshots.

The first step is to allow the canvas to save only the matrix or
the clip. Previously, since the graphics2D were created completely
new on each save, everything was saved.

Also allows to set transform/clip on the Canvas when no bitmap
has been set (and therefore no Graphics2D exists).

This is required by BitmapFactory.

Change-Id: I37eff6dde1ca708d58ba317b40e9b3236f3ef3d0
cSnapshot.java
f1416e4dffb0874f163febfa12f2648eac0c3a77 14-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Misc fix to rendering.

Change-Id: Ia73fab1be3c01e6ce5791973e636e45a0f75ceb6
ayoutSceneImpl.java
90c6b7e639921e264ac65699439578bcbdbf583a 14-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Use the new ninepatch API to suppor density.

LayoutLib now compiles against a prebuilt of ninepatch.

Change-Id: I0a1ca60af90933c171ab3aa456b47f0329df2f55
esourceHelper.java
6735cffc1ddd18bdd6a46011e42d89204435361a 11-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: parsed resources were always set as platform res.

I broke this last week when adding the support for
layout params in moveChild.

Change-Id: Iaaf9b9f685ca301638d4037e98428ea0a00279c9
ayoutSceneImpl.java
ffb42f6c5043de226f02318a1311669d35a90711 10-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Adapt to new LayoutLib

API now uses ResourceValue instead of IResourceValue
Capabilities renamed Capability

Change-Id: Ia5d2b6c8d536e020a1f5496fb2285f67fc4346c4
ayoutSceneImpl.java
esourceHelper.java
empResourceValue.java
8d74c978bbf3da4095ef8e40c005a6fdf0637071 07-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: explicitely override PropertyValuesHolder native code.

Change-Id: Ic7dd9efc990d01b20db144117cb11eb130349048
ayoutSceneImpl.java
168677c9e2f8438ec5687e3c6b0e41b986c5b230 06-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Fix logging.

- Use the new logging API
- remove log object reference everywhere but in Bridge
- all logging code accesses Bridge.getLog()
- prepareScene sets the current scene log object in Bridge.

Change-Id: Ib0517ccd6454c4baf218b6baa978a126f91671e7
nimationThread.java
ayoutSceneImpl.java
layAnimationThread.java
esourceHelper.java
e1179ea065392485a6e3bf1e28a1242179cd48b0 03-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Animation support in insert/move/removeChild actions.

Also update to use the new SceneResult API.

Change-Id: Iaac6df0c250fbefc8758310c37e0cf47cae6875d
nimationThread.java
ayoutSceneImpl.java
layAnimationThread.java
01811aa86279af1b341a4fff344d66c0ebdd63da 03-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Create new layoutparams when moving a child

Change-Id: Ie2183490e8d26ef194030a9d87fe7745f24f1d83
ayoutSceneImpl.java
c8aec064f9f304c88f61c8c1aa3d60521b92177a 02-Dec-2010 Xavier Ducrohet <xav@android.com> Layoutlib: update with new add/movechild API.

Change-Id: I33e3a07cd7db7fe996d1f52b84b4b3bf21065a51
nimationThread.java
ayoutSceneImpl.java
9eb6d412af6859b6c0bb969c76bbfc48eec8fd4b 01-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: Reuse canvas when possible.

Also moved the prepare/cleanupThread methods to Bridge
as they are not really specific to the scene anymore.

Change-Id: I7b93821913ce4d2fcbe3d8be489be6533ff87e57
nimationThread.java
ayoutSceneImpl.java
c14e7dd8ba15f517a5402ad802377b1d60784416 02-Dec-2010 Xavier Ducrohet <xav@android.com> LayoutLib: implement insert/move/removeChild.

Change-Id: I1c05ff4dc80e5ee4ea67d322acaf9c94276f84e1
nimationThread.java
ayoutSceneImpl.java
30c77d689ead610685a5e0bd4078b44eb89360ff 30-Nov-2010 Xavier Ducrohet <xav@android.com> LayoutLib: get AWT image from new image factory.

Change-Id: Ib760af8a77fefac2571b8b4e48b4728e158aab2f
ayoutSceneImpl.java
2eea6fab1cbb0a5c8f913491c2d622c904759893 24-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib: Animation support.

New locking mechanims to prevent concurrent renderings.

There's now a thread specific prepareThread() method (only
prepares the looper) and its associated cleanupThread().

For the rendering itself, acquire must be called before doing
any type of Android specific work on the scene (inflate or rendering)
After instantiation, init() must be called, which also acts as acquire.

Added a lot of checks to make sure method aren't called without
acquire or if scenes try to be rendered while acquire was called
from the same thread but on another scene.

Animation implementation:
- Handler delegate to use our own queue (since the animation runs
through handler messages). This uses a callback to process
the message. This callback is per-thread and only used in
animation threads.
- SystemClock delegate to provide clock implementation.
- AnimationThread to handle playing the animation and calling back
to the animation listener.

Change-Id: Ia39aba7ed476759df1da3200e413fe3e92590d15
nimationThread.java
ayoutSceneImpl.java
2d56b273ef6e2984a4e8914fb67772b173d0a154 23-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib: use default nine patch classes.

Move away from using our own implementation of NinePatchDrawable.
Now use native delegate for a few methods of NinePatch.

The byte[] used to describe the 9-patch chunk is entirely controlled
by the delegate. Therefore, while the default version (JNI) use the
array as a representation of a C struct, this version uses the array
as a serialized version of NinePatchChunk.

A cache mechanism using SoftReferences allows us to not deserialize
the array every time rendering needs to access the chunk itself.

The Bridge-level cache mechanism for bitmaps and nine-patches as
changed. Since the new nine-patches doesn't hold the bitmap
data anymore (it's stored in a normal Android bitmap which
is cached itself through the cache), then the nine-patch cache
has been changed to only contain the nine patch chunk.

Also initialize the canvas with the display metrics to prepare
for correct scaling when density of the assets don't match the target
density.

Still to come: actual density support in the 9-patch drawing code.

Change-Id: Ibefcccf4432e1986e8436e0c41a0107741593536
ayoutSceneImpl.java
esourceHelper.java
9223b6737c56619c02125ce988bb21fc4fde264b 20-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib: support for editing embedded layouts.

When Resources.getLayout(int) is called to return a parser
for an embedded layout, this queries the current parser for
a custom parser (Eclipse will provide one on top of the current
XML model being edited)

Change-Id: Ia9e837358f67daed0a835e1b3f4f50c0516ceee9
tack.java
fb25cae1916da1caf206ede879f07a4f8b61cfec 19-Nov-2010 Xavier Ducrohet <xav@android.com> LayoutLib: use the new expand API.

Change-Id: I248de70ebe97aa6fb1cbcb5b6572a4a46c5ca1ba
ayoutSceneImpl.java
5a09488a158b669577cd8eb557ce4feb62929e75 19-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib: Properly dispose of bitmap delegate.

This is done by initializing the android.util.Finalizers that's
reponsible for calling out to the native bitmap destructor.
Also implemented the native bitmap destructor

Also fix Bridge by removing obsolete API methods, and removing
some unneeded synchronized blocks now that the whole rendering
(and scene creation) is protected by a synchronized on the bridge
object anyway.

Change-Id: Ie1792da6db354836542dfc11f457fe4a6d78ddfb
elegateManager.java
cf52390eee4c9ae792ef63af1528b2e71b33a04f 12-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib: Fill the default prop value map for View objects.

Change-Id: I35426ced17a10eb092fac2153276f1202692876f
ayoutSceneImpl.java
135f80dcb4a1fead062714a8f6fdcef288fdddd8 12-Nov-2010 Tor Norbye <tnorbye@google.com> Fix fill color alpha in layoutlib

new Color(int) ignores the upper 8 bits - it creates a color without
an alpha channel. In order to pass in rgba we have to use a different
constructor, new Color(int,true).

(In the layout library API we should also specify that the custom
color, if specified, needs to include an alpha, or in particular add
in 0xFF<<24 if the color is opaque.)

Change-Id: I1c44caed8a5780e61b1c799f3b45bef3eb7bc97b
ayoutSceneImpl.java
071dee288ca726c7c15754c2559403b9cbf950bd 11-Nov-2010 Xavier Ducrohet <xav@android.com> Misc fix in layoutlib bridge + View.isIneditMode as delegate.

Change-Id: Ideab29167e933203da99d4270cebcb777726201f
empResourceValue.java
c2e9651bf386a1f7bf7fc706cf5424950570470c 10-Nov-2010 Xavier Ducrohet <xav@android.com> Layoutlib: New bridge implementation using the new API 5.

Since the new API prepare for stateful layoutlib, major
reorganization of the code.

New "android" sub-package for all extended android classes.
Also moved BridgeInflater in here so that all extended classes
are in this package. Only delegates and classes replacing
renamed classes are in their original android.* packages.
Also created full file for the empty implementations of
IWindow and IWindowSession.
New "impl" for the dirty work implementation.
Main package contains the basic implementation of the API.

Most of the code that was in Bridge is now in .impl.LayoutSceneImpl,
with the main init/inflate/render code split into the contrustrutor,
inflate() and render().

Change-Id: Ie15b15e5a1b2388cd6ef82e518345b1fc02ec981
elegateManager.java
ontLoader.java
ayoutSceneImpl.java
esourceHelper.java
empResourceValue.java