Add new method for updating menu state after layout calculation

This commit is contained in:
Vitaliy 2021-01-28 11:35:23 +02:00
parent e282469750
commit 08621d17fd

View file

@ -270,12 +270,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
setupToolbar();
updateHeader();
setupButtons(view);
runLayoutListener(new Runnable() {
@Override
public void run() {
updateMenuState();
}
});
calculateLayoutAndUpdateMenuState();
}
return view;
}
@ -842,12 +837,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
menuType = type;
setupCards();
updateHeader();
runLayoutListener(new Runnable() {
@Override
public void run() {
updateMenuState();
}
});
calculateLayoutAndUpdateMenuState();
break;
}
}
@ -856,6 +846,15 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
});
}
private void calculateLayoutAndUpdateMenuState() {
runLayoutListener(new Runnable() {
@Override
public void run() {
updateMenuState();
}
});
}
private void updateMenuState() {
if (menuType == TrackMenuType.OPTIONS) {
openMenuFullScreen();