diff --git a/bin/app/src/android/insets.rs b/bin/app/src/android/insets.rs index 566ed69cf..bb637b0c2 100644 --- a/bin/app/src/android/insets.rs +++ b/bin/app/src/android/insets.rs @@ -63,6 +63,9 @@ pub unsafe extern "C" fn Java_darkfi_darkfi_1app_ResizingLayout_onApplyInsets( ); let mut globals = GLOBALS.lock(); globals.insets = [sys_left as f32, sys_top as f32, sys_right as f32, sys_bottom as f32]; + if ime_bottom > 0 { + globals.insets[3] = ime_bottom as f32; + } if let Some(sender) = &globals.sender { let _ = sender.try_send(globals.insets.clone()); } else { diff --git a/bin/app/src/app/mod.rs b/bin/app/src/app/mod.rs index 4cb36257c..7e379f705 100644 --- a/bin/app/src/app/mod.rs +++ b/bin/app/src/app/mod.rs @@ -96,9 +96,10 @@ impl App { sled_tree: settings_tree, }); - #[cfg(target_os = "android")] - let window_scale = android::get_screen_density() / 2.625; - #[cfg(not(target_os = "android"))] + // TODO: apply this to insets otherwise its wrong + //#[cfg(target_os = "android")] + //let window_scale = android::get_screen_density() / 2.625; + //#[cfg(not(target_os = "android"))] let window_scale = 1.; d!("Setting window scale to {window_scale}"); diff --git a/bin/app/src/app/schema/mod.rs b/bin/app/src/app/schema/mod.rs index d9d37cdae..0f96bd257 100644 --- a/bin/app/src/app/schema/mod.rs +++ b/bin/app/src/app/schema/mod.rs @@ -325,9 +325,9 @@ pub async fn make(app: &App, window: SceneNodePtr, i18n_fish: &I18nBabelFish) { let prop = content.get_property("rect").unwrap(); prop.set_expr(atom, Role::App, 0, expr::load_var("insets_left")).unwrap(); prop.set_expr(atom, Role::App, 1, expr::load_var("insets_top")).unwrap(); - let code = cc.compile("w - insets_right").unwrap(); + let code = cc.compile("w - insets_left - insets_right").unwrap(); prop.set_expr(atom, Role::App, 2, code).unwrap(); - let code = cc.compile("h - insets_bottom").unwrap(); + let code = cc.compile("h - insets_top - insets_bottom").unwrap(); prop.set_expr(atom, Role::App, 3, code).unwrap(); let window_insets = window.get_property("insets").unwrap(); prop.add_depend(&window_insets, 0, "insets_left");