Enum ndk::configuration::Density
source · #[non_exhaustive]#[repr(i32)]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 (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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 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§
source§impl FromPrimitive for Density
impl FromPrimitive for Density
source§impl PartialEq for Density
impl PartialEq for Density
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