diff --git a/OsmAnd/res/layout-land/plan_route_info.xml b/OsmAnd/res/layout-land/plan_route_info.xml index ed694f5509..0cfca0ac48 100644 --- a/OsmAnd/res/layout-land/plan_route_info.xml +++ b/OsmAnd/res/layout-land/plan_route_info.xml @@ -17,6 +17,17 @@ android:clickable="true" android:orientation="vertical"> + + + + fragmentRef = findMenuFragment(); + if (fragmentRef != null) { + fragmentRef.get().updateRouteCalculationProgress(progress); + } + } + + public void routeCalculationFinished() { + WeakReference fragmentRef = findMenuFragment(); + if (fragmentRef != null) { + fragmentRef.get().hideRouteCalculationProgressBar(); + } + } + public void updateMenu() { WeakReference fragmentRef = findMenuFragment(); if (fragmentRef != null) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java index ec64575323..d8c810d8bc 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java @@ -7,6 +7,7 @@ import android.support.v4.app.FragmentManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ProgressBar; import android.widget.TextView; import net.osmand.AndroidUtils; @@ -106,6 +107,23 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment { } } + public void updateRouteCalculationProgress(int progress) { + ProgressBar progressBar = (ProgressBar) mainView.findViewById(R.id.progress_bar); + if (progressBar != null) { + if (progressBar.getVisibility() != View.VISIBLE) { + progressBar.setVisibility(View.VISIBLE); + } + progressBar.setProgress(progress); + } + } + + public void hideRouteCalculationProgressBar() { + View progressBar = mainView.findViewById(R.id.progress_bar); + if (progressBar != null) { + progressBar.setVisibility(View.GONE); + } + } + public void show(MapActivity mapActivity) { int slideInAnim = 0; int slideOutAnim = 0;