mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-01 17:26:12 +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 int themeId;
|
||||||
private Context originalContext;
|
private Context originalContext;
|
||||||
private boolean visible;
|
private boolean visible;
|
||||||
|
private boolean hasWindowFocus;
|
||||||
private boolean contacts;
|
private boolean contacts;
|
||||||
private List<IKeyPressedListener> keyPressedListeners = new ArrayList<>();
|
private List<IKeyPressedListener> keyPressedListeners = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -179,9 +180,11 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||||
mlp.bottomMargin = insets.bottom;
|
mlp.bottomMargin = insets.bottom;
|
||||||
v.setLayoutParams(mlp);
|
v.setLayoutParams(mlp);
|
||||||
|
|
||||||
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
if (hasWindowFocus) {
|
||||||
int pad = bottom - insets.bottom;
|
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
||||||
v.setPaddingRelative(0, 0, 0, pad < 0 ? 0 : pad);
|
int pad = bottom - insets.bottom;
|
||||||
|
v.setPaddingRelative(0, 0, 0, pad < 0 ? 0 : pad);
|
||||||
|
}
|
||||||
|
|
||||||
if (edge_to_edge)
|
if (edge_to_edge)
|
||||||
for (View child : Helper.getViewsWithTag(v, "inset")) {
|
for (View child : Helper.getViewsWithTag(v, "inset")) {
|
||||||
|
@ -241,6 +244,11 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||||
setContentView(view);
|
setContentView(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWindowFocusChanged(boolean hasFocus) {
|
||||||
|
hasWindowFocus = hasFocus;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
EntityLog.log(this, "Activity create " + this.getClass().getName() +
|
EntityLog.log(this, "Activity create " + this.getClass().getName() +
|
||||||
|
|
Loading…
Reference in a new issue