Fixed jitter on hiding action bar

This commit is contained in:
M66B 2024-05-23 22:50:41 +02:00
parent b241c49512
commit f2b6ad793e
1 changed files with 2 additions and 1 deletions

View File

@ -146,8 +146,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int offset) {
try {
view.setTranslationY(abh + offset);
ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
mlp.topMargin = abh + offset;
mlp.bottomMargin = abh + offset;
view.setLayoutParams(mlp);
} catch (Throwable ex) {
Log.e(ex);