mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-17 08:44:20 +01:00
make sure it's still working on android
This commit is contained in:
10
Cargo.lock
generated
10
Cargo.lock
generated
@@ -601,6 +601,7 @@ dependencies = [
|
|||||||
name = "damus"
|
name = "damus"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"android-activity",
|
||||||
"android_logger",
|
"android_logger",
|
||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
"eframe",
|
"eframe",
|
||||||
@@ -623,6 +624,7 @@ dependencies = [
|
|||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"tracing-wasm",
|
"tracing-wasm",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
|
"winit",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -691,12 +693,14 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"objc",
|
"objc",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
|
"pollster",
|
||||||
"puffin 0.15.0",
|
"puffin 0.15.0",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
|
"wgpu",
|
||||||
"winapi",
|
"winapi",
|
||||||
"winit",
|
"winit",
|
||||||
]
|
]
|
||||||
@@ -2052,6 +2056,12 @@ dependencies = [
|
|||||||
"static_assertions",
|
"static_assertions",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pollster"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.17"
|
version = "0.2.17"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ crate-type = ["lib", "cdylib"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
#egui-android = { git = "https://github.com/jb55/egui-android.git" }
|
#egui-android = { git = "https://github.com/jb55/egui-android.git" }
|
||||||
egui = "0.22.0"
|
egui = "0.22.0"
|
||||||
eframe = { version = "0.22.0", default-features = false, features = [ "glow" ] }
|
eframe = { version = "0.22.0", default-features = false, features = [ "glow", "wgpu", "android-native-activity" ] }
|
||||||
#eframe = "0.22.0"
|
#eframe = "0.22.0"
|
||||||
egui_extras = { version = "0.22.0", features = ["image", "svg"] }
|
egui_extras = { version = "0.22.0", features = ["image", "svg"] }
|
||||||
ehttp = "0.2.0"
|
ehttp = "0.2.0"
|
||||||
@@ -46,11 +46,12 @@ wasm-bindgen-futures = "0.4"
|
|||||||
tokio = { version = "1.16", features = ["macros", "rt-multi-thread"] }
|
tokio = { version = "1.16", features = ["macros", "rt-multi-thread"] }
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
|
|
||||||
|
|
||||||
[target.'cfg(target_os = "android")'.dependencies]
|
[target.'cfg(target_os = "android")'.dependencies]
|
||||||
android_logger = "0.11.1"
|
android_logger = "0.11.1"
|
||||||
#android-activity = "0.4.0"
|
android-activity = { version = "0.4", features = [ "native-activity" ] }
|
||||||
#winit = "0.27.5"
|
#winit = "0.28.6"
|
||||||
#winit = { version = "0.28", features = [ "android-native-activity" ] }
|
winit = { version = "0.28", features = [ "android-native-activity" ] }
|
||||||
#winit = { git="https://github.com/rust-windowing/winit.git", rev = "2a58b785fed2a3746f7c7eebce95bce67ddfd27c", features = ["android-native-activity"] }
|
#winit = { git="https://github.com/rust-windowing/winit.git", rev = "2a58b785fed2a3746f7c7eebce95bce67ddfd27c", features = ["android-native-activity"] }
|
||||||
|
|
||||||
[package.metadata.android]
|
[package.metadata.android]
|
||||||
|
|||||||
@@ -75,17 +75,13 @@ struct EventRefs {
|
|||||||
refs: Vec<EventRef>,
|
refs: Vec<EventRef>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TextNote {
|
|
||||||
event: Event,
|
|
||||||
shards: Shards,
|
|
||||||
refs: EventRefs,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DM {
|
struct DM {
|
||||||
decrypted: Option<String>,
|
decrypted: Option<String>,
|
||||||
shards: Shards,
|
shards: Shards,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Note {
|
struct Note {
|
||||||
Text(TextNote),
|
event: NostrEvent,
|
||||||
|
shards: Shards,
|
||||||
|
refs: EventRef,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ pkgs ? import <nixpkgs> {} }:
|
{ pkgs ? import <nixpkgs> {}, use_android ? true }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
let
|
let
|
||||||
x11libs = lib.makeLibraryPath [ xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libXi libglvnd vulkan-loader vulkan-validation-layers ];
|
x11libs = lib.makeLibraryPath [ xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libXi libglvnd vulkan-loader vulkan-validation-layers ];
|
||||||
@@ -16,10 +16,9 @@ let
|
|||||||
androidsdk = androidComposition.androidsdk;
|
androidsdk = androidComposition.androidsdk;
|
||||||
android-home = "${androidsdk}/libexec/android-sdk";
|
android-home = "${androidsdk}/libexec/android-sdk";
|
||||||
ndk-home = "${android-home}/ndk/${ndk-version}";
|
ndk-home = "${android-home}/ndk/${ndk-version}";
|
||||||
use_android = true;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
mkShell {
|
mkShell ({
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cargo-udeps cargo-edit cargo-watch rustup rustfmt libiconv pkgconfig cmake fontconfig
|
cargo-udeps cargo-edit cargo-watch rustup rustfmt libiconv pkgconfig cmake fontconfig
|
||||||
brotli wabt
|
brotli wabt
|
||||||
@@ -32,4 +31,4 @@ mkShell {
|
|||||||
} // (if !use_android then {} else {
|
} // (if !use_android then {} else {
|
||||||
ANDROID_HOME = android-home;
|
ANDROID_HOME = android-home;
|
||||||
NDK_HOME = ndk-home;
|
NDK_HOME = ndk-home;
|
||||||
})
|
}))
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ mod ui;
|
|||||||
|
|
||||||
pub use app::Damus;
|
pub use app::Damus;
|
||||||
pub use error::Error;
|
pub use error::Error;
|
||||||
|
use winit::platform::android::EventLoopBuilderExtAndroid;
|
||||||
|
|
||||||
pub type Result<T> = std::result::Result<T, error::Error>;
|
pub type Result<T> = std::result::Result<T, error::Error>;
|
||||||
|
|
||||||
@@ -23,7 +24,8 @@ use winit::platform::android::activity::AndroidApp;
|
|||||||
|
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn android_main(app: AndroidApp) {
|
#[tokio::main]
|
||||||
|
pub async fn android_main(app: AndroidApp) {
|
||||||
std::env::set_var("RUST_BACKTRACE", "full");
|
std::env::set_var("RUST_BACKTRACE", "full");
|
||||||
android_logger::init_once(android_logger::Config::default().with_min_level(log::Level::Info));
|
android_logger::init_once(android_logger::Config::default().with_min_level(log::Level::Info));
|
||||||
|
|
||||||
@@ -33,7 +35,7 @@ pub fn android_main(app: AndroidApp) {
|
|||||||
builder.with_android_app(app);
|
builder.with_android_app(app);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
eframe::run_native(
|
let res_ = eframe::run_native(
|
||||||
"Damus NoteDeck",
|
"Damus NoteDeck",
|
||||||
options,
|
options,
|
||||||
Box::new(|_cc| Box::new(Damus::new())),
|
Box::new(|_cc| Box::new(Damus::new())),
|
||||||
|
|||||||
Reference in New Issue
Block a user