28 Commits

Author SHA1 Message Date
Diego Perez
abb080d749 Fix support for enum attributes in BridgeContext
Test: Updated BridgeXmlPullAttributesTest
Bug: http://b.android.com/231347
Change-Id: I5fd8b46155ccea6c9b65787f311a0887fa4b4806
2017-02-07 10:29:09 +00:00
Diego Perez
9b34676d5d Create new layoutlib-legacy to be included in the SDK
This version of the jar file only contains a Bridge that returns an
error (or an image if you ask for it) contaning a message that says that
the SDK version of layoutlib is not supported.

Test: Manually tested
Change-Id: I3d24df86a3112c52858649c3286270a31496961b
2016-12-19 12:03:49 +00:00
Jerome Gaillard
41bcee32fe Fix path to JUnit jar for IDEA module in layoutlib
Necessary after change in makefiles from AOSP commits 21cf84f8b3
and 4a064d2010.

Test: Run layoutlib tests from IDEA
Change-Id: I7359c5f41726972c45ff99f34ed5ecb036946034
2016-12-09 14:55:14 +00:00
Diego Perez
3c4aed26e6 Remove inspection_tool from inspectionProfiles
Change-Id: I8aae3c2d6d46340fa3b4b27c9f217a7f1266d37d
(cherry picked from commit c5c7beca5292bfa248340059401f05e9d687bb2e)
2016-06-27 18:31:31 +00:00
Deepanshu Gupta
60dc3a9917 LayoutLib intellij codestyle: line wrap
Force line wrap (do not exceed right margin) and allow shorter lines to
merge.

Change-Id: I06f3689bff710c8dec023edb842595eacd745c17
2016-03-24 14:27:27 -07:00
Diego Perez
566b303365 Add support for GradientColor in layoutlib
Change-Id: Ia9a55a9e00d7ddb5263f3dbe46b5da8dde457526
2016-03-07 09:11:11 +00:00
Deepanshu Gupta
dbe8a0fe3b LayoutLib: Reference android's junit in intellij project.
Prevents errors due to mismatch in junit version.

Change-Id: I2adf32efb16472aa5f5e51025b6bb75afc76a8b4
2016-03-02 13:26:18 +00:00
Deepanshu Gupta
491523d52c LayoutLib fixes for N
Moves LayoutLib to Java 8 - YAY!
Fix delegates

Change-Id: I098996e43e330e995d33f12df1c16355bbc02f0f
2016-02-18 02:10:24 +00:00
Deepanshu Gupta
23e47f5621 Java 8 in layoutlib-create
Upgrade to ASM 5 and diamond operators.

Also minor fixes here and there.

Bug: 26442940
Change-Id: I5611ed0889aa94cca8655fec47799e1ddccb0150
2016-01-08 08:03:06 -08:00
Deepanshu Gupta
22931224d9 LayoutLib: IntelliJ changed project files.
Change-Id: I1f99ab678067c26ba2e9938c9dce40c99a6725c3
2015-11-17 11:37:35 -08:00
Deepanshu Gupta
b556decf75 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
2015-08-06 16:04:04 -07:00
Diego Perez
b39e85afb1 am ce5a79da: am d717682d: am 5c597c1d: am a8854564: am ce4a9d91: Merge "New custom widgets library" into lmp-mr1-dev
* commit 'ce5a79dacfb152317429cb69c28fe8bb39c02f4c':
  New custom widgets library
2015-06-15 15:47:44 +00:00
Deepanshu Gupta
476e582d2f 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
2015-05-22 17:57:29 -07:00
Deepanshu Gupta
fc41c2c02e Move couple of intellij libraries to project level.
Move framework and layoutlib api libraries back to being project
libraries so that other modules can depend on it. This enables custom
widget libraries project to merge through cleanly.

Change-Id: I4f00d6fb378a80662f32491a2b0061d6bf61899f
2015-05-14 15:12:57 -07:00
Diego Perez
aa3b2043f0 New custom widgets library
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
2015-05-14 23:01:09 +01:00
Deepanshu Gupta
4ebbfd7787 Fix build.
When doing the full build, javalib.jar wasn't created. However, mm had
created the javalib.jar. Fix the build by not depending on javalib.jar,
but on classes.jar

Change-Id: I643676b1d73cbfce42946a065a2ada6c50cc959a
2015-05-13 22:18:37 -07:00
Deepanshu Gupta
eca056926a Load ICU data in LayoutLib
Also return the correct version numbers for ICU data.

Change-Id: I7de973b5553c73948870b97bdc12a880bb2fdd85
2015-05-13 18:15:32 -07:00
Deepanshu Gupta
d77b9ed7dc 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
2015-05-13 18:15:20 -07: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
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
Deepanshu Gupta
6092c044aa Fix project settings. [DO NOT MERGE]
1. Update layoutlib_api source path.
2. Update jdk version
3. Update nullity annotations.

Change-Id: I48db7dbd7ba5ff02fcf11672608b75e072385166
(cherry picked from commit 7b2cae5072321da5d67f9d12dea10871326f3477)
2015-03-18 16:59:49 -07:00
Deepanshu Gupta
d68448a601 Fix codestyle for switch statements.
Fix intellij's codestyle settings for indenting switch/case statement.

Change-Id: I905231538fef0fcd7fa4e742f937b8da34f2e30f
2015-02-26 14:32:30 -08:00
Deepanshu Gupta
19740a6212 Changes made by intelliJ 14.1
Change-Id: Ia130266ad994ef327629db25a18f9d5702b983f4
2015-02-04 11:17:33 -08:00
Deepanshu Gupta
eae390a94e Add DatePicker, CalendarView to LayoutLib tests
Change-Id: Ice8c41ff90ccb0ffe90fcbfcccc91ea24225a3d9
2015-01-02 11:20:19 -08:00
Deepanshu Gupta
8c766fea93 Update IntelliJ project file for IntelliJ 14
IntelliJ keeps reordering the options this way each time the project is
opened.

Change-Id: I0e19b5b0a858b3fa9a1134b883ed5180c4ef146e
2014-09-08 14:49:49 -07:00
Deepanshu Gupta
0774bc4605 Remove ANDROID_BUILD_TOP from intelliJ path variables.
The variable is not actually needed and it makes working with different
API levels a lot easier since everything now depends on $PROJECT_DIR$.

This change also makes the tests more robust by improving the way it
tries to find the SDK.

Change-Id: I3502ad4a0ba85fd88b497e47964fddb2a89e520c
2014-08-25 15:47:28 -07:00
Deepanshu Gupta
2e7a0355b4 Update intelliJ copyright profile
Change-Id: Ib9386b686cb24e1f187d0b636b59b4b13d59bbcd
2014-08-13 22:52:02 +00:00
Deepanshu Gupta
86eb8b4e29 Add testing framework to LayoutLib.
This change adds an end to end test which loads the framework resources
and a test app and ensures that no exceptions or warnings are thrown.

The change also adds project configuration for intelliJ.

Change-Id: I7b67c0f1a2af2dac95df7f3231cab537b9826d7d
2014-08-04 22:58:39 +00:00