forked from organicmaps/organicmaps
[android] Fixed not updated menu badge after updating maps and returning back to the map
A better fix should also monitor the "update finished" event. But this one is more than enough for most cases. Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
parent
140e5fca59
commit
5ca4b00dce
1 changed files with 2 additions and 0 deletions
|
@ -88,6 +88,7 @@ public class MapButtonsController extends Fragment
|
|||
if (menuButton != null)
|
||||
{
|
||||
menuButton.setOnClickListener((v) -> mMapButtonClickListener.onClick(MapButtons.menu));
|
||||
// This hack is needed to show the badge on the initial startup. For some reason, updateMenuBadge does not work from onResume() there.
|
||||
menuButton.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
|
@ -292,6 +293,7 @@ public class MapButtonsController extends Fragment
|
|||
{
|
||||
super.onResume();
|
||||
mSearchWheel.onResume();
|
||||
updateMenuBadge();
|
||||
}
|
||||
|
||||
public void resetSearch()
|
||||
|
|
Loading…
Add table
Reference in a new issue