mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-01 09:16:00 +00:00
Optimization
This commit is contained in:
parent
58fa1285fe
commit
1447fb2f0b
1 changed files with 19 additions and 5 deletions
|
@ -172,13 +172,27 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|||
try {
|
||||
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
|
||||
boolean changed = false;
|
||||
ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
|
||||
mlp.leftMargin = insets.left;
|
||||
mlp.topMargin = insets.top;
|
||||
mlp.rightMargin = insets.right;
|
||||
if (mlp.leftMargin != insets.left) {
|
||||
changed = true;
|
||||
mlp.leftMargin = insets.left;
|
||||
}
|
||||
if (mlp.topMargin != insets.top) {
|
||||
changed = true;
|
||||
mlp.topMargin = insets.top;
|
||||
}
|
||||
if (mlp.rightMargin != insets.right) {
|
||||
changed = true;
|
||||
mlp.rightMargin = insets.right;
|
||||
}
|
||||
if (!edge_to_edge)
|
||||
mlp.bottomMargin = insets.bottom;
|
||||
v.setLayoutParams(mlp);
|
||||
if (mlp.bottomMargin != insets.bottom) {
|
||||
changed = true;
|
||||
mlp.bottomMargin = insets.bottom;
|
||||
}
|
||||
if (changed)
|
||||
v.setLayoutParams(mlp);
|
||||
|
||||
if (hasWindowFocus) {
|
||||
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
||||
|
|
Loading…
Reference in a new issue