feat(android): JNI clipboard bridge for Stats share-link button
Replaces the informational "Share link: {url}" toast on Android with a
real clipboard write via ClipboardManager JNI. Falls back to the old
toast on JNI error so the user can still copy the URL manually.
Adds `jni = "0.21"` (default-features = false) as a workspace dep;
`jni 0.21.1` was already in Cargo.lock as a transitive dep so no new
packages are fetched.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -361,9 +361,13 @@ fn handle_copy_share_link_button(
|
||||
}
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
toast.write(InfoToastEvent(format!(
|
||||
"Share link: {url}"
|
||||
)));
|
||||
match crate::android_clipboard::set_text(&url) {
|
||||
Ok(()) => toast.write(InfoToastEvent(format!("Copied: {url}"))),
|
||||
Err(e) => {
|
||||
warn!("android clipboard failed: {e}");
|
||||
toast.write(InfoToastEvent(format!("Share link: {url}")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user