From 9c588dce9591163c0e2bc2c48376b51f907fba9c Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Tue, 12 Nov 2019 16:44:28 +0300 Subject: [PATCH] Fix "Directions->Options->GPX route" theme of popup is switching immediately --- .../plus/routepreparationmenu/RouteOptionsBottomSheet.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java index edf19f77d5..65807fc1f2 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java @@ -4,6 +4,7 @@ import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.content.ContextCompat; +import android.support.v7.view.ContextThemeWrapper; import android.support.v7.widget.PopupMenu; import android.view.MenuItem; import android.view.View; @@ -426,9 +427,9 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { }, nightMode); } - private void showOptionsMenu(final TextView gpxSpinner) { + private void showOptionsMenu(View view) { RouteProvider.GPXRouteParamsBuilder rp = mapActivity.getRoutingHelper().getCurrentGPXRoute(); - final PopupMenu optionsMenu = new PopupMenu(gpxSpinner.getContext(), gpxSpinner); + final PopupMenu optionsMenu = new PopupMenu(new ContextThemeWrapper(view.getContext(), themeRes), view); MenuItem item = optionsMenu.getMenu().add( mapActivity.getString(R.string.shared_string_none)); item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {