Skip to main content

Module android

Module android 

Source
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.
AttrFormat
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/name reference to a public framework resource.
resource_name
The type and name of the public framework resource (other than an attribute) with ID id.