This allows for the thresholds to be tuned differently for different
products as needed.
Bug: 18276856
Change-Id: I6c87e683dea6a17cf606203a894c8419e20d3658
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
Now that AAPT2 is library-aware, it needs to take care of
all library related work, including merging manifests.
The logic was taken from the current Java ManifestMerger.
Change-Id: Id93f713f27ae8617922bf89e325e45be9f863c06
We modify the XML of layouts and AndroidManifest enough
that it warrants we operate on the tree in memory.
These files are never very large so this should be fine.
Change-Id: I5d597abdb3fca2a203cf7c0b40fcd926aecb3137
Adds an option that prevents generating java symbols for string
resources that don't have a default localization.
Bug: 21537397
Change-Id: Ifafa942b24d5cdbed93651cde363e859be13d395
Some applications rename the newer RTL attributes to the older
attributes in order to target RTL locales, but not need to include two
attributes everywhere it's needed. For example, iosched renames
paddingStart to paddingLeft (among other attributes) for API 17 and
above. This leads to hundreds of warnings about missing attributes.
This change suppresses such warnings.
Also, skip adding unresolved attributes to the typed array. This is more
in line with the actual implementation on device, and prevents
unexpected warnings/errors/crashes later.
Change-Id: Iee616fa6295aa9731ede0cf9dcd6dd2bd1fe8f20
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
This includes the fix for the broken dialog windows. The outsets will
only be calculated and applied if the window is full screen, since
they don't make much sense otherwise.
This reverts commit 4bb6b751fbbb218e8a298db4aa008472a0aa8d31.
Change-Id: I977a85a78c990c1840784dc0be0dddd5a6d84e6b
- 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
This reverts commit 97b3ae1a8766616675ebf2323a97d8adfd41bfdc.
Reverted since 4bb6b751fbbb218e8a298db4aa008472a0aa8d31 reverts
the commit that warranted this change.
Change-Id: I56d0eb8ffba44a673ae357e9543dd18f6c03c54f
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
Cherry picking because automerger is stuck.
Change-Id: I49f669ee8eed53cf2fc30077cf0a066312865733
(cherry picked from commit c1b736a0cdf41ab5863bfe6901e46c95cc396342)
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
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
Essentially moves line breaking measurement later in the process when
character widths have already been computed.
Change-Id: I17c5bc10d373d8906c5caf86604ce8504650cd7f
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
Information about the chin is now part of the config.xml instead of the
theme. It is retrieved by WindowManagerService and passed to the clients
as insets. Clients can adjust their behavior in a way that makes it
invisible to the user, that part of the surface doesn't actually exist.
Bug: 19908853
Change-Id: Iedf57bf3c848201b854f91ffeb3b59187d375c1f
When trying to find the SDK Platform Dir for LayoutLib tests, also
test if the dir from which the tests are run is module dir.
Change-Id: Id5c6038d07ebbb122e38f907ad488ed1f2bcde32
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
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