Struct ndk::configuration::Configuration
source · pub struct Configuration { /* private fields */ }
Expand description
A native AConfiguration *
Configuration
is an opaque type used to get and set various subsystem configurations.
Implementations§
source§impl Configuration
impl Configuration
sourcepub unsafe fn from_ptr(ptr: NonNull<AConfiguration>) -> Self
pub unsafe fn from_ptr(ptr: NonNull<AConfiguration>) -> Self
Construct a Configuration
from a pointer.
Safety
By calling this function, you assert that it is a valid pointer to a native
AConfiguration
, and give ownership of it to the Configuration
instance.
sourcepub unsafe fn clone_from_ptr(ptr: NonNull<AConfiguration>) -> Self
pub unsafe fn clone_from_ptr(ptr: NonNull<AConfiguration>) -> Self
Create a new Configuration
, with the same contents as the AConfiguration
referenced by
the pointer.
This is useful if you have a pointer, but not ownership of it.
Safety
By calling this function, you assert that it is a valid pointer to a native
AConfiguration
.
sourcepub fn ptr(&self) -> NonNull<AConfiguration>
pub fn ptr(&self) -> NonNull<AConfiguration>
The pointer to the native AConfiguration
. Keep in mind that the Configuration
object
still has ownership, and will free it when dropped.
pub fn from_asset_manager(am: &AssetManager) -> Self
sourcepub fn diff(&self, other: &Self) -> DiffResult
pub fn diff(&self, other: &Self) -> DiffResult
Information about what fields differ between the two configurations
sourcepub fn matches(&self, requested: &Self) -> bool
pub fn matches(&self, requested: &Self) -> bool
Returns false if anything in self
conflicts with requested
sourcepub fn country(&self) -> Option<String>
pub fn country(&self) -> Option<String>
Returns the country code, as a String
of two characters, if set
sourcepub fn density(&self) -> Option<u32>
pub fn density(&self) -> Option<u32>
Returns the screen density in dpi.
On some devices it can return values outside of the density enum.
Returns keyboard visibility/availability.
sourcepub fn language(&self) -> Option<String>
pub fn language(&self) -> Option<String>
Returns the language, as a String
of two characters, if set
sourcepub fn layout_direction(&self) -> LayoutDir
pub fn layout_direction(&self) -> LayoutDir
Returns the layout direction
pub fn orientation(&self) -> Orientation
pub fn screen_height_dp(&self) -> Option<i32>
pub fn screen_width_dp(&self) -> Option<i32>
pub fn screen_long(&self) -> ScreenLong
pub fn screen_round(&self) -> ScreenRound
api-level-30
only.