pub struct ConfigurationRef { /* private fields */ }
Expand description

A (cheaply clonable) reference to this application’s ndk::configuration::Configuration

This provides a thread-safe way to access the latest configuration state for an application without deeply copying the large ndk::configuration::Configuration struct.

If the application is notified of configuration changes then those changes will become visible via pre-existing configuration references.

Implementations§

source§

impl ConfigurationRef

source

pub fn copy(&self) -> Configuration

source

pub fn country(&self) -> Option<String>

Returns the country code, as a String of two characters, if set

source

pub fn density(&self) -> Option<u32>

Returns the screen density in dpi.

On some devices it can return values outside of the density enum.

source

pub fn keyboard(&self) -> Keyboard

Returns the keyboard type.

source

pub fn keys_hidden(&self) -> KeysHidden

Returns keyboard visibility/availability.

source

pub fn language(&self) -> Option<String>

Returns the language, as a String of two characters, if a language is set

source

pub fn layout_direction(&self) -> LayoutDir

Returns the layout direction

source

pub fn mcc(&self) -> i32

Returns the mobile country code.

source

pub fn mnc(&self) -> Option<i32>

Returns the mobile network code, if one is defined

source

pub fn nav_hidden(&self) -> NavHidden

source

pub fn navigation(&self) -> Navigation

source

pub fn orientation(&self) -> Orientation

source

pub fn screen_height_dp(&self) -> Option<i32>

source

pub fn screen_width_dp(&self) -> Option<i32>

source

pub fn screen_long(&self) -> ScreenLong

source

pub fn screen_size(&self) -> ScreenSize

source

pub fn sdk_version(&self) -> i32

source

pub fn smallest_screen_width_dp(&self) -> Option<i32>

source

pub fn touchscreen(&self) -> Touchscreen

source

pub fn ui_mode_night(&self) -> UiModeNight

source

pub fn ui_mode_type(&self) -> UiModeType

Trait Implementations§

source§

impl Clone for ConfigurationRef

source§

fn clone(&self) -> ConfigurationRef

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConfigurationRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for ConfigurationRef

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for ConfigurationRef

source§

impl Send for ConfigurationRef

source§

impl Sync for ConfigurationRef

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.