damus-io / notedeck

A multiplatform nostr client
Other
86 stars 16 forks source link

Android softkeyboard support #199

Open jb55 opened 5 months ago

jb55 commented 5 months ago

For input on android, we need to pop up the keyboard. This isn't directly supported by egui, since egui doesn't handle such things. egui delegates such tasks to winit, but winit does not support it yet.

External tracking issues:

Progress in this area:

Our progress:

jb55 commented 5 months ago

I looked into this all yesterday. It looks like we might need to switch over to GameActivity to get this working. There is some initial work from @rib in android-activity (https://github.com/rust-mobile/android-activity/pull/24) for soft keyboard + GameActivity, but it looks like we'll will still need winit/egui support. There are some demos by @lucasmerlin at https://github.com/lucasmerlin/rust-android-examples/tree/ime_support_showcase/agdk-eframe which demo this in egui.

The current build tooling we're using assumes its a NativeActivity, I have yet to get GameActivity working. It seems there are many build tools: cargo-apk (what we're using now), cargo-ndk, cargo-xbuild, cargo-mobile2. I'm not sure what to use. The GameActivity demos use cargo-ndk but it requires some gradle step which I have yet to get working.

Somewhat surprised the rust mobile ecosystem still can't present a keyboard for input, oh well, I guess banging my head against this a bit more is easier than building an entirely new android kotlin codebase from scratch.

lucasmerlin commented 5 months ago

I can report that I'm still using the method from the showcase in my app and I regularly update my fork of winit and egui with the keyboard changes to the newest versions.

The current versions of my fork are here:

https://github.com/lucasmerlin/egui/tree/hp_improvements_0.26

https://github.com/lucasmerlin/winit/tree/hp-fixes-0.29.x

They also contain changes unrelated to keyboard input, but maybe it will still be helpful.

jb55 commented 5 months ago

I saw those! Thank you! I will try to get these working.

jb55 commented 5 months ago

Since this is a large task I will split it into specific deliverables for this sprint

alltheseas commented 1 month ago

@jb55 with issues transferred over from old android repo to notedeck repo, I am adding an 'android' label to every android specific issue

alltheseas commented 1 day ago

@ksedgwic