fix(android): keep the toolbar out of the status and navigation bars (Issue #50)
NativeActivity draws the whole window, also below the system bars, so the top toolbar button lay under the status bar and taps there went to Android (no other notebook could be opened). InkActivity now reports the system bar and cutout insets; the app shrinks egui's screen rect to the free area and adds the side insets to the page centering. The page itself still scrolls below the bars. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2a9a67d399
commit
3d6dbf09da
5 files changed
+101
-15
No files matched your search
@@ -143,6 +143,20 @@ pub fn android_app() -> Option<winit::platform::android::activity::AndroidApp> {
|
||||
ANDROID_APP.get().cloned()
|
||||
}
|
||||
|
||||
/// Window edges (left, top, right, bottom; physical pixels) covered by system bars or display
|
||||
/// cutouts. Android: the app draws below the status and navigation bars, so its buttons must
|
||||
/// keep out of them (Issue #50). Desktop: none.
|
||||
pub fn safe_area_insets() -> [f32; 4] {
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
crate::android_bridge::insets()
|
||||
}
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
[0.0; 4]
|
||||
}
|
||||
}
|
||||
|
||||
/// Makes an exported file available to the user. Desktop: it already is (the path is
|
||||
/// returned). Android: copied to `Download/ink-notes` through the MediaStore (Android 10 and
|
||||
/// newer), as other apps can't see the app's own folder; older versions keep it there.
|
||||
|
||||
Reference in new issue
Block a user