pub struct AndroidPlatform { /* private fields */ }Expand description
Platform abstraction for Android.
This type manages platform-specific conversions (e.g., density, pointer coordinates) and provides a bridge between Android’s event system and Compose’s logical coordinate space.
Implementations§
Source§impl AndroidPlatform
impl AndroidPlatform
Sourcepub fn set_scale_factor(&mut self, scale_factor: f64)
pub fn set_scale_factor(&mut self, scale_factor: f64)
Updates the platform’s scale factor.
This should be called when the device density changes.
Sourcepub fn pointer_position(&self, physical_x: f64, physical_y: f64) -> Point
pub fn pointer_position(&self, physical_x: f64, physical_y: f64) -> Point
Converts a physical pointer position into logical coordinates.
Android provides pointer positions in physical pixels; this method scales them back to logical pixels using the platform’s current scale factor.
Sourcepub fn scale_factor(&self) -> f32
pub fn scale_factor(&self) -> f32
Returns the current scale factor (density).
Trait Implementations§
Source§impl Clone for AndroidPlatform
impl Clone for AndroidPlatform
Source§fn clone(&self) -> AndroidPlatform
fn clone(&self) -> AndroidPlatform
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AndroidPlatform
impl Debug for AndroidPlatform
Auto Trait Implementations§
impl Freeze for AndroidPlatform
impl RefUnwindSafe for AndroidPlatform
impl Send for AndroidPlatform
impl Sync for AndroidPlatform
impl Unpin for AndroidPlatform
impl UnsafeUnpin for AndroidPlatform
impl UnwindSafe for AndroidPlatform
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