Repository navigation
feat(android): add S1 native host (RuneView, LayerHost, insets, back) - #2689
Merged
Merged
Conversation
Hona
force-pushed
the
feat/android-s1-host
branch
2 times, most recently
from
November 28, 2026 00:36
c043c13 to
99a0a01
Compare
Hona
force-pushed
the
feat/android-s1-host
branch
from
November 28, 2026 00:38
99a0a01 to
dab429b
Compare
This was referenced Nov 28, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Android slice S1 (native host:
RuneView, lifecycle, insets, Back) cleanly on top of S0 (#2647).Design decisions
Cx::keyboard_inset()/Runtime::set_keyboard_inset()): Soft-keyboard overlap stays out ofCx::safe_area()so hardwareEl::on_edge_dragbands do not expand by the keyboard height.set_keyboard_insetinvalidates memos and automatically scrolls focused text fields into the visible band above the keyboard without resizing the layout viewport (adjustNothing).dev.rune(RuneActivityandRuneView) incrates/rune/android/src/main/java/dev/rune/, matching existingdev.rune.*IDs and using framework Android APIs (no AndroidX requirement).winitlinked, bypass at runtime:App::try_runroutes toplatform::android::runon Android without touching ~235 files namingwinittypes orvendor/winit.rune::android_main!exportsJNI_OnLoadand bindsRuneViewmethods viaRegisterNatives.LayerHost+ Android GLES limits:rune::embed::LayerHostcompiles on Android, accepts anANativeWindow *(from_native_window/attach_native_window), and detaches synchronously (detach_surface) while keeping theRuntime<S>, app state, and GPU device alive across surface loss.Gpu::required_device_limitsfalls back todownlevel_defaults()for adapters limited to 16 KiB uniform buffer bindings (Android GLES), andwgpu/glesis enabled alongside Vulkan on Android.What shipped
crates/rune/src/platform/android/: pure lifecycle state machine (machine.rs+ 8 host tests inmachine_tests.rs), JNI host (host.rs), and stdout/stderr/panic logcat forwarding (logcat.rs).crates/rune/src/platform/embed.rs: AndroidANativeWindowsupport anddetach_surface/attach_native_window.crates/rune/src/render/device.rs:required_device_limitsdownlevel fallback for 16 KiB UBO adapters (+ unit test indevice_tests.rs).Cx::keyboard_inset()andRuntime::set_keyboard_inset()(+ edge-drag isolation and caret-reveal tests).crates/rune/android/src/main/java/dev/rune/{RuneActivity,RuneView}.kt,examples/android-hello,scripts/android-run.sh,ANDROID.md, and anapkCI job in.github/workflows/android.yml.Verification
cargo check -p rune -p android-hello,cargo check --target wasm32-unknown-unknown -p rune,platform::android::machine_tests(8 tests covering surface loss/recreation, 20 Home/return trips, rotation, keyboard inset without resize, dark mode, Back, Choreographer deduplication),required_device_limits,keyboard_inset(edge-drag + caret reveal), andandroid-hellounit tests.android(aarch64-linux-android,x86_64-linux-android, andandroid-helloAPK build),check, andsize.Fixes #2648