Merge branch 'r3.3'

This commit is contained in:
crimean 2019-03-23 18:17:40 +03:00
commit aee93525a9
9 changed files with 101 additions and 51 deletions

View file

@ -509,6 +509,10 @@ public class TransportRoutePlanner {
return cfg.getChangeTime();
}
public double getBoardingTime() {
return cfg.getBoardingTime();
}
public int getChanges() {
return segments.size() - 1;
}

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_transparent">

View file

@ -106,6 +106,7 @@ import net.osmand.plus.measurementtool.MeasurementToolFragment;
import net.osmand.plus.measurementtool.NewGpxData;
import net.osmand.plus.render.RendererRegistry;
import net.osmand.plus.resources.ResourceManager;
import net.osmand.plus.routepreparationmenu.ChooseRouteFragment;
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu;
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenuFragment;
import net.osmand.plus.routing.IRouteInformationListener;
@ -592,14 +593,21 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return;
}
}
if (getPlanRouteFragment() != null) {
if (getPlanRouteFragment().quit(true)) {
PlanRouteFragment planRouteFragment = getPlanRouteFragment();
if (planRouteFragment != null) {
if (planRouteFragment.quit(true)) {
MapMarkersDialogFragment.showInstance(this);
}
return;
}
if (getMeasurementToolFragment() != null) {
getMeasurementToolFragment().quit(true);
MeasurementToolFragment measurementToolFragment = getMeasurementToolFragment();
if (measurementToolFragment != null) {
measurementToolFragment.quit(true);
return;
}
ChooseRouteFragment chooseRouteFragment = getChooseRouteFragment();
if (chooseRouteFragment != null) {
chooseRouteFragment.dismiss();
return;
}
if (mapContextMenu.isVisible() && mapContextMenu.isClosable()) {
@ -629,7 +637,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return;
super.onBackPressed();
}
private void quitAddGpxPointMode() {
@ -2007,6 +2014,11 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return fragment != null && !fragment.isDetached() && !fragment.isRemoving() ? (MeasurementToolFragment) fragment : null;
}
public ChooseRouteFragment getChooseRouteFragment() {
Fragment fragment = getSupportFragmentManager().findFragmentByTag(ChooseRouteFragment.TAG);
return fragment != null && !fragment.isDetached() && !fragment.isRemoving() ? (ChooseRouteFragment) fragment : null;
}
public boolean isTopToolbarActive() {
MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
return mapInfoLayer.hasTopToolbar();

View file

@ -17,7 +17,6 @@ import android.support.v7.view.ContextThemeWrapper;
import android.text.ClipboardManager;
import android.util.TypedValue;
import android.view.GestureDetector;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.VelocityTracker;
@ -74,6 +73,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
private int minHalfY;
private int topScreenPosY;
private int topPadding;
private int menuFullHeightMax;
private int menuBottomViewHeight;
private int menuFullHeight;
@ -82,7 +82,6 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
private int topShadowMargin;
private int currentMenuState;
private int shadowHeight;
private int toolbarHeight;
private int statusBarHeight;
private String preferredMapLang;
@ -107,6 +106,8 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
public abstract int getHeaderViewHeight();
public abstract int getToolbarHeight();
public boolean isSingleFragment() {
return true;
}
@ -192,31 +193,26 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
shadowHeight = AndroidUtils.dpToPx(mapActivity, SHADOW_HEIGHT_TOP_DP);
topScreenPosY = addStatusBarHeightIfNeeded(-shadowHeight);
toolbarHeight = app.getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);
mainView = view.findViewById(getMainViewId());
nightMode = app.getDaynightHelper().isNightModeForMapControls();
processScreenHeight(container);
minHalfY = viewHeight - (int) (viewHeight * .75f);
LockableScrollView bottomScrollView = (LockableScrollView) view.findViewById(getBottomScrollViewId());
bottomScrollView.setScrollingEnabled(false);
AndroidUtils.setBackground(app, bottomScrollView, nightMode, R.color.route_info_bg_light, R.color.route_info_bg_dark);
AndroidUtils.setBackground(app, mainView, nightMode, R.drawable.bg_map_context_menu_light, R.drawable.bg_map_context_menu_dark);
if (!portrait) {
topPadding = getToolbarHeight() - topScreenPosY;
bottomScrollView.setPadding(0, topPadding, 0, 0);
final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId);
mainView.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT));
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(AndroidUtils.dpToPx(mapActivity, 345f), ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM;
}
processScreenHeight(container);
minHalfY = viewHeight - (int) (viewHeight * .75f);
final GestureDetector swipeDetector = new GestureDetector(app, new HorizontalSwipeConfirm(true));
final OnTouchListener slideTouchListener = new OnTouchListener() {
@ -293,16 +289,14 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
if (moving) {
moving = false;
int currentY = getViewY();
int fullScreenTopPosY = getMenuStatePosY(MenuState.FULL_SCREEN);
final VelocityTracker velocityTracker = this.velocityTracker;
velocityTracker.computeCurrentVelocity(1000, maximumVelocity);
int initialVelocity = (int) velocityTracker.getYVelocity();
if ((Math.abs(initialVelocity) > minimumVelocity)) {
if ((Math.abs(initialVelocity) > minimumVelocity) && currentY != fullScreenTopPosY) {
scroller.abortAnimation();
scroller.fling(0, currentY, 0, initialVelocity, 0, 0,
Math.min(viewHeight - menuFullHeightMax, getFullScreenTopPosY()),
Math.min(viewHeight - menuFullHeightMax, fullScreenTopPosY),
screenHeight,
0, 0);
currentY = scroller.getFinalY();
@ -480,7 +474,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
screenHeight = container.getHeight() + statusBarHeight;
viewHeight = screenHeight - statusBarHeight;
viewHeight = screenHeight - statusBarHeight - topPadding;
minHalfY = viewHeight - (int) (viewHeight * .75f);
}
}
@ -488,7 +482,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
private int getFullScreenTopPosY() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
int res = topShadowMargin + toolbarHeight;
int res = topShadowMargin + getToolbarHeight();
if (Build.VERSION.SDK_INT >= 21 && !isSingleFragment()) {
res -= statusBarHeight;
}
@ -833,15 +827,13 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
RotatedTileBox tb = mapActivity.getMapView().getCurrentRotatedTileBox().copy();
int tileBoxWidthPx = 0;
int tileBoxHeightPx = 0;
boolean portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
if (!portrait) {
tileBoxWidthPx = tb.getPixWidth() - view.getWidth();
} else {
tileBoxHeightPx = getHeaderOnlyTopY();
}
if (tileBoxHeightPx > 0) {
int topMarginPx = toolbarHeight;
if (tileBoxHeightPx > 0 || tileBoxWidthPx > 0) {
int topMarginPx = getToolbarHeight();
mapActivity.getMapView().fitRectToMap(rect.left, rect.right, rect.top, rect.bottom,
tileBoxWidthPx, tileBoxHeightPx, topMarginPx);
}

View file

@ -21,6 +21,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import net.osmand.AndroidUtils;
@ -64,6 +65,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
public static final String TAG = "ChooseRouteFragment";
public static final String ROUTE_INDEX_KEY = "route_index_key";
public static final String ROUTE_INFO_STATE_KEY = "route_info_state_key";
public static final String INITIAL_MENU_STATE_KEY = "initial_menu_state_key";
@Nullable
private LockableViewPager viewPager;
@ -94,10 +96,12 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
TransportRoutingHelper transportRoutingHelper = app.getTransportRoutingHelper();
List<TransportRouteResult> routes = transportRoutingHelper.getRoutes();
int routeIndex = 0;
int initialMenuState = MenuState.HEADER_ONLY;
Bundle args = getArguments();
if (args != null) {
routeIndex = args.getInt(ROUTE_INDEX_KEY);
routeInfoMenuState = args.getInt(ROUTE_INFO_STATE_KEY, -1);
initialMenuState = args.getInt(INITIAL_MENU_STATE_KEY, initialMenuState);
}
if (routes != null && !routes.isEmpty()) {
publicTransportMode = true;
@ -106,13 +110,19 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
new ContextThemeWrapper(mapActivity, !nightMode ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme);
View view = LayoutInflater.from(context).inflate(R.layout.fragment_show_all_routes, null);
AndroidUtils.addStatusBarPadding21v(mapActivity, view);
solidToolbarView = view.findViewById(R.id.toolbar_layout);
View solidToolbarView = view.findViewById(R.id.toolbar_layout);
this.solidToolbarView = solidToolbarView;
solidToolbarHeight = getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);
LockableViewPager viewPager = view.findViewById(R.id.pager);
this.viewPager = viewPager;
if (!portrait) {
initialMenuState = MenuState.FULL_SCREEN;
solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(AndroidUtils.dpToPx(mapActivity, 345f), ViewGroup.LayoutParams.WRAP_CONTENT));
view.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT));
}
viewPager.setClipToPadding(false);
//viewPager.setPageMargin(-60);
final RoutesPagerAdapter pagerAdapter = new RoutesPagerAdapter(getChildFragmentManager(), publicTransportMode ? routes.size() : 1);
final RoutesPagerAdapter pagerAdapter = new RoutesPagerAdapter(getChildFragmentManager(), publicTransportMode ? routes.size() : 1, initialMenuState);
viewPager.setAdapter(pagerAdapter);
viewPager.setCurrentItem(routeIndex);
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@ -165,7 +175,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
if (!wasDrawerDisabled) {
mapActivity.disableDrawer();
}
updateControlsVisibility(false);
updateControlsVisibility(false, false);
}
}
@ -177,7 +187,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
if (!wasDrawerDisabled) {
mapActivity.enableDrawer();
}
updateControlsVisibility(true);
updateControlsVisibility(true, routeInfoMenuState != -1);
}
}
@ -210,7 +220,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
return getIcon(id, nightMode ? R.color.ctx_menu_info_text_dark : R.color.icon_color);
}
private void dismiss() {
public void dismiss() {
try {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
@ -419,6 +429,8 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
if (publicTransportMode) {
view.findViewById(R.id.toolbar_options).setVisibility(View.GONE);
}
if (publicTransportMode || !portrait) {
view.findViewById(R.id.toolbar_options_flow).setVisibility(View.GONE);
view.findViewById(R.id.toolbar_options_flow_bg).setVisibility(View.GONE);
}
@ -575,9 +587,11 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
if (viewPager != null) {
int currentItem = viewPager.getCurrentItem();
List<WeakReference<RouteDetailsFragment>> routeDetailsFragments = this.routeDetailsFragments;
if (routeDetailsFragments.size() > currentItem) {
WeakReference<RouteDetailsFragment> ref = routeDetailsFragments.get(currentItem);
return ref.get();
for (WeakReference<RouteDetailsFragment> ref : routeDetailsFragments) {
RouteDetailsFragment f = ref.get();
if (f != null && f.getRouteId() == currentItem) {
return f;
}
}
}
return null;
@ -617,13 +631,18 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
}
}
public void updateControlsVisibility(boolean visible) {
public void updateControlsVisibility(boolean visible, boolean openingRouteInfo) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
int visibility = visible ? View.VISIBLE : View.GONE;
mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility);
mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility);
if (!openingRouteInfo) {
mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(visibility);
if (!portrait) {
mapActivity.getMapView().setMapPositionX(visible ? 0 : 1);
}
}
mapActivity.findViewById(R.id.bottom_controls_container).setVisibility(visibility);
mapActivity.refreshMap();
}
@ -646,9 +665,9 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
int i = 0;
List<WeakReference<RouteDetailsFragment>> routeDetailsFragments = this.routeDetailsFragments;
for (WeakReference<RouteDetailsFragment> ref : routeDetailsFragments) {
boolean current = i == currentItem;
RouteDetailsFragment f = ref.get();
if (f != null) {
boolean current = f.getRouteId() == currentItem;
if (!current && f.getCurrentMenuState() != menuState) {
f.openMenuScreen(menuState, false);
}
@ -686,12 +705,14 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
}
}
static boolean showFromRouteInfo(FragmentManager fragmentManager, int routeIndex, int routeInfoState) {
static boolean showFromRouteInfo(FragmentManager fragmentManager, int routeIndex,
int routeInfoState, int initialMenuState) {
try {
ChooseRouteFragment fragment = new ChooseRouteFragment();
Bundle args = new Bundle();
args.putInt(ROUTE_INDEX_KEY, routeIndex);
args.putInt(ROUTE_INFO_STATE_KEY, routeInfoState);
args.putInt(INITIAL_MENU_STATE_KEY, initialMenuState);
fragment.setArguments(args);
fragmentManager.beginTransaction()
.add(R.id.routeMenuContainer, fragment, TAG)
@ -704,10 +725,12 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
public class RoutesPagerAdapter extends FragmentPagerAdapter {
private int routesCount;
private int initialMenuState;
RoutesPagerAdapter(FragmentManager fm, int routesCount) {
RoutesPagerAdapter(FragmentManager fm, int routesCount, int initialMenuState) {
super(fm);
this.routesCount = routesCount;
this.initialMenuState = initialMenuState;
}
@Override
@ -718,7 +741,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
@Override
public Fragment getItem(int position) {
Bundle args = new Bundle();
args.putInt(ContextMenuFragment.MENU_STATE_KEY, MenuState.HEADER_ONLY);
args.putInt(ContextMenuFragment.MENU_STATE_KEY, initialMenuState);
args.putInt(RouteDetailsFragment.ROUTE_ID_KEY, position);
return Fragment.instantiate(ChooseRouteFragment.this.getContext(), RouteDetailsFragment.class.getName(), args);
}

View file

@ -609,7 +609,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
if (mapActivity != null) {
if (card instanceof SimpleRouteCard) {
hide();
ChooseRouteFragment.showFromRouteInfo(mapActivity.getSupportFragmentManager(), 0, getCurrentMenuState());
ChooseRouteFragment.showFromRouteInfo(mapActivity.getSupportFragmentManager(), 0, getCurrentMenuState(), MenuState.FULL_SCREEN);
}
}
}
@ -634,14 +634,15 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
if (buttonIndex == PublicTransportCard.DETAILS_BUTTON_INDEX) {
hide();
ChooseRouteFragment.showFromRouteInfo(mapActivity.getSupportFragmentManager(),
((PublicTransportCard) card).getRouteId(), getCurrentMenuState());
((PublicTransportCard) card).getRouteId(), getCurrentMenuState(), MenuState.FULL_SCREEN);
} else if (buttonIndex == PublicTransportCard.SHOW_BUTTON_INDEX) {
setupCards();
openMenuHeaderOnly();
}
} else if (card instanceof SimpleRouteCard) {
hide();
ChooseRouteFragment.showFromRouteInfo(mapActivity.getSupportFragmentManager(), 0, getCurrentMenuState());
ChooseRouteFragment.showFromRouteInfo(mapActivity.getSupportFragmentManager(), 0,
getCurrentMenuState(), MenuState.FULL_SCREEN);
}
}
}
@ -1263,7 +1264,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
if (app.getRoutingHelper().isPublicTransportMode()) {
if (isTransportRouteCalculated()) {
ChooseRouteFragment.showFromRouteInfo(mapActivity.getSupportFragmentManager(),
app.getTransportRoutingHelper().getCurrentRoute(), getCurrentMenuState());
app.getTransportRoutingHelper().getCurrentRoute(), getCurrentMenuState(), MenuState.HEADER_ONLY);
}
} else {
mapActivity.getMapLayers().getMapControlsLayer().startNavigation();
@ -1901,6 +1902,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
boolean refreshMap = !switched;
boolean portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
if (!portrait) {
currentMenuState = MenuState.FULL_SCREEN;
mapActivity.getMapView().setMapPositionX(1);
refreshMap = true;
}
@ -1933,6 +1935,10 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
removeTargetPointListener();
}
public boolean needShowMenu() {
return showMenu;
}
public void setShowMenu(int menuState) {
showMenu = true;
showMenuState = menuState;

View file

@ -125,11 +125,20 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
return !menuCards.isEmpty() ? menuCards.get(0).getViewHeight() : 0;
}
@Override
public int getToolbarHeight() {
return getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);
}
@Override
public boolean isSingleFragment() {
return false;
}
public int getRouteId() {
return routeId;
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
@ -292,7 +301,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
}
private void buildSegmentItem(View view, final TransportRouteResultSegment segment,
final TransportRouteResultSegment nextSegment, int[] startTime, double walkSpeed, double changeTime) {
final TransportRouteResultSegment nextSegment, int[] startTime, double walkSpeed, double boardingTime) {
OsmandApplication app = requireMyApplication();
TransportRoute transportRoute = segment.route;
List<TransportStop> stops = segment.getTravelStops();
@ -318,6 +327,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
Drawable icon = getContentIcon(drawableResId);
Typeface typeface = FontCache.getRobotoMedium(app);
startTime[0] += (int) boardingTime;
String timeText = OsmAndFormatter.getFormattedDurationShortMinutes(startTime[0]);
SpannableString secondaryText = new SpannableString(getString(R.string.sit_on_the_stop));
@ -386,7 +396,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
depTime = startTime[0] + arrivalTime;
}
// TODO: fix later for schedule
startTime[0] += (int) segment.travelTime + (nextSegment != null ? changeTime / 2 : 0);
startTime[0] += (int) segment.getTravelTime();
String textTime = OsmAndFormatter.getFormattedDurationShortMinutes(startTime[0]);
secondaryText = new SpannableString(getString(R.string.exit_at));
@ -467,7 +477,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
if (first) {
buildStartItem(parent, startPoint, startTime, segment, routeResult.getWalkSpeed());
}
buildSegmentItem(parent, segment, !last ? segments.get(i + 1) : null, startTime, routeResult.getWalkSpeed(), routeResult.getChangeTime());
buildSegmentItem(parent, segment, !last ? segments.get(i + 1) : null, startTime, routeResult.getWalkSpeed(), routeResult.getBoardingTime());
if (last) {
buildDestinationItem(parent, endPoint, startTime, segment, routeResult.getWalkSpeed());
}

View file

@ -747,11 +747,11 @@ public class MapControlsLayer extends OsmandMapLayer {
routePlanningMode = true;
}
boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode();
boolean routeDialogOpened = mapRouteInfoMenu.isVisible();
boolean trackDialogOpened = TrackDetailsMenu.isVisible();
boolean contextMenuOpened = !mapActivity.getContextMenu().shouldShowTopControls();
boolean showRouteCalculationControls = routePlanningMode ||
((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode);
boolean routeDialogOpened = mapRouteInfoMenu.isVisible() || (showRouteCalculationControls && mapRouteInfoMenu.needShowMenu());
updateMyLocation(rh, routeDialogOpened || trackDialogOpened || contextMenuOpened);
boolean showButtons = (showRouteCalculationControls || !routeFollowingMode)
&& !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened && !isInChoosingRoutesMode();

View file

@ -40,6 +40,7 @@ import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionFactory;
import net.osmand.plus.quickaction.QuickActionRegistry;
import net.osmand.plus.quickaction.QuickActionsWidget;
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@ -388,6 +389,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
private void setupQuickActionBtnVisibility() {
MapContextMenu contextMenu = mapActivity.getContextMenu();
MapRouteInfoMenu mapRouteInfoMenu = mapActivity.getMapRouteInfoMenu();
MapMultiSelectionMenu multiSelectionMenu = contextMenu.getMultiSelectionMenu();
WeakReference<MapContextMenuFragment> contextMenuMenuFragmentRef = contextMenu.findMenuFragment();
MapContextMenuFragment contextMenuMenuFragment = contextMenuMenuFragmentRef != null ? contextMenuMenuFragmentRef.get() : null;
@ -397,6 +399,8 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
contextMenuLayer.isInGpxDetailsMode() ||
measurementToolLayer.isInMeasurementMode() ||
mapMarkersLayer.isInPlanRouteMode() ||
mapRouteInfoMenu.isVisible() ||
MapRouteInfoMenu.chooseRoutesVisible ||
contextMenu.isVisible() && contextMenuMenuFragment != null && !contextMenuMenuFragment.isRemoving() ||
contextMenu.isVisible() && contextMenuMenuFragment != null && contextMenuMenuFragment.isAdded() ||
multiSelectionMenu.isVisible() && multiMenuFragment != null && multiMenuFragment.isAdded() ||