Skip to content

Commit

Permalink
update wry [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Aug 11, 2023
1 parent 8432965 commit 88b418a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 56 deletions.
12 changes: 6 additions & 6 deletions core/tauri-runtime/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ impl<'de> Deserialize<'de> for CursorIcon {
}

#[cfg(target_os = "android")]
pub struct CreationContext<'a> {
pub env: jni::JNIEnv<'a>,
pub activity: &'a jni::objects::JObject<'a>,
pub webview: &'a jni::objects::JObject<'a>,
pub struct CreationContext<'a, 'b> {
pub env: &'a mut jni::JNIEnv<'b>,
pub activity: &'a jni::objects::JObject<'b>,
pub webview: &'a jni::objects::JObject<'b>,
}

/// A webview window that has yet to be built.
Expand Down Expand Up @@ -222,7 +222,7 @@ pub struct PendingWindow<T: UserEvent, R: Runtime<T>> {
#[cfg(target_os = "android")]
#[allow(clippy::type_complexity)]
pub on_webview_created:
Option<Box<dyn Fn(CreationContext<'_>) -> Result<(), jni::errors::Error> + Send>>,
Option<Box<dyn Fn(CreationContext<'_, '_>) -> Result<(), jni::errors::Error> + Send>>,

pub web_resource_request_handler: Option<Box<WebResourceRequestHandler>>,
}
Expand Down Expand Up @@ -310,7 +310,7 @@ impl<T: UserEvent, R: Runtime<T>> PendingWindow<T, R> {

#[cfg(target_os = "android")]
pub fn on_webview_created<
F: Fn(CreationContext<'_>) -> Result<(), jni::errors::Error> + Send + 'static,
F: Fn(CreationContext<'_, '_>) -> Result<(), jni::errors::Error> + Send + 'static,
>(
mut self,
f: F,
Expand Down
2 changes: 1 addition & 1 deletion core/tauri/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ impl<R: Runtime> WindowManager<R> {

#[cfg(target_os = "android")]
{
pending = pending.on_webview_created(move |mut ctx| {
pending = pending.on_webview_created(move |ctx| {
let plugin_manager = ctx
.env
.call_method(
Expand Down
58 changes: 9 additions & 49 deletions examples/api/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 88b418a

Please sign in to comment.