mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-01 09:16:00 +00:00
IME inset for windows only
This commit is contained in:
parent
eda76545fa
commit
5573492719
1 changed files with 11 additions and 3 deletions
|
@ -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() +
|
||||
|
|
Loading…
Reference in a new issue