mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 11:25:13 +01:00
IME inset for windows only
This commit is contained in:
@@ -86,6 +86,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
private int themeId;
|
||||
private Context originalContext;
|
||||
private boolean visible;
|
||||
private boolean hasWindowFocus;
|
||||
private boolean contacts;
|
||||
private List<IKeyPressedListener> keyPressedListeners = new ArrayList<>();
|
||||
|
||||
@@ -179,9 +180,11 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
mlp.bottomMargin = insets.bottom;
|
||||
v.setLayoutParams(mlp);
|
||||
|
||||
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
||||
int pad = bottom - insets.bottom;
|
||||
v.setPaddingRelative(0, 0, 0, pad < 0 ? 0 : pad);
|
||||
if (hasWindowFocus) {
|
||||
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
||||
int pad = bottom - insets.bottom;
|
||||
v.setPaddingRelative(0, 0, 0, pad < 0 ? 0 : pad);
|
||||
}
|
||||
|
||||
if (edge_to_edge)
|
||||
for (View child : Helper.getViewsWithTag(v, "inset")) {
|
||||
@@ -241,6 +244,11 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
setContentView(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
hasWindowFocus = hasFocus;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
EntityLog.log(this, "Activity create " + this.getClass().getName() +
|
||||
|
||||
Reference in New Issue
Block a user