#[repr(u32)]pub enum Density {
Default = 0,
Low = 120,
Medium = 160,
TV = 213,
High = 240,
XHigh = 320,
XXHigh = 480,
XXXHigh = 640,
Any = 65_534,
None = 65_535,
}
Variants§
Default = 0
Low = 120
Medium = 160
TV = 213
High = 240
XHigh = 320
XXHigh = 480
XXXHigh = 640
Any = 65_534
None = 65_535
Implementations§
Source§impl Density
impl Density
Sourcepub fn approx_dpi(self) -> Option<u32>
pub fn approx_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§
impl Copy for Density
impl Eq for Density
impl StructuralPartialEq for Density
Auto Trait Implementations§
impl Freeze for Density
impl RefUnwindSafe for Density
impl Send for Density
impl Sync for Density
impl Unpin for Density
impl UnwindSafe for Density
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more