Add updateCards method

This commit is contained in:
Chumva 2019-03-20 18:57:37 +02:00
parent fa2762055b
commit 8b2079dad4
2 changed files with 28 additions and 6 deletions

View file

@ -391,10 +391,13 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
WeakReference<MapRouteInfoMenuFragment> fragmentRef = findMenuFragment();
MapRouteInfoMenuFragment fragment = fragmentRef != null ? fragmentRef.get() : null;
if (fragmentRef != null && fragment.isVisible()) {
setRouteCalculationInProgress(true);
fragment.updateRouteCalculationProgress(0);
fragment.updateControlButtons();
fragment.updateInfo();
if (setRouteCalculationInProgress(true)) {
fragment.updateRouteCalculationProgress(0);
fragment.updateControlButtons();
fragment.updateInfo();
} else {
fragment.updateCards();
}
}
}
@ -481,8 +484,6 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
mainView = main;
OsmandApplication app = mapActivity.getMyApplication();
nightMode = app.getDaynightHelper().isNightModeForMapControls();
TargetPointsHelper targetPointsHelper = app.getTargetPointsHelper();
RoutingHelper routingHelper = app.getRoutingHelper();
updateStartPointView();
updateWaypointsView();
@ -492,6 +493,21 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
updateApplicationModesOptions();
updateOptionsButtons();
updateCards();
}
public void updateCards() {
MapActivity mapActivity = getMapActivity();
if (mapActivity == null) {
return;
}
OsmandApplication app = mapActivity.getMyApplication();
nightMode = app.getDaynightHelper().isNightModeForMapControls();
TargetPointsHelper targetPointsHelper = app.getTargetPointsHelper();
RoutingHelper routingHelper = app.getRoutingHelper();
menuCards.clear();
boolean bottomShadowVisible = true;

View file

@ -807,6 +807,12 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
}
}
public void updateCards() {
if (menu != null) {
menu.updateCards();
}
}
public void updateLayout() {
if (menu != null) {
runLayoutListener();