Optimization

master
M66B 3 weeks ago
parent 1447fb2f0b
commit 9ee50bc99b

@ -194,12 +194,16 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
if (changed) if (changed)
v.setLayoutParams(mlp); v.setLayoutParams(mlp);
int b = v.getPaddingBottom();
if (hasWindowFocus) { if (hasWindowFocus) {
int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom; int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
int pad = bottom - insets.bottom; int pad = Math.max(0, bottom - insets.bottom);
v.setPaddingRelative(0, 0, 0, pad < 0 ? 0 : pad); if (b != pad)
} else v.setPaddingRelative(0, 0, 0, pad);
v.setPaddingRelative(0, 0, 0, 0); } else {
if (b != 0)
v.setPaddingRelative(0, 0, 0, 0);
}
if (edge_to_edge) if (edge_to_edge)
for (View child : Helper.getViewsWithTag(v, "inset")) { for (View child : Helper.getViewsWithTag(v, "inset")) {

Loading…
Cancel
Save