1531 Commits

Author SHA1 Message Date
Diego Perez
635d8f4fe7 Fix crash when shadowSize is 0
Change-Id: I9f131afc95a2571fbc8a737df37f43653cfbb90d
(cherry picked from commit e81096458f689ab3c0c4dbab2452722c3e3623c4)
2015-05-08 02:01:53 +01:00
Diego Perez
4b12583653 Merge "Added function to render a drawable in all available states" into lmp-mr1-dev 2015-05-07 02:28:51 +00:00
Andrew Shulaev
681c7d142a Added function to render a drawable in all available states
This reverts commit 01cdf8b135be3bf67b9386dc929109c3db82c730.

Change-Id: I596855047d78c3c718744ad61432fc45e1239634
(cherry picked from commit 1f158819bc7cf58f97e47fabfaf23b2fb838f2eb)
2015-05-07 02:05:48 +01:00
Diego Perez
0e20bd8e50 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.
2015-05-07 00:14:26 +00:00
Diego Perez
263e6dfa6a Merge "Make status and navigation bars widgets and usable from layouts" into lmp-mr1-dev 2015-05-06 23:52:06 +00:00
Diego Perez
19dbe50bb5 Merge "Move StatusBar to use statusBarColor theme attribute" into lmp-mr1-dev 2015-05-06 23:45:41 +00:00
Diego Perez
bc47abe4b4 Merge "Make sure shaders use a color model compatible with the destination." into lmp-mr1-dev 2015-05-06 23:43:50 +00:00
Deepanshu Gupta
1f8e3de40c Merge "More layoutlib tests." into lmp-mr1-dev 2015-05-06 23:43:15 +00:00
Deepanshu Gupta
b4ca896f05 Merge "RecyclerView in LayoutLib: better XML attrs." into lmp-mr1-dev 2015-05-06 23:42:56 +00:00
Diego Perez
1bc7fb2dcc Merge "Fix isThemeAppCompat NPE when using an invalid theme" into lmp-mr1-dev 2015-05-06 23:42:35 +00:00
Deepanshu Gupta
4f8a999682 Merge "Nullity annotations to some tests." into lmp-mr1-dev 2015-05-06 23:42:20 +00:00
Deepanshu Gupta
92e798682b Merge "Fix title bar showing when not required." into lmp-mr1-dev 2015-05-06 23:42:01 +00:00
Deepanshu Gupta
0aa004c3cf LayoutLib: fix crash when shadow size <=0.
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
2015-05-01 21:38:02 +00:00
Diego Perez
d0546353a8 Move StatusBar to use statusBarColor theme attribute
Change-Id: Ic0d8f4520a6dcb7225a2947cc56dc06a7340d3ba
2015-04-30 16:28:06 +00:00
Diego Perez
8ff8de2cf2 Add new parameter to the render method to allow forcing a measure pass.
Change-Id: I60c09f3375fc85c257a449f4372220741e01db54
(cherry picked from commit c13aa0c035cd226d27323bc0e533632ba32f6a84)
2015-04-28 08:52:08 +00:00
Diego Perez
f3cb4ba213 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)
2015-04-22 09:51:06 +01:00
Diego Perez
9b39c49bfc Make status and navigation bars widgets and usable from layouts
This will allow the theme editor to render these components
separately.

Change-Id: I8b2e0e78039b44623152e34f68ffcdfab5aa9885
2015-04-21 17:50:28 +01:00
Diego Perez
6aa5a44d9b 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
2015-04-21 11:33:55 +01:00
Deepanshu Gupta
a035dfbf8d More layoutlib tests.
- 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
2015-04-16 15:50:31 -07:00
Deepanshu Gupta
2bc2daa74e 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
2015-04-16 12:00:30 -07:00
Deepanshu Gupta
eca0b3d9ec Nullity annotations to some tests.
Change-Id: I2939d7fab30f3b8fe32f2fdf720c630d677373ff
2015-04-16 12:00:30 -07:00
Deepanshu Gupta
666748728f Fix title bar showing when not required.
Bug: http://b.android.com/166383
Change-Id: I5ea051ffdbf9a2d73a83f62d56a0f4006b014348
2015-04-16 11:59:04 -07:00
Deepanshu Gupta
54862febaf Update golden image for tests.
Change-Id: If07edcbfb7016a6b80f4bd00cffab494f74bfc03
2015-04-15 18:20:57 -07:00
Deepanshu Gupta
37dbb8b7f3 Update to using LayoutlibCallback.
Change-Id: Ia89d418b0d40ca8efef8968a4a2a635616b945ac
2015-04-15 18:20:56 -07:00
Deepanshu Gupta
49ce36e175 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
2015-04-15 18:20:55 -07:00
Deepanshu Gupta
9ca9774726 Add @empty support.
Bug: http://b.android.com/162428
Change-Id: Id7a981de2fce21213e12cdabcce4104f146fd4d3
2015-04-15 18:20:47 -07:00
Diego Perez
2d3449f982 Make sure shaders use a color model compatible with the destination.
Change-Id: Iaf6e14bb86835c36a5b0c37519ac2ee794d10081
(cherry picked from commit 158ac454073a460375123d7d05152a7c6490efb6)
2015-04-15 14:23:09 +00:00
Deepanshu Gupta
4e6ae02a29 am 17bb697b: am ec8df9af: Fix tests for Java 6.
* commit '17bb697b3bce1b23137553829dd62e0e7c16b472':
  Fix tests for Java 6.
2015-03-27 01:09:53 +00:00
Deepanshu Gupta
17bb697b3b am ec8df9af: Fix tests for Java 6.
* commit 'ec8df9af2f35eb5be4df01d66b1add4a4e7546c7':
  Fix tests for Java 6.
2015-03-27 01:02:58 +00:00
Deepanshu Gupta
ec8df9af2f Fix tests for Java 6.
- 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
2015-03-26 12:29:36 -07:00
Deepanshu Gupta
862f5900e8 am 44b5a1c8: am e541f350: Merge "Update JRE for runConfigurations." into lmp-dev
* commit '44b5a1c8471ef5e1cd3dcfffec5a9e439f228766':
  Update JRE for runConfigurations.
2015-03-25 00:02:18 +00:00
Deepanshu Gupta
e97079d97a am a16bb347: am 44fea603: Merge "Fix RoundRect radius." into lmp-dev
* commit 'a16bb347e120ba17e87f33ff0364380211d01baf':
  Fix RoundRect radius.
2015-03-25 00:01:58 +00:00
Deepanshu Gupta
2b98abde26 am 8f9ebc65: am 3bd5cbb1: Merge "Use right colors for status bar and nav bar." into lmp-dev
* commit '8f9ebc65939ed3ac2e7fdc135e8513fd8d65daaf':
  Use right colors for status bar and nav bar.
2015-03-25 00:01:53 +00:00
Deepanshu Gupta
6fa9d5546f am 0b76cf6f: am 34751c79: Merge "Better shadows." into lmp-dev
* commit '0b76cf6ff56c59a04783714d40163576e3081cf1':
  Better shadows.
2015-03-25 00:01:49 +00:00
Deepanshu Gupta
5bc625d83d am a62a18e3: am 311a0f54: Merge "Fix layoutlib tests." into lmp-dev
* commit 'a62a18e341180ccf6f5379a7d753584f6cee2e7c':
  Fix layoutlib tests.
2015-03-25 00:01:43 +00:00
Deepanshu Gupta
44b5a1c847 am e541f350: Merge "Update JRE for runConfigurations." into lmp-dev
* commit 'e541f35055709ec43407649b8517639ff00e42d6':
  Update JRE for runConfigurations.
2015-03-24 23:55:18 +00:00
Deepanshu Gupta
cbb4ec7867 am 6f5fac81: Merge "Fix project settings. [DO NOT MERGE]" into lmp-dev
* commit '6f5fac817abee63d9211e8e43646196950c43707':
  Fix project settings. [DO NOT MERGE]
2015-03-24 23:55:14 +00:00
Deepanshu Gupta
a16bb347e1 am 44fea603: Merge "Fix RoundRect radius." into lmp-dev
* commit '44fea60376e4e851b07eb365fd581c5b9404611f':
  Fix RoundRect radius.
2015-03-24 23:55:10 +00:00
Deepanshu Gupta
8f9ebc6593 am 3bd5cbb1: Merge "Use right colors for status bar and nav bar." into lmp-dev
* commit '3bd5cbb1f3d837d7799fb4b33b4dda99adbeeeb4':
  Use right colors for status bar and nav bar.
2015-03-24 23:55:06 +00:00
Deepanshu Gupta
0b76cf6ff5 am 34751c79: Merge "Better shadows." into lmp-dev
* commit '34751c79d6696054b19b5fd0e2946c1dbe5bd9bd':
  Better shadows.
2015-03-24 23:55:02 +00:00
Deepanshu Gupta
a62a18e341 am 311a0f54: Merge "Fix layoutlib tests." into lmp-dev
* commit '311a0f54ac95a1649474498748fff8327b0c917d':
  Fix layoutlib tests.
2015-03-24 23:54:58 +00:00
Deepanshu Gupta
e541f35055 Merge "Update JRE for runConfigurations." into lmp-dev 2015-03-24 23:52:29 +00:00
Deepanshu Gupta
6f5fac817a Merge "Fix project settings. [DO NOT MERGE]" into lmp-dev 2015-03-24 23:52:18 +00:00
Deepanshu Gupta
44fea60376 Merge "Fix RoundRect radius." into lmp-dev 2015-03-24 23:51:50 +00:00
Deepanshu Gupta
3bd5cbb1f3 Merge "Use right colors for status bar and nav bar." into lmp-dev 2015-03-24 23:51:30 +00:00
Deepanshu Gupta
34751c79d6 Merge "Better shadows." into lmp-dev 2015-03-24 23:51:11 +00:00
Deepanshu Gupta
00c2adf5db Better shadows.
Better shadows for rectangles and rounded rectangles (includes circles).

The shadow painting code is mostly from CardView library, but modified
heavily since CardView needs to draw the shadow inside view bounds.

Change-Id: I88c9f19b1c16839b8d6db6df2bebff126fa5a9a3
2015-03-24 14:06:49 -07:00
Deepanshu Gupta
7c834296ac Fix RoundRect radius.
Android APIs use radius for measuring the corner's curvature, but Java2D
APIs use diameter. Add the missing conversion.

Change-Id: I630fc8712e8301324c641885c0c4adf644d13b7e
2015-03-24 11:43:39 -07:00
Deepanshu Gupta
58ca246c83 Use right colors for status bar and nav bar.
Bug: http://b.android.com/81862
Change-Id: Ia10297e83e54c01a50de6cbcac2b7fef48e8d238
2015-03-22 11:03:44 -07:00
Deepanshu Gupta
4f3b8527e3 Update JRE for runConfigurations.
The intensive bridge tests use some libraries that are compiled with
1.7. All other tests are capable of running on JRE 1.6. Thus, change the
run configurations appropriately.

Change-Id: Iaea0fef2e58877578b36ac2ffe0b20b3a55f572c
2015-03-18 17:03:15 -07:00