Optimization

master
M66B 3 weeks ago
parent 58fa1285fe
commit 1447fb2f0b

@ -172,12 +172,26 @@ 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();
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)
if (mlp.bottomMargin != insets.bottom) {
changed = true;
mlp.bottomMargin = insets.bottom;
}
if (changed)
v.setLayoutParams(mlp);
if (hasWindowFocus) {

Loading…
Cancel
Save