Add new method for updating menu state after layout calculation
This commit is contained in:
parent
e282469750
commit
08621d17fd
1 changed files with 11 additions and 12 deletions
|
@ -270,12 +270,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
setupToolbar();
|
setupToolbar();
|
||||||
updateHeader();
|
updateHeader();
|
||||||
setupButtons(view);
|
setupButtons(view);
|
||||||
runLayoutListener(new Runnable() {
|
calculateLayoutAndUpdateMenuState();
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateMenuState();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
@ -842,12 +837,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
menuType = type;
|
menuType = type;
|
||||||
setupCards();
|
setupCards();
|
||||||
updateHeader();
|
updateHeader();
|
||||||
runLayoutListener(new Runnable() {
|
calculateLayoutAndUpdateMenuState();
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateMenuState();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
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() {
|
private void updateMenuState() {
|
||||||
if (menuType == TrackMenuType.OPTIONS) {
|
if (menuType == TrackMenuType.OPTIONS) {
|
||||||
openMenuFullScreen();
|
openMenuFullScreen();
|
||||||
|
|
Loading…
Reference in a new issue