summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge/src/android
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Revert "Revert "Update StaticLayout_Delegate to use new ↵Deepanshu Gupta2015-11-192-4/+6
|\ | | | | | | nLoadHyphenator""" into mnc-ub-dev
| * Revert "Revert "Update StaticLayout_Delegate to use new nLoadHyphenator""Deepanshu Gupta2015-11-192-4/+6
| | | | | | | | | | | | | | | | | | | | This reverts commit 65a834980cdbb9407a3f27e48cd0a8c472182cd6. The original revert was only for cherry-pick to release branch. Change-Id: Ib78f9a06ce49681c767f65b262058f18a670e38e
* | Merge "Revert "Update StaticLayout_Delegate to use new nLoadHyphenator"" ↵Deepanshu Gupta2015-11-192-6/+4
|\ \ | |/ | | | | into mnc-ub-dev
| * Revert "Update StaticLayout_Delegate to use new nLoadHyphenator"Deepanshu Gupta2015-11-192-6/+4
| | | | | | | | | | | | | | | | This reverts commit 631c2ffd6ff1bfa7463d29a39a7ee74be019b3f9. The revert is only for cherry-pick back to mnc-sdk-release. Change-Id: I42cb392528b7890b58d689c732f90c3b9ba5f74c
* | Improve error reporting on Exceptions in fw views.Deepanshu Gupta2015-11-121-16/+27
|/ | | | | | | | | | | | | | 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
* Update StaticLayout_Delegate to use new nLoadHyphenatorDiego Perez2015-11-042-4/+6
| | | | | | Small fix to update call parameters Change-Id: I4322aa212493ec2970ae17ec1918b9b7e2f8e93a
* LayoutLib: Fix android:dependency for preferences.Deepanshu Gupta2015-10-091-5/+2
| | | | | Bug: http://b.android.com/189314 Change-Id: I229632d11a2529e865f3f2e8eca3a78b47ad462c
* LayoutLib: Fix ring rendering.Deepanshu Gupta2015-10-071-0/+73
| | | | | Bug: http://b.android.com/65503 Change-Id: I6ed901703cffee345f3083ea3ddeb52a28f4ac64
* Merge "Skip drawing empty shapes to keep Apple JRE happy." into mnc-ub-devDeepanshu Gupta2015-10-071-0/+8
|\
| * Skip drawing empty shapes to keep Apple JRE happy.Deepanshu Gupta2015-10-071-0/+8
| | | | | | | | | | Bug: http://b.android.com/178278 Change-Id: I693912678ed79e9c6690560b618a605da5a807c6
* | Implement Path.approximate and add PathMeasure supportDiego Perez2015-10-073-103/+245
|/ | | | | | | | | | | 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: Fix bitmap scaling.Deepanshu Gupta2015-10-052-1/+8
| | | | | Bug: http://b.android.com/187939 Change-Id: I20bf61746e8af3bb87ba9cfcc9bf58854ac7c5be
* Merge "Reduce the amount of allocations on Paint_Delegate" into mnc-ub-devDiego Perez2015-09-302-19/+61
|\
| * Reduce the amount of allocations on Paint_DelegateDiego Perez2015-09-302-19/+61
| | | | | | | | | | | | | | | | | | | | When the text properties of the Paint object are updated, or when .set() is called, updateFontObject will be called. This method is currently at the top of the methods for number of allocations. This CL reduces the number of calls to updateFontObject by a 90%, reducing the number of Font allocations. Change-Id: I3e232f9e6e230da8ecdd19921faadf2d3f4ff763
* | Merge "Support databinding in listitem layouts." into mnc-ub-devDeepanshu Gupta2015-09-302-2/+2
|\ \ | |/ |/|
| * Support databinding in listitem layouts.Deepanshu Gupta2015-09-292-2/+2
| | | | | | | | | | | | | | | | Add a wrapper around the PullParser to support stripping out databinding parts. Bug: http://b.android.com/187428 Change-Id: I88080d8f4108cb5ae27a137ad20c5dd7d516f3ea
* | Fix TypedArray.getTextArray()Deepanshu Gupta2015-09-232-9/+16
|/ | | | Change-Id: Ic55b52840892fbf2a4258ba97ed31ca0283da8ed
* Fix android:theme parsing for custom views.Deepanshu Gupta2015-08-281-2/+20
| | | | Change-Id: Iba83ba1d2e4a96461cc298a759e32e4e51e311a0
* LayoutLib: Switch SimpleDateFormat to icu.Deepanshu Gupta2015-08-061-0/+99
| | | | | | | | | | | | 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
* Make getInt in BridgeTypedArray accept empty String.Deepanshu Gupta2015-08-041-5/+2
| | | | | | | | | | The XML editor already warns about the empty strings in places where an int value is required. There's no need to show another warning for it in the rendering panel. Also, the rendering might have also failed when the empty string is encountered. Try an continue the rendering, because no rendering state is really bad. Change-Id: I85106f37e4462f237e85f0b065b4ce8a4bfabf4d
* Fix Matrix_Delegate.native_getValues()Deepanshu Gupta2015-08-031-1/+1
| | | | | | | The bug manifested itself by not rendering the wifi icon in the status bar. Change-Id: I7debf3eef387965d774bf66e856812e67c8552a7
* Fix bugs introduced in 78aa664.Deepanshu Gupta2015-07-311-9/+8
| | | | | | | | Fix a couple of bugs (ArrayIndexOutOfBoundsException due to miscalculation and a typo - swapped src and dst) introduced in the CL: 78aa664 Poor implementation of Path.approximate() Change-Id: Iff7dbbf66d2714df51699ddb9a4169c38feefa7b
* Poor implementation of Path.approximate()Deepanshu Gupta2015-07-291-3/+53
| | | | | | | | | | | Include a very poor implementation of Path.approximate() in LayoutLib that only returns the first and last coordinate of the path. This avoids crashing the rendering when certain assumptions are made on the value returned from the method. Also change the error to a warning. Change-Id: I9241dec734d4df90a9eebd1e6de8b3e443eee3c8
* Add tools:openDrawer to open a DrawerLayout.Deepanshu Gupta2015-07-151-0/+36
| | | | | | | Store a list of drawer layouts with tools:openDrawer encountered and call openDrawer on them during the post-inflation processing. Change-Id: Idee299a9af1bb106509a03bb2e8424c372b93dc5
* Fix Paint_Delegate.native_getRunAdvance()Deepanshu Gupta2015-07-071-1/+2
| | | | | Bug: 22249573 Change-Id: I29f7abe6448f439059547e1c1e310d3d651ac2d8
* Implement tools:list_item for RecyclerView.Deepanshu Gupta2015-07-071-8/+23
| | | | | | | It's now possible to use tools:list_item attribute for RecyclerView to point to a default layout, rather than always using a TextView. Change-Id: I5d522b2f0ca38b420fddfcb0f73a26d95707da79
* am fa794eb0: am 2f710356: am 13c06d6c: am 1f33bdad: am 5e50e00c: Merge "Fix ↵Diego Perez2015-06-152-2/+6
|\ | | | | | | | | | | | | for shadows on theme editor" into lmp-mr1-dev * commit 'fa794eb0025dbec6c1b90135495081d42f06bdaf': Fix for shadows on theme editor
| * am 2f710356: am 13c06d6c: am 1f33bdad: am 5e50e00c: Merge "Fix for shadows ↵Diego Perez2015-06-152-2/+6
| |\ | | | | | | | | | | | | | | | | | | on theme editor" into lmp-mr1-dev * commit '2f7103565cf1732d6d1281195cfa49a1564751d7': Fix for shadows on theme editor
| | * Merge "Fix for shadows on theme editor" into lmp-mr1-devDiego Perez2015-06-152-2/+6
| | |\
| | | * Fix for shadows on theme editorDiego Perez2015-06-022-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | resolved conflicts for merge of 5a53816b to mnc-devDiego Perez2015-06-151-3/+7
|\ \ \ \ | |/ / / | | | | | | | | Change-Id: Ice1ba8cb9793432e18635e77f4e3309f50bb7b3f
| * | | am c051c556: am e10e8005: am 68155986: am f5a99437: Merge "Fix crash when ↵Diego Perez2015-06-121-2/+9
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | shadowSize is 0" into lmp-mr1-dev * commit 'c051c556669f88e284f2922f8d28fad2138598ae': Fix crash when shadowSize is 0
| | * | Fix crash when shadowSize is 0Diego Perez2015-05-081-2/+9
| | |/ | | | | | | | | | | | | Change-Id: I9f131afc95a2571fbc8a737df37f43653cfbb90d (cherry picked from commit e81096458f689ab3c0c4dbab2452722c3e3623c4)
| * | am ffeb8117: am 9c13c8de: am bc47abe4: Merge "Make sure shaders use a color ↵Diego Perez2015-05-074-8/+19
| |\ \ | | |/ | | | | | | | | | | | | | | | model compatible with the destination." into lmp-mr1-dev * commit 'ffeb8117b139f61dd7c92bda6a7d47b83871cb66': Make sure shaders use a color model compatible with the destination.
| | * Merge "Make sure shaders use a color model compatible with the destination." ↵Diego Perez2015-05-064-8/+19
| | |\ | | | | | | | | | | | | into lmp-mr1-dev
| | | * Make sure shaders use a color model compatible with the destination.Diego Perez2015-04-154-8/+19
| | | | | | | | | | | | | | | | | | | | Change-Id: Iaf6e14bb86835c36a5b0c37519ac2ee794d10081 (cherry picked from commit 158ac454073a460375123d7d05152a7c6490efb6)
* | | | Support AppBar from Material Design.Jens Ole Lauridsen2015-06-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL is a start for making the design able to render the AppBar. We are still missing support for: system menu and the app icon. Change-Id: I19600f8ee1e7e6492186a0b7ae7fb38c82e15c02
* | | | Fix BridgeTypedArray.getType()Deepanshu Gupta2015-05-281-8/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also includes some fixes for BridgeTypedArray.getInt() - when value is a color, when value is an octal int, when value is true/false. Bug: http://b.android.com/162438 Change-Id: I0b985ea3437be8018d0e116e7a599843cc7aacd6
* | | | LayoutLib: Support getting resource arrays.Deepanshu Gupta2015-05-261-8/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't crash when Resources.get<Type>Array() is called. - If the IDE supports it, actually return the value. - Add tests for getArray. - Update test app to latest gradle plugin version. - Switch to using AppTheme for tests, since the tests depend on some custom theme attributes. The AppTheme now inherits from Material.Light.DarkActionBar, so other tests should be unaffected. Depends on a newer version of sdk-common, which fixes the parsing of array resource in value files. Bug: 12372031 Change-Id: I313b61511e98ac1402d75056ebfdeeb005ebb96d
* | | | LayoutLib: Change nullity annotations.Deepanshu Gupta2015-05-2216-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Add LayoutLibDelegate for new Bitmap method.Deepanshu Gupta2015-05-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Original method added in: 721ae5fec5f1fd4f93aa2a361a0ac298e15ce353 Change-Id: Ie14d132459638cf103c390fae3f4c0c02bef2f34
* | | | Fix overrides for BridgeResources.Deepanshu Gupta2015-05-201-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New method overloads have been introduces in android.content.Resources. Change BridgeResources to overrides the appropriate ones. Also, fix the implementation to the new behaviour. Change-Id: I7b83b329f04286512f223c0fafc3f989f1b9a244
* | | | Make DatePicker rendering not fail.Deepanshu Gupta2015-05-201-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Use non deprecated method for creating ColorStateListDeepanshu Gupta2015-05-201-1/+2
| | | | | | | | | | | | | | | | Change-Id: I9fce928276c8a2af55eb0615a4895abb6a973be5
* | | | Fix line breaking.Deepanshu Gupta2015-05-201-47/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Essentially moves line breaking measurement later in the process when character widths have already been computed. Change-Id: I17c5bc10d373d8906c5caf86604ce8504650cd7f
* | | | Make Context.getClassLoader() work.Deepanshu Gupta2015-05-191-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Fix include tag rendering.Deepanshu Gupta2015-05-192-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A missing catch clause caused rendering to be failed when there is an include tag that doesn't specify layout_width and layout_height. Also improve the error messages to make debugging easier next time. Change-Id: I617762636973a010b34da167c7b5fcd328b7d178
* | | | Update rendering fidelity tag to use constant.Deepanshu Gupta2015-05-131-4/+4
| | | | | | | | | | | | | | | | Change-Id: If6c1076aa1e070c6bda7be16516fe0e18a95fe2d
* | | | Use Balanced line breaker instead of HighQuality.Deepanshu Gupta2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fallback to the Balanced line breaker till the time HighQuality one is implemented. Change-Id: I51e9882c5c733e5409f932ef740684829340ced9
* | | | Add missing delegates for M preview.Deepanshu Gupta2015-05-1313-174/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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