Fix: update wry, tao, to fix android issues
This commit is contained in:
9 files changed
+1169
-371
No files matched your search
@@ -18,7 +18,6 @@ dioxus-html = { workspace = true, features = [
|
||||
"eval",
|
||||
] }
|
||||
dioxus-interpreter-js = { workspace = true, features = ["binary-protocol"] }
|
||||
dioxus-hot-reload = { workspace = true, optional = true }
|
||||
dioxus-cli-config = { workspace = true }
|
||||
generational-box = { workspace = true }
|
||||
|
||||
@@ -55,6 +54,8 @@ tao = { version = "0.26.1", features = ["rwh_05"] }
|
||||
global-hotkey = "0.5.0"
|
||||
rfd = "0.12"
|
||||
muda = "0.11.3"
|
||||
# hotreload only works on desktop platforms.... mobile is still wip
|
||||
dioxus-hot-reload = { workspace = true, optional = true }
|
||||
|
||||
[target.'cfg(target_os = "ios")'.dependencies]
|
||||
objc = "0.2.7"
|
||||
@@ -65,7 +66,7 @@ core-foundation = "0.9.3"
|
||||
objc = "0.2.7"
|
||||
|
||||
[features]
|
||||
default = ["tokio_runtime", "hot-reload", "wry/objc-exception"]
|
||||
default = ["tokio_runtime", "wry/objc-exception", "hot-reload"]
|
||||
tokio_runtime = ["tokio"]
|
||||
fullscreen = ["wry/fullscreen"]
|
||||
transparent = ["wry/transparent"]
|
||||
|
||||
@@ -81,7 +81,12 @@ impl App {
|
||||
app.set_global_hotkey_handler();
|
||||
|
||||
// Allow hotreloading to work - but only in debug mode
|
||||
#[cfg(all(feature = "hot-reload", debug_assertions))]
|
||||
#[cfg(all(
|
||||
feature = "hot-reload",
|
||||
debug_assertions,
|
||||
not(target_os = "android"),
|
||||
not(target_os = "ios")
|
||||
))]
|
||||
app.connect_hotreload();
|
||||
|
||||
(event_loop, app)
|
||||
@@ -99,7 +104,12 @@ impl App {
|
||||
self.shared.shortcut_manager.call_handlers(event);
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "hot-reload", debug_assertions))]
|
||||
#[cfg(all(
|
||||
feature = "hot-reload",
|
||||
debug_assertions,
|
||||
not(target_os = "android"),
|
||||
not(target_os = "ios")
|
||||
))]
|
||||
pub fn connect_hotreload(&self) {
|
||||
dioxus_hot_reload::connect({
|
||||
let proxy = self.shared.proxy.clone();
|
||||
@@ -265,7 +275,12 @@ impl App {
|
||||
view.desktop_context.send_edits();
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "hot-reload", debug_assertions))]
|
||||
#[cfg(all(
|
||||
feature = "hot-reload",
|
||||
debug_assertions,
|
||||
not(target_os = "android"),
|
||||
not(target_os = "ios")
|
||||
))]
|
||||
pub fn handle_hot_reload_msg(&mut self, msg: dioxus_hot_reload::HotReloadMsg) {
|
||||
match msg {
|
||||
dioxus_hot_reload::HotReloadMsg::UpdateTemplate(template) => {
|
||||
|
||||
@@ -14,7 +14,12 @@ pub enum UserWindowEvent {
|
||||
Ipc { id: WindowId, msg: IpcMessage },
|
||||
|
||||
/// Handle a hotreload event, basically telling us to update our templates
|
||||
#[cfg(all(feature = "hot-reload", debug_assertions))]
|
||||
#[cfg(all(
|
||||
feature = "hot-reload",
|
||||
debug_assertions,
|
||||
not(target_os = "android"),
|
||||
not(target_os = "ios")
|
||||
))]
|
||||
HotReloadEvent(dioxus_hot_reload::HotReloadMsg),
|
||||
|
||||
/// Create a new window
|
||||
|
||||
@@ -36,7 +36,12 @@ pub fn launch_virtual_dom_blocking(virtual_dom: VirtualDom, desktop_config: Conf
|
||||
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
|
||||
UserWindowEvent::GlobalHotKeyEvent(evnt) => app.handle_global_hotkey(evnt),
|
||||
|
||||
#[cfg(all(feature = "hot-reload", debug_assertions))]
|
||||
#[cfg(all(
|
||||
feature = "hot-reload",
|
||||
debug_assertions,
|
||||
not(target_os = "android"),
|
||||
not(target_os = "ios")
|
||||
))]
|
||||
UserWindowEvent::HotReloadEvent(msg) => app.handle_hot_reload_msg(msg),
|
||||
|
||||
UserWindowEvent::Ipc { id, msg } => match msg.method() {
|
||||
|
||||
@@ -221,6 +221,7 @@ impl WebviewInstance {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn kick_stylsheets(&self) {
|
||||
// run eval in the webview to kick the stylesheets by appending a query string
|
||||
// we should do something less clunky than this
|
||||
|
||||
@@ -226,3 +226,10 @@ pub fn launch_desktop(app: fn() -> Element) {
|
||||
pub fn launch_fullstack(app: fn() -> Element) {
|
||||
LaunchBuilder::fullstack().launch(app)
|
||||
}
|
||||
|
||||
#[cfg(feature = "mobile")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "mobile")))]
|
||||
/// Launch your mobile application without any additional configuration. See [`LaunchBuilder`] for more options.
|
||||
pub fn launch_mobile(app: fn() -> Element) {
|
||||
LaunchBuilder::mobile().launch(app)
|
||||
}
|
||||
Reference in new issue
Block a user