Wouldn't know where to start, can just about make an extension
@SimpleFunction(description = "Hides or shows the status bar (true to hide, false to show).")
public void HideStatusBar(final boolean hide) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Activity activity = form.getActiveForm();
if (activity == null) {
android.util.Log.e("BarMode", "Activity is null");
return;
}
Window window = activity.getWindow();
if (hide) {
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
android.util.Log.d("BarMode", "StatusBar hidden");
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
android.util.Log.d("BarMode", "StatusBar shown");
}
}
});
}
@SimpleFunction(description = "Hides or shows the navigation bar (true to hide, false to show).")
public void HideNavigationBar(final boolean hide) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Activity activity = form.getActiveForm();
if (activity == null) {
android.util.Log.e("BarMode", "Activity is null");
return;
}
Window window = activity.getWindow();
View decorView = window.getDecorView();
if (hide) {
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
android.util.Log.d("BarMode", "NavigationBar hidden");
} else {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
android.util.Log.d("BarMode", "NavigationBar shown");
}
}
});
}
The second method does not work on Android 15+ if the Navbar has already been colored.
(My approach prevents the Navbar from being colored on Android 15+, so this HideNavbar method also works on Android 15+.)
Ok, I'm not clear if I'm doing something wrong. I tested the Companion going back into last year using Android 11, and I saw this problem with pop-up keyboard overlapping a text field in every case.
It may be different with the compiled version. Here's the test app I used:
ScreenBoundaries.aia (1.5 KB)
I'm trying to figure out if I'm doing the wrong thing, or if this really is different from what you're describing.
Yes, this happens because the Arrangements have fixed values for the height. Try this:
ScreenBoundaries2.aia (1.9 KB)
This problem also occurs/occurred with targetSdkVersion=34. Checked on Android 11 (Pixel 2XL).
Here's the compiled APK with the fix I shared on GitHub. The arrangement must be scrollable for this to work.
Your version of the project works fine on my local server.
But it stops working after I close the keyboard programmatically. I'll have to investigate.
Because the .GotFocus
event is no longer triggered. I take a second TB, Width=1px and
So TextBox1.GotFocus
is triggered again when clicking in TB.
Well, yes. I had a glitch. You have to remove the focus for the GotFocus event to fire and set the layout height back to -2. The problem doesn't occur if you immediately set the layout height to FillParent in the designer. Then, no additional blocks are needed and everything works automatically.
Yes, but only with a button to hide the keyboard. These are workarounds. But once the fix is implemented on the server, they will no longer be necessary. Unless someone insists on a fixed-height layout, then the fix won't work. The screen must have enough space to accommodate the inset.
Which layout?
It will always work with a scrollable layout. With non-scrollable layouts, at least one layout on the page must be a FillParent, and the page must have some free space, free of views, the height of the keyboard. Therefore, the most reliable layout for these applications is a scrollable layout.
Yes, but you need an extension. The patch does something similar but in native code.
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
}else {
edgeToEdge(binding.root)
}
in kotlin , close edge to edge for android 15 and put android:fitsSystemWindows="true" in .xml
Apparently, there isn't much interest in it, so I'll send you the extension via PM first. Test it and let me know if it works (for your purposes).