Skip to content

Commit

Permalink
Android: Explain why we use WindowInsetsController.
Browse files Browse the repository at this point in the history
  • Loading branch information
xorgy committed Jul 11, 2024
1 parent f9906c9 commit 01cf7c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/platform_impl/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,9 @@ impl DeviceId {
pub struct PlatformSpecificWindowAttributes;

fn show_hide_keyboard_fallible(app: AndroidApp, show: bool) -> Result<(), jni::errors::Error> {
// After Android R, it is no longer possible to show the soft keyboard
// with showSoftInput alone.
// It can, however, be done using `WindowInsetsController` as done here.
use jni::{objects::JObject, JavaVM};
let vm = unsafe { JavaVM::from_raw(app.vm_as_ptr() as _)? };
let activity = unsafe { JObject::from_raw(app.activity_as_ptr() as _) };
Expand Down

0 comments on commit 01cf7c5

Please sign in to comment.