If the preferred ColorModel doesn't support alpha, the shadows are
incorrectly rendered. In the theme editor on Linux, the graphics device
object doesn't support alpha so we need to use a different color model.
We default to ARGB which works fine.
Change-Id: I3e71e3d086fa4975a9149d36792e574813f37dfd
Adds the widgets needed by the theme editor as a jar file that will be
linked from AS. The controls currently are:
- ThemePreviewLayout: A custom layout that allows to dynamically reflow
cards that display the theme preview.
- PressedButton: Custom button to display in a pressed state (currently
we can only do it programatically).
- ErrorCatcher: View that can wrap other view and stops a view throwing
exceptions that will break the theme editor rendering. This is
currently used to wrap the custom controls loaded from the source
code.
The new library currently depends on bridge to be able to use the logger
for the ErrorCatcher view. The ErrorCatcher view is a temporary solution
that will be replaced in a future CL and the dependency will be removed.
Change-Id: I832c447e22e1381abff74c46c4282921b3f6fa23
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
Drawing empty rects results in IllegalArgumentException on Mac JRE 1.6.
Prevent that by checking the bounds before attempting to draw the rect.
Bug: 20687353
Change-Id: I45f48ee125196480bb6510cc49b24d2122bc3e48
+ 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)
When the theme does not longer exists on the Android Studio side,
getDefaultTheme will return null causing isThemeAppCompat to crash.
Change-Id: I5a5c17126dce72e9872522643219b9438666bc04
- Add another layout including more widgets and thus testing layoutlib
better.
- Update targetSdk Version to 22.
- Handling of dynamic ids (@+id/) in LayoutLibTestCallback is buggy.
Since this is not a problem in Studio, and this is not testing the
callback, work around the issue by declaring the ids in
values/ids.xml.
Change-Id: I457c105e8556c4df13cd86da2250fe5fd37843a8
- 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
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
- Change the guava version used to match the one included in the SDK.
The test server uses the same. However, the command line build still
uses the guava present at platform/external/guava, which is compiled
with Java 7. Thus, running the tests from inside the IDE can be done
via Java 6.
- Rebuilt the test app classes with Java 6 compatibility.
- Change similarity threshold to prevent differences due to some locale
settings different java versions.
Change-Id: Ic71d43256a8cf6f9df296e63550667a202c7105f