Do not merge because the resource implementation has changed in N and
the change is no longer valid there.
This is a very hacky fix to make layoutlib work with the latest support
lib. Inject a couple of fields in android.content.res.Resources to
allow using most of the earlier code as is.
Bug: 27403642
Bug: http://b.android.com/201934
Change-Id: I186cad32b1b4de64164fbad937d989e0110c6976
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: Ib0392303e6d00a4fe5494ae484f28135b1fe6b28
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
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
The try catch was to prevent crashing on preview releases of Android
Studio. We don't support them anymore.
Change-Id: I8e33cae98117c0034aea1b56903b623fcb64435e
Layoutlib now correctly interprets the translation and scaling
xml attributes of views, by implementing what the Android platform
does in native code.
Change-Id: Ie8465f40ef4508d3c31796200800f12cb8f883a4
The way Android views deal with their rotation xml attribute is through
native code called for hardware accelerated rendering. So layoutlib
has to bypass that in order to take those attributes into account.
Bug: http://b.android.com/73300
Change-Id: Ieb5bf0567a25a9021491ebf3250cedd0752f7863
The method index in PropertyValuesHolder was using only the method name
+ the number of parameters in the call to index the different properties
methods. This worked ok most of the time because, for a given method
name (let's say setTrimStartOffset), the class is usually the same.
However, if the same method name is used in multiple classes, this will
cause collisions and will most likely crash.
Change-Id: Ie6fa8872c5c5e69e690f4f1bb79191a31bef2a28
Before this CL, PathMeasure_Delegate would use Path_Delegate.approximate
to get a path segment to draw. Path_Delegate.approximate uses a
flattening iterator to do the path approximation.
Unfortunately, because we do not control the stroke mode while painting,
in some cases the approximation would draw unwanted artifacts caused by
the rough approximation and the use of wrong miter values.
This CL does a much better calculation of the path and interpolates the
segments of the curves instead of replacing them with line segments.
This also fixes an issue with the calculation of empty paths.
Bug: http://b.android.com/187256
Change-Id: I450f7aa4c3d9efcbf902a40c3b4d6d388546893f
Use new functionality from callback to get the content of state list files
from PSI instead of disks.
Bug: http://b.android.com/183767
Change-Id: Ic256d1e7787209d772ccd42c2e3c7f409cac2964
The standard navigation bar was not working well in the Theme Editor preview
when in a wide configuration. The bar then did not fit entirely inside the display.
So we created a new Navigation Bar to use in the Theme Editor preview, that fixes
the size problem.
Bug: http://b.android.com/198179
Change-Id: Ifb1fa7b8f399f17392934de89078696337eca3e1
Really fix the bug now. Also add tests for the same and update
allwidgets golden file for M.
Bug: http://b.android.com/187939
Change-Id: I98cd55da0561fef9d47d8759bcd287ee36d03cc2
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
This reverts commit 65a834980cdbb9407a3f27e48cd0a8c472182cd6.
The original revert was only for cherry-pick to release
branch.
Change-Id: Ib78f9a06ce49681c767f65b262058f18a670e38e
This reverts commit 631c2ffd6ff1bfa7463d29a39a7ee74be019b3f9.
The revert is only for cherry-pick back to mnc-sdk-release.
Change-Id: I42cb392528b7890b58d689c732f90c3b9ba5f74c
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
To test the presence of WindowDecorActionBar class, use findClass()
instead of loadClass() which logs warnings.
Change-Id: Ice8a5a6badd764c7f75b5a64a07c48f0a7cfef98
In change id I7582e242c7564c32feeb044fc9eff6bfb5c56536,
WindowDecorActionBar's package name was changed. This breaks layoutlib.
Fix the issue by checking both package names when loading the class.
Change-Id: I5723a97f0f164d61c56061fef6cff18e3cdafaee
Currently, delegation of inner static classes methods is broken since
the rewritten method tries to pass an instance to the outer class. This
updates the method generation to only pass the reference if the inner
class is not static.
Change-Id: I8493929cafdbd80968989b422af0f956fa65681a
When there's an exception during the inflation of a framework view (for
example invalid attributes), report the exception correctly. The earlier
behaviour assumed the exception to be a ClassNotFoundException and tried
to load it from the user's project. This is not longer the case.
Also, update the MockView class to a FrameLayout with a single TextView.
This means that the MockView is a ViewGroup and will not choke when
someone attempts to add a View to it (although, the view will be
silently dropped).
Change-Id: Ice003817ceb627ebfbbbb245ab6be10f9141e728
The conversion of the PorterDuff mode from int to enum was incorrect
resulting in the wrong PorterDuff Mode being used.
Change-Id: I7607d505b6e4382e6101869971154f6a77db279c