Fix RP state when route calculates quickly

This commit is contained in:
crimean 2019-04-20 21:48:32 +03:00
parent 1c22f9f814
commit cae6cf8b19

View file

@ -91,7 +91,6 @@ import net.osmand.search.core.SearchResult;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
@ -100,8 +99,6 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import static net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.DRIVING_STYLE;
public class MapRouteInfoMenu implements IRouteInformationListener, CardListener {
private static final int BUTTON_ANIMATION_DELAY = 2000;
@ -378,10 +375,10 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
}
public void routeCalculationStarted() {
setRouteCalculationInProgress(true);
WeakReference<MapRouteInfoMenuFragment> fragmentRef = findMenuFragment();
MapRouteInfoMenuFragment fragment = fragmentRef != null ? fragmentRef.get() : null;
if (fragmentRef != null && fragment.isVisible()) {
setRouteCalculationInProgress(true);
fragment.updateRouteCalculationProgress(0);
fragment.updateInfo();
}