lib.rs (1690B)
1 mod app; 2 //mod camera; 3 mod error; 4 //mod note; 5 //mod block; 6 mod abbrev; 7 pub mod account_manager; 8 mod actionbar; 9 pub mod app_creation; 10 mod app_style; 11 mod args; 12 mod colors; 13 mod column; 14 mod draft; 15 mod filter; 16 mod fonts; 17 mod frame_history; 18 mod images; 19 mod imgcache; 20 mod key_parsing; 21 mod key_storage; 22 pub mod login_manager; 23 mod macos_key_storage; 24 mod note; 25 mod notecache; 26 mod post; 27 mod profile; 28 pub mod relay_pool_manager; 29 mod result; 30 mod route; 31 mod subscriptions; 32 mod test_data; 33 mod thread; 34 mod time; 35 mod timecache; 36 mod timeline; 37 pub mod ui; 38 mod unknowns; 39 mod user_account; 40 41 #[cfg(test)] 42 #[macro_use] 43 mod test_utils; 44 mod linux_key_storage; 45 46 pub use app::Damus; 47 pub use error::Error; 48 pub use profile::DisplayName; 49 50 #[cfg(target_os = "android")] 51 use winit::platform::android::EventLoopBuilderExtAndroid; 52 53 pub type Result<T> = std::result::Result<T, error::Error>; 54 55 //#[cfg(target_os = "android")] 56 //use egui_android::run_android; 57 58 #[cfg(target_os = "android")] 59 use winit::platform::android::activity::AndroidApp; 60 61 #[cfg(target_os = "android")] 62 #[no_mangle] 63 #[tokio::main] 64 pub async fn android_main(app: AndroidApp) { 65 std::env::set_var("RUST_BACKTRACE", "full"); 66 android_logger::init_once(android_logger::Config::default().with_min_level(log::Level::Info)); 67 68 let path = app.internal_data_path().expect("data path"); 69 let mut options = eframe::NativeOptions::default(); 70 options.renderer = eframe::Renderer::Wgpu; 71 options.event_loop_builder = Some(Box::new(move |builder| { 72 builder.with_android_app(app); 73 })); 74 75 let _res = eframe::run_native( 76 "Damus NoteDeck", 77 options, 78 Box::new(|cc| Ok(Box::new(Damus::new(cc, path, vec![])))), 79 ); 80 }