summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/create
Commit message (Collapse)AuthorAgeFilesLines
* Fix delegation of methods within inner static classesDiego Perez2015-11-135-5/+125
| | | | | | | | | 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
* LayoutLib: Fix ring rendering.Deepanshu Gupta2015-10-071-0/+1
| | | | | Bug: http://b.android.com/65503 Change-Id: I6ed901703cffee345f3083ea3ddeb52a28f4ac64
* Implement Path.approximate and add PathMeasure supportDiego Perez2015-10-071-1/+1
| | | | | | | | | | | PathMeasure is needed to use the trimPath* properties in drawables. These properties are used in the vector drawable for indeterminate progress bars in Material so this is needed to be able to render them correctly in the preview. PathMeasure makes use of Path.approximate to calculate which segments to paint. Change-Id: Ic513f0a30a6aac0317f7c13cd75e9154c37405c8
* LayoutLib: Switch SimpleDateFormat to icu.Deepanshu Gupta2015-08-065-14/+124
| | | | | | | | | | | | 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
* Replace Locale.getDefault with custom impl.Deepanshu Gupta2015-08-061-2/+6
| | | | | | | | | | 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
* Include EpicenterTranslateClipReveal in LayoutLibDeepanshu Gupta2015-07-291-0/+1
| | | | | | Needed by Spinner to create transitions that are then ignored :) Change-Id: Ibe7167a643ecb186e97c9af446c0e1d2eb2d6f86
* Revert "Replace infinite loop with foreach."Deepanshu Gupta2015-07-071-2/+8
| | | | | | | | | | | This reverts commit c77f9c76e4142db8dd76a28ad99b8f0395b82eba. Class.getDeclaredClasses() doesn't return anonymous inner class and hence the change was wrong. The revert doesn't undo the typo fixed in the original change. Change-Id: Id0595c4bc3db1185dd1ce39808a6b8c3610a1e11
* Replace infinite loop with foreach.Deepanshu Gupta2015-06-301-8/+2
| | | | | | | | | A method call exists to find all inner classes. Use it instead of manually enumerating the possibilities and checking. Also fix a typo. Change-Id: I2af678e92ea0c11b53617b247d8cda324391c185
* LayoutLib: Skip classes from java package.Deepanshu Gupta2015-06-011-1/+3
| | | | | | | Classes in "java" package can't be defined at runtime anyway. No use including them in LayoutLib. Change-Id: I7e7c46f0d74e32c893b23093828569b4fa5e3a73
* Merge "Include Shapes in LayoutLib." into mnc-devDeepanshu Gupta2015-05-261-3/+1
|\
| * Include Shapes in LayoutLib.Deepanshu Gupta2015-05-261-3/+1
| | | | | | | | Change-Id: Ifb32882c478f8d407ad904e224b67fe2bd65dc08
* | LayoutLib: Change nullity annotations.Deepanshu Gupta2015-05-221-0/+2
|/ | | | | | | | | | | | | 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
* Make DatePicker rendering not fail.Deepanshu Gupta2015-05-201-0/+1
| | | | | | | | | | | | Ensures that having a DatePicker in the layout doesn't crash the complete rendering. The rendering is still not perfect, but at least it works. - Return a non-null window token so that ViewPager thinks that it's attached to a window and doesn't skip populating the views. - Fix a style not found issue. Change-Id: Ied2b71de5b32bcb640bf4ec445e8a39509f800e9
* Inject anonymous inner classes of injected classesDeepanshu Gupta2015-05-204-11/+32
| | | | | | | | | When injecting classes in LayoutLib (eg. CreateInfo), so that LayoutLib can refer back to the changes, also inject the anonymous inner classes. Without this, the injected classes are not loadable. Although, LayoutLib itself doesn't load these classes, but some tests do. Change-Id: Ib5f6b779ef4d79dec8d614d3dbb26eeac88a1064
* Make Context.getClassLoader() work.Deepanshu Gupta2015-05-198-27/+324
| | | | | | | | | | | | | | | | | | | | | 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
* Load ICU data in LayoutLibDeepanshu Gupta2015-05-131-0/+1
| | | | | | Also return the correct version numbers for ICU data. Change-Id: I7de973b5553c73948870b97bdc12a880bb2fdd85
* Add missing delegates for M preview.Deepanshu Gupta2015-05-133-4/+14
| | | | | | | | | | | | | - 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
* Split up android.policy into framework.jar and services.jar 1/3Jorim Jaggi2015-02-101-1/+0
| | | | Change-Id: Ifd69f1f3dd308a7e17a1442e2f3950da8b03cec4
* am 2d14feb4: Merge "Replace java.util.LinkedHashMap.eldest()" into lmp-mr1-devDeepanshu Gupta2015-01-083-2/+68
|\ | | | | | | | | | | | | automerge: 03c822a * commit '03c822aa585c319fb9cd05f392d8518501cc4f79': Replace java.util.LinkedHashMap.eldest()
| * Replace java.util.LinkedHashMap.eldest()Deepanshu Gupta2015-01-073-2/+68
| | | | | | | | | | | | | | Provide an alternate implementation for the above method and replace the calls to it, since the method is not available on host VM. Change-Id: I329d86b457d1859b137da8fb2790ddd7f8efa788
* | resolve conflict for 8c831b2f -> lmp-mr1-dev-plus-aosp againDeepanshu Gupta2015-01-061-1/+0
|/ | | | | | | The earlier resolution (a2a5ce49b29b8e3bf3cd695ff9f968e5579f4be2) wasn't the right one. This fixes it. Change-Id: I6a6dc908d3e7dd510064a46df932d129a58eed98
* am 0db2524c: am b2ebb968: Merge "Remove Time from CreateInfo" into lmp-devDeepanshu Gupta2015-01-061-1/+0
|\ | | | | | | | | * commit '0db2524caa01022629075a113d3370a1b7c3da30': Remove Time from CreateInfo
| * Remove Time from CreateInfoDeepanshu Gupta2015-01-021-1/+0
| | | | | | | | | | | | | | | | | | Time_Delegate was removed in change with Change-Id: Iae5ef65678f0e6c7c5af520c45bd15980ce3fa55. But the name wasn't removed from CreateInfo. This didn't cause any problems at runtime, but caused the layoutlib_create tests to fail. Change-Id: I079b1e024b97d389eb07d4f088fd860efbb02eb3
* | am cec8e5a1: am f861c0ce: Merge "Fix default initial value for preferences" ↵Deepanshu Gupta2015-01-061-1/+0
|\ \ | |/ | | | | | | | | | | into lmp-dev * commit 'cec8e5a10de413c733223b8b1cc11b70c6254647': Fix default initial value for preferences
| * Fix default initial value for preferencesDeepanshu Gupta2014-12-231-1/+0
| | | | | | | | | | NO_SQ: Depends on unsubmitted changes. Change-Id: I061cf71f6167d382e9ef060abeb4d5cff83c4104
* | am 7ed14549: am 7081a114: Merge "Add preferences rendering." into lmp-devDeepanshu Gupta2015-01-062-0/+4
|\ \ | |/ | | | | | | * commit '7ed145493d3f5bea32c567980f77cc42f613197e': Add preferences rendering.
| * Add preferences rendering.Deepanshu Gupta2014-12-232-0/+4
| | | | | | | | | | NO_SQ: Depends on updating layoutlib-api-prebuilt.jar Change-Id: Iae93ab74c478e6f2158e1528467bec9ee2d7ee9b
* | resolved conflicts for a0bc2e7e to lmp-mr1-devDeepanshu Gupta2014-12-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original change wasn't properly merged into lmp-mr1-dev because of merge conflicts. This change manually resolves the conflicts. The main reason for the conflict was that TimePickerSpinnerDelegate was swapped with TimePickerClockDelegate. This change also fixes the typo in the original change which was fixed in a subsequent change. Original commit: 12b6d29b7b5592dcfb6e6fd6f0c21a40f37d014a fix for typo: cb09bc45c58740af953874f9915306d351fc3d9d Change-Id: I50bf8c2d86318f632465a38adfad16d1382a9319
* | am 4628d51a: am 141c7614: Merge "Fix AnalogClock rendering" into lmp-devDeepanshu Gupta2014-12-043-31/+99
|\ \ | |/ | | | | | | * commit '4628d51a0d01641ca7fe2cf8403ad551ea6f50ce': Fix AnalogClock rendering
| * Fix AnalogClock renderingDeepanshu Gupta2014-11-263-31/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Change calls to java.lang.System.log* since they don't exist on the host. 2. Clean up method rewrite mechanism in ReplaceMethodCallsAdapter. 3. Stub out creation of uninitialized GregorianCalendar. 4. Memory map the time zone data base file and provide a custom implementation of BufferIterator for use by ZoneInfoDB 5. Delete unused Time_Delegate Also fixed a comment in BridgeAssetManager and an error message in FontFamily_Delegate. Bug: http://b.android.com/79160 Change-Id: Iae5ef65678f0e6c7c5af520c45bd15980ce3fa55
| * LayoutLib: Stub AM/PM keycodes in Time Picker.Deepanshu Gupta2014-11-181-0/+1
|/ | | | | | | | | TimePickerSpinnerDelegate doesn't need to deal with input when running inside LayoutLib. So, we just return the keycodes as if it's running in English locale. Bug: http://b.android.com/79189 Change-Id: Ife0ae91a1e34a8dac379bc1dda1c1c8ed461c164
* Don't skip loading object animator.Deepanshu Gupta2014-11-111-0/+1
| | | | | | This is used by Buttons as part of StateListAnimator. Change-Id: Id370869e71898d46e11bbd17ad31169c9f9f5274
* Add primitive shadows support to LayoutLibDeepanshu Gupta2014-11-071-0/+5
| | | | | | | | | | | | | | | The shadows rendered are not the same as rendered by the framework. The main purpose of the shadows here is let the user know when shadows will be cast. Currently rectangular shadows are available in only two intensities. Any elevation below 10dp uses one shadow and any elevation over 10 dp uses the other. Also, even though the code for arbitrary shapes exist, it doesn't quite work yet. No shadows are visible when that code is run. Change-Id: Ie8235ffccf1d3809713f5d8f82afde434817d6b2
* Merge "Skip loading animations." into lmp-devDeepanshu Gupta2014-10-291-0/+1
|\
| * Skip loading animations.Deepanshu Gupta2014-10-281-0/+1
| | | | | | | | | | | | | | This is a temporary fix until Path.approximate() is supported. Bug: http://b.android.com/77865 Change-Id: I28739e58f51fabaaf1dcc1c9be61cd0b17e84eec
* | Fix multiple styles case in resource resolution.Deepanshu Gupta2014-10-281-1/+0
|/ | | | | | | When multiple styles are applied to a theme, we only remembered the last one. This change fixes the issue. Change-Id: I46490e882edc3eabe522a641c83366234b5bb25d
* am 4f133894: Exclude KXmlParser from LayoutLib.Deepanshu Gupta2014-10-085-22/+125
|\ | | | | | | | | * commit '4f133894a6e98d8d30557ea42cec92cfb21fa5c9': Exclude KXmlParser from LayoutLib.
| * Exclude KXmlParser from LayoutLib.Deepanshu Gupta2014-10-085-22/+125
| | | | | | | | | | | | The class was incorrectly being included in the LayoutLib. Change-Id: I3c86662efa068019fe9165f2fc49a00d0a1b7f2d
| * LayoutLib: Use ICU's line break algo. [DO NOT MERGE]Deepanshu Gupta2014-10-081-0/+1
| | | | | | | | | | Change-Id: I7e5b0ab7423a72f5a4b0e1163d0a537f0b03ba07 (cherry picked from commit 760f6394d0f65fbb5365186e8e068d53c506b653)
| * Build layoutlib create tests as part of sdk build. [DO NOT MERGE]Deepanshu Gupta2014-10-011-0/+3
| | | | | | | | | | | | | | LayoutLib Create tests are now built whenever LayoutLib create is built. Change-Id: Id215e8690e435019579dba1734090a0d585f37e1 (cherry picked from commit 4efe6264f1251fa200427f54ea6f5dd4c4d03665)
| * Add layoutlib tests to DIST_DIR [DO NOT MERGE]Deepanshu Gupta2014-10-011-0/+3
| | | | | | | | | | | | | | | | Add the layoutlib and layoutlib-create tests to DIST_DIR for sdk targets. These can be used for continuous testing on the build server. Change-Id: I747dddcddfd8009937668bec4d75cb99bf63235f (cherry picked from commit f9c749c9901c459f77ffc6f4fbbc15f4142c6e0a)
| * Build layoutlib_create tests. [DO NOT MERGE]Deepanshu Gupta2014-10-011-0/+32
| | | | | | | | | | Change-Id: Ia13a090f8ec29b2b2a107825b6a13d7db77e6d61 (cherry picked from commit 2294f939bc79ce902a40db37def64cc28394d56b)
| * Add testing framework to LayoutLib. [DO NOT MERGE]Deepanshu Gupta2014-10-011-0/+18
| | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit a8e9517470869fa29946ae1fa1ceeb24c7970391)
| * am 904d7711: am 7b561be3: am 09c3c2ed: am ba31d628: am db94ea9e: am ↵Deepanshu Gupta2014-08-061-1/+1
| |\ | | | | | | | | | | | | | | | | | | f970d2c2: am 79c3f678: am 206c691b: am 72cf03a2: am 3a544a81: resolved conflicts for merge of a232a68d to jb-mr1.1-docs * commit '904d77118bab63139174470ef728ca9a53e75a15': Fix SystemProperties in LayoutLib.
| | * am 09c3c2ed: am ba31d628: am db94ea9e: am f970d2c2: am 79c3f678: am ↵Deepanshu Gupta2014-08-061-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | 206c691b: am 72cf03a2: am 3a544a81: resolved conflicts for merge of a232a68d to jb-mr1.1-docs * commit '09c3c2edb2391d3ffed9a07ec360b9f75b9f7637': Fix SystemProperties in LayoutLib.
| | | * am f970d2c2: am 79c3f678: am 206c691b: am 72cf03a2: am 3a544a81: resolved ↵Deepanshu Gupta2014-08-061-1/+1
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conflicts for merge of a232a68d to jb-mr1.1-docs * commit 'f970d2c201649843b8d51d094b865f16b15bc0bc': Fix SystemProperties in LayoutLib.
| | | | * am 79c3f678: am 206c691b: am 72cf03a2: am 3a544a81: resolved conflicts for ↵Deepanshu Gupta2014-08-061-1/+1
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge of a232a68d to jb-mr1.1-docs * commit '79c3f678d21f6b3c058623217cbe5dd57a553fe8': Fix SystemProperties in LayoutLib.
| | | | | * am 3a544a81: resolved conflicts for merge of a232a68d to jb-mr1.1-docsDeepanshu Gupta2014-08-061-1/+1
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3a544a81b3d2d529b2995f4b5db2077760d440b5': Fix SystemProperties in LayoutLib.
| | | | | | * resolved conflicts for merge of a232a68d to jb-mr1.1-docsDeepanshu Gupta2014-08-061-1/+1
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1ea220e3e0a81880db68abab87beab56dc4a336c
| | | | | | | * resolved conflicts for merge of 5476cfee to jb-mr1-devDeepanshu Gupta2014-08-061-1/+1
| | | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5197271e6fdd36fed9ca9f9b7221d9a99141a4b4