Expand description
Public resources of the Android framework (the android: namespace).
The tables are generated at build time from framework.txt, which
tools/gen-framework extracts from an SDK platform’s android.jar, so
attribute IDs, formats, and enum values match the platform exactly.
use apk::android::{self, attr};
assert_eq!(attr::SCREEN_ORIENTATION.symbol("landscape"), Some(0));
assert_eq!(android::find_attr("label").unwrap().id().0, 0x0101_0001);
assert!(android::find_style("Theme.Material.NoActionBar").is_some());
assert!(android::find_resource(apk::res::ResourceType::Color, "white").is_some());Modules§
- attr
- Every public framework attribute, as
attr::SCREAMING_CASE.
Structs§
- AttrDef
- A public framework attribute.
- Attr
Format - The value formats an attribute accepts (
<attr format="...">). - Symbol
- A named value of an enum or flags attribute, e.g.
landscape = 0.
Constants§
- NAMESPACE
- The XML namespace URI bound to the
android:prefix. - PLATFORM_
API_ LEVEL - The API level of the platform these resources come from.
Functions§
- attr_
by_ id - Looks up a public framework attribute by resource ID.
- find_
attr - Looks up a public framework attribute by name (without
android:). - find_
resource - Looks up a public framework resource other than an attribute, such as
(Style, "Theme.Material.NoActionBar")or(Drawable, "sym_def_app_icon"). - find_
style - Looks up a public framework style such as
Theme.Material.NoActionBar. - resolve
- Resolves an
@android:type/namereference to a public framework resource. - resource_
name - The type and name of the public framework resource (other than an
attribute) with ID
id.