Create setter for usedOnMap
This commit is contained in:
parent
da49f91651
commit
bfc273140f
10 changed files with 10 additions and 6 deletions
|
@ -20,6 +20,10 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
|
||||
protected boolean usedOnMap;
|
||||
|
||||
public void setUsedOnMap(boolean usedOnMap) {
|
||||
this.usedOnMap = usedOnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
|
|
@ -538,6 +538,7 @@ public class GpxImportHelper {
|
|||
importFavoritesImpl(gpxFile, fileName, true);
|
||||
} else {
|
||||
ImportGpxBottomSheetDialogFragment fragment = new ImportGpxBottomSheetDialogFragment();
|
||||
fragment.setUsedOnMap(true);
|
||||
fragment.setGpxImportHelper(this);
|
||||
fragment.setGpxFile(gpxFile);
|
||||
fragment.setFileName(fileName);
|
||||
|
@ -632,7 +633,6 @@ public class GpxImportHelper {
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
usedOnMap = true;
|
||||
boolean night = isNightMode();
|
||||
final int themeRes = night ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ public class HistoryMarkerMenuBottomSheetDialogFragment extends MenuBottomSheetD
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
usedOnMap = true;
|
||||
final boolean nightMode = isNightMode();
|
||||
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel
|
|||
if (item instanceof MapMarker) {
|
||||
MapMarker marker = (MapMarker) item;
|
||||
HistoryMarkerMenuBottomSheetDialogFragment fragment = new HistoryMarkerMenuBottomSheetDialogFragment();
|
||||
fragment.setUsedOnMap(true);
|
||||
Bundle arguments = new Bundle();
|
||||
arguments.putInt(HistoryMarkerMenuBottomSheetDialogFragment.MARKER_POSITION, pos);
|
||||
arguments.putString(HistoryMarkerMenuBottomSheetDialogFragment.MARKER_NAME, marker.getName(mapActivity));
|
||||
|
|
|
@ -713,6 +713,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
|
|||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
PlanRouteOptionsBottomSheetDialogFragment fragment = new PlanRouteOptionsBottomSheetDialogFragment();
|
||||
fragment.setUsedOnMap(true);
|
||||
fragment.setSelectAll(!(selectedCount == markersHelper.getMapMarkers().size() && markersHelper.isStartFromMyLocation()));
|
||||
fragment.setListener(createOptionsFragmentListener());
|
||||
fragment.show(mapActivity.getSupportFragmentManager(), PlanRouteOptionsBottomSheetDialogFragment.TAG);
|
||||
|
|
|
@ -33,7 +33,6 @@ public class PlanRouteOptionsBottomSheetDialogFragment extends MenuBottomSheetDi
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
usedOnMap = true;
|
||||
boolean portrait = AndroidUiHelper.isOrientationPortrait(getActivity());
|
||||
boolean night = isNightMode();
|
||||
final int themeRes = night ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
|
|
|
@ -274,6 +274,7 @@ public class MeasurementToolFragment extends Fragment {
|
|||
@Override
|
||||
public void onClick(View view) {
|
||||
OptionsBottomSheetDialogFragment fragment = new OptionsBottomSheetDialogFragment();
|
||||
fragment.setUsedOnMap(true);
|
||||
fragment.setSnapToRoadEnabled(editingCtx.isInSnapToRoadMode());
|
||||
fragment.setListener(createOptionsFragmentListener());
|
||||
fragment.setAddLineMode(newGpxData != null);
|
||||
|
@ -807,12 +808,14 @@ public class MeasurementToolFragment extends Fragment {
|
|||
|
||||
private void openSelectedPointMenu(MapActivity mapActivity) {
|
||||
SelectedPointBottomSheetDialogFragment fragment = new SelectedPointBottomSheetDialogFragment();
|
||||
fragment.setUsedOnMap(true);
|
||||
fragment.setListener(createSelectedPointFragmentListener());
|
||||
fragment.show(mapActivity.getSupportFragmentManager(), SelectedPointBottomSheetDialogFragment.TAG);
|
||||
}
|
||||
|
||||
private void openSaveAsNewTrackMenu(MapActivity mapActivity) {
|
||||
SaveAsNewTrackBottomSheetDialogFragment fragment = new SaveAsNewTrackBottomSheetDialogFragment();
|
||||
fragment.setUsedOnMap(true);
|
||||
fragment.setListener(createSaveAsNewTrackFragmentListener());
|
||||
fragment.show(mapActivity.getSupportFragmentManager(), SaveAsNewTrackBottomSheetDialogFragment.TAG);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ public class OptionsBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
usedOnMap = true;
|
||||
boolean nightMode = isNightMode();
|
||||
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
usedOnMap = true;
|
||||
boolean nightMode = isNightMode();
|
||||
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ public class SelectedPointBottomSheetDialogFragment extends MenuBottomSheetDialo
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
usedOnMap = true;
|
||||
final MapActivity mapActivity = (MapActivity) getActivity();
|
||||
boolean nightMode = isNightMode();
|
||||
final MeasurementToolLayer measurementLayer = mapActivity.getMapLayers().getMeasurementToolLayer();
|
||||
|
|
Loading…
Reference in a new issue