Android: Don't draw the UI under the system bars or the keyboard

This commit is contained in:
Olivier Goffart 2024-01-31 09:05:08 +01:00
parent c31b621cb5
commit fb78bbd702
2 changed files with 93 additions and 24 deletions

View file

@ -6,6 +6,7 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.view.inputmethod.InputMethodManager;
import android.app.Activity;
import android.widget.FrameLayout;
@ -194,4 +195,11 @@ public class SlintAndroidJavaHelper {
int nightModeFlags = mActivity.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
return nightModeFlags == Configuration.UI_MODE_NIGHT_YES;
}
// Get the geometry of the view minus the system bars and the keyboard
public Rect get_view_rect() {
Rect rect = new Rect();
mActivity.getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
return rect;
}
}