Enum ndk::configuration::Density
source · [−]#[repr(u32)]
pub enum Density {
Default,
Low,
Medium,
TV,
High,
XHigh,
XXHigh,
XXXHigh,
Any,
None,
}
Variants
Default
Low
Medium
TV
High
XHigh
XXHigh
XXXHigh
Any
None
Implementations
sourceimpl Density
impl Density
sourcepub fn dpi(self) -> Option<u32>
pub fn dpi(self) -> Option<u32>
The DPI associated with the density class. See the Android screen density docs
There are some Density
values that have no associated DPI; these values return None
.
sourcepub fn approx_hidpi_factor(self) -> Option<f64>
pub fn approx_hidpi_factor(self) -> Option<f64>
The Hi-DPI factor associated with the density class. This is the factor by which an image/resource should be scaled to match its size across devices. The baseline is a 160dpi screen (i.e., Hi-DPI factor = DPI / 160). See the Android screen density docs
There are some Density
values that have no associated DPI; these values return None
.
Trait Implementations
sourceimpl TryFrom<u32> for Density
impl TryFrom<u32> for Density
type Error = TryFromPrimitiveError<Density>
type Error = TryFromPrimitiveError<Density>
The type returned in the event of a conversion error.
sourcefn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
Performs the conversion.
sourceimpl TryFromPrimitive for Density
impl TryFromPrimitive for Density
type Primitive = u32
const NAME: &'static str = _
fn try_from_primitive(
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for Density
impl Eq for Density
impl StructuralEq for Density
impl StructuralPartialEq for Density
Auto Trait Implementations
impl RefUnwindSafe for Density
impl Send for Density
impl Sync for Density
impl Unpin for Density
impl UnwindSafe for Density
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more