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
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
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
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
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
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
- 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
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
The earlier resolution (a2a5ce49b29b8e3bf3cd695ff9f968e5579f4be2)
wasn't the right one. This fixes it.
Change-Id: I6a6dc908d3e7dd510064a46df932d129a58eed98
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
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
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
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
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
When multiple styles are applied to a theme, we only remembered the last
one. This change fixes the issue.
Change-Id: I46490e882edc3eabe522a641c83366234b5bb25d
LayoutLib Create tests are now built whenever LayoutLib create is built.
Change-Id: Id215e8690e435019579dba1734090a0d585f37e1
(cherry picked from commit 4efe6264f1251fa200427f54ea6f5dd4c4d03665)
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)
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)
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
Not all System Properties were used via Build class. Also, properties
like SDK_INT which called SystemProperties directly were not initialized
properly.
This change is essentially cherry picking of the relevant parts from the
following commits:
984749bf75c9ce9d3401b8410ea7d6276544b6ee
167bc25bceea9280bbe4858db4cb8233f86ce325
Bug: http://b.android.com/73046
Change-Id: Ia0fb467ee6d5fdedda500d57d02be20006f115df