Skip to main content

Crate uzor_mobile

Crate uzor_mobile 

Source
Expand description

Mobile backend for uzor supporting iOS and Android

This crate provides the mobile platform implementation for uzor, supporting iOS and Android devices with touch-first design.

§Architecture

The mobile backend provides:

  • Touch input handling (multi-touch)
  • Virtual keyboard integration (IME)
  • Mobile-specific features (haptics, orientation, safe areas)
  • Native clipboard integration
  • System theme detection

§Platform-Specific Notes

§iOS

  • Uses UIKit for native UI integration
  • Clipboard via UIPasteboard
  • Theme detection via UITraitCollection
  • Safe area insets for notch/home indicator

§Android

  • Uses Android NDK and JNI
  • Clipboard via ClipboardManager
  • Theme detection via Configuration.UI_MODE_NIGHT
  • System bars handling

§Feature Flags

  • android: Enable Android-specific functionality
  • ios: Enable iOS-specific functionality

§Example

use uzor_mobile::MobilePlatform;
use uzor::platform::{PlatformBackend, WindowConfig};

fn main() {
    let mut platform = MobilePlatform::new().unwrap();

    let window = platform.create_window(
        WindowConfig::new("My Mobile App")
    ).unwrap();

    // Handle touch events
    while let Some(event) = platform.poll_event() {
        match event {
            PlatformEvent::TouchStart { id, x, y } => {
                // Handle touch start
            }
            PlatformEvent::TouchMove { id, x, y } => {
                // Handle touch move
            }
            PlatformEvent::TouchEnd { id, x, y } => {
                // Handle touch end
            }
            _ => {}
        }
    }
}

Re-exports§

pub use uzor;

Structs§

MobilePlatform
Mobile platform backend for uzor

Enums§

HapticStyle
Haptic feedback style
ScreenOrientation
Screen orientation