commit
d6ca7e11da
7 changed files with 26 additions and 14 deletions
|
@ -163,9 +163,7 @@ public class Multipolygon {
|
||||||
* @return true if this multipolygon is correct and contains the point
|
* @return true if this multipolygon is correct and contains the point
|
||||||
*/
|
*/
|
||||||
public boolean containsPoint(LatLon point) {
|
public boolean containsPoint(LatLon point) {
|
||||||
|
|
||||||
return containsPoint(point.getLatitude(), point.getLongitude());
|
return containsPoint(point.getLatitude(), point.getLongitude());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int countOuterPolygons() {
|
public int countOuterPolygons() {
|
||||||
|
|
|
@ -259,7 +259,7 @@ public class IntentHelper {
|
||||||
String path = intent.getStringExtra(TRACK_FILE_NAME);
|
String path = intent.getStringExtra(TRACK_FILE_NAME);
|
||||||
String name = intent.getStringExtra(RETURN_SCREEN_NAME);
|
String name = intent.getStringExtra(RETURN_SCREEN_NAME);
|
||||||
boolean currentRecording = intent.getBooleanExtra(CURRENT_RECORDING, false);
|
boolean currentRecording = intent.getBooleanExtra(CURRENT_RECORDING, false);
|
||||||
TrackMenuFragment.showInstance(mapActivity, path, currentRecording, null, name);
|
TrackMenuFragment.showInstance(mapActivity, path, currentRecording, null, name, null);
|
||||||
mapActivity.setIntent(null);
|
mapActivity.setIntent(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SelectedGpxMenuController extends MenuController {
|
||||||
LatLon latLon = new LatLon(wptPt.lat, wptPt.lon);
|
LatLon latLon = new LatLon(wptPt.lat, wptPt.lon);
|
||||||
SelectedGpxFile selectedGpxFile = selectedGpxPoint.getSelectedGpxFile();
|
SelectedGpxFile selectedGpxFile = selectedGpxPoint.getSelectedGpxFile();
|
||||||
String path = selectedGpxFile.getGpxFile().path;
|
String path = selectedGpxFile.getGpxFile().path;
|
||||||
TrackMenuFragment.showInstance(mapActivity, path, selectedGpxFile.isShowCurrentTrack(), latLon, null);
|
TrackMenuFragment.showInstance(mapActivity, path, selectedGpxFile.isShowCurrentTrack(), latLon, null, null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_open_track);
|
leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_open_track);
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class WptPtMenuController extends MenuController {
|
||||||
SelectedGpxFile selectedGpxFile = selectionHelper.getSelectedGPXFile(wpt);
|
SelectedGpxFile selectedGpxFile = selectionHelper.getSelectedGPXFile(wpt);
|
||||||
if (selectedGpxFile != null) {
|
if (selectedGpxFile != null) {
|
||||||
String path = selectedGpxFile.getGpxFile().path;
|
String path = selectedGpxFile.getGpxFile().path;
|
||||||
TrackMenuFragment.showInstance(mapActivity, path, selectedGpxFile.isShowCurrentTrack(), new LatLon(wpt.lon, wpt.lat), null);
|
TrackMenuFragment.showInstance(mapActivity, path, selectedGpxFile.isShowCurrentTrack(), new LatLon(wpt.lon, wpt.lat), null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -416,7 +416,8 @@ public class QuickSearchListAdapter extends ArrayAdapter<QuickSearchListItem> {
|
||||||
LinearLayout view = getLinearLayout(convertView, R.layout.search_gpx_list_item);
|
LinearLayout view = getLinearLayout(convertView, R.layout.search_gpx_list_item);
|
||||||
SearchResult sr = listItem.getSearchResult();
|
SearchResult sr = listItem.getSearchResult();
|
||||||
setupCheckBox(position, view, listItem);
|
setupCheckBox(position, view, listItem);
|
||||||
GpxUiHelper.updateGpxInfoView(app, view, sr.localeName, listItem.getIcon(), gpxInfo);
|
String gpxTitle = GpxUiHelper.getGpxTitle(sr.localeName);
|
||||||
|
GpxUiHelper.updateGpxInfoView(app, view, gpxTitle, listItem.getIcon(), gpxInfo);
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
||||||
SearchHistoryHelper.getInstance(app).addNewItemToHistory(gpxInfo);
|
SearchHistoryHelper.getInstance(app).addNewItemToHistory(gpxInfo);
|
||||||
File file = new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), gpxInfo.getFileName());
|
File file = new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), gpxInfo.getFileName());
|
||||||
String path = file.getAbsolutePath();
|
String path = file.getAbsolutePath();
|
||||||
TrackMenuFragment.showInstance(mapActivity, path, false, null, QuickSearchDialogFragment.TAG);
|
TrackMenuFragment.showInstance(mapActivity, path, false, null, null, QuickSearchDialogFragment.TAG);
|
||||||
dialogFragment.dismiss();
|
dialogFragment.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
|
|
||||||
private String gpxTitle;
|
private String gpxTitle;
|
||||||
private String returnScreenName;
|
private String returnScreenName;
|
||||||
|
private String callingFragmentTag;
|
||||||
private TrackChartPoints trackChartPoints;
|
private TrackChartPoints trackChartPoints;
|
||||||
|
|
||||||
private Float heading;
|
private Float heading;
|
||||||
|
@ -272,7 +273,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
if (contextMenu.isActive() && contextMenu.getPointDescription() != null
|
if (contextMenu.isActive() && contextMenu.getPointDescription() != null
|
||||||
&& contextMenu.getPointDescription().isGpxPoint()) {
|
&& contextMenu.getPointDescription().isGpxPoint()) {
|
||||||
contextMenu.show();
|
contextMenu.show();
|
||||||
} else if (Algorithms.objectEquals(returnScreenName, QuickSearchDialogFragment.TAG)) {
|
} else if (Algorithms.objectEquals(callingFragmentTag, QuickSearchDialogFragment.TAG)) {
|
||||||
mapActivity.showQuickSearch(ShowQuickSearchMode.CURRENT, false);
|
mapActivity.showQuickSearch(ShowQuickSearchMode.CURRENT, false);
|
||||||
} else {
|
} else {
|
||||||
mapActivity.launchPrevActivityIntent();
|
mapActivity.launchPrevActivityIntent();
|
||||||
|
@ -311,6 +312,10 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
this.returnScreenName = returnScreenName;
|
this.returnScreenName = returnScreenName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCallingFragmentTag(String callingFragmentTag) {
|
||||||
|
this.callingFragmentTag = callingFragmentTag;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = super.onCreateView(inflater, container, savedInstanceState);
|
View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
@ -1259,7 +1264,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
boolean currentRecording = file == null;
|
boolean currentRecording = file == null;
|
||||||
String path = file != null ? file.getAbsolutePath() : null;
|
String path = file != null ? file.getAbsolutePath() : null;
|
||||||
if (context instanceof MapActivity) {
|
if (context instanceof MapActivity) {
|
||||||
TrackMenuFragment.showInstance((MapActivity) context, path, currentRecording, null, null);
|
TrackMenuFragment.showInstance((MapActivity) context, path, currentRecording, null, null, null);
|
||||||
} else {
|
} else {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(TRACK_FILE_NAME, path);
|
bundle.putString(TRACK_FILE_NAME, path);
|
||||||
|
@ -1307,23 +1312,30 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showInstance(@NonNull MapActivity mapActivity, @Nullable String path,
|
public static void showInstance(@NonNull MapActivity mapActivity,
|
||||||
boolean showCurrentTrack, @Nullable final LatLon latLon, @Nullable final String returnScreenName) {
|
@Nullable String path,
|
||||||
|
boolean showCurrentTrack,
|
||||||
|
@Nullable final LatLon latLon,
|
||||||
|
@Nullable final String returnScreenName,
|
||||||
|
@Nullable final String callingFragmentTag) {
|
||||||
final WeakReference<MapActivity> mapActivityRef = new WeakReference<>(mapActivity);
|
final WeakReference<MapActivity> mapActivityRef = new WeakReference<>(mapActivity);
|
||||||
loadSelectedGpxFile(mapActivity, path, showCurrentTrack, new CallbackWithObject<SelectedGpxFile>() {
|
loadSelectedGpxFile(mapActivity, path, showCurrentTrack, new CallbackWithObject<SelectedGpxFile>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean processResult(SelectedGpxFile selectedGpxFile) {
|
public boolean processResult(SelectedGpxFile selectedGpxFile) {
|
||||||
MapActivity mapActivity = mapActivityRef.get();
|
MapActivity mapActivity = mapActivityRef.get();
|
||||||
if (mapActivity != null && selectedGpxFile != null) {
|
if (mapActivity != null && selectedGpxFile != null) {
|
||||||
showInstance(mapActivity, selectedGpxFile, latLon, returnScreenName);
|
showInstance(mapActivity, selectedGpxFile, latLon, returnScreenName, callingFragmentTag);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean showInstance(@NonNull MapActivity mapActivity, @NonNull SelectedGpxFile selectedGpxFile,
|
public static boolean showInstance(@NonNull MapActivity mapActivity,
|
||||||
@Nullable LatLon latLon, @Nullable String returnScreenName) {
|
@NonNull SelectedGpxFile selectedGpxFile,
|
||||||
|
@Nullable LatLon latLon,
|
||||||
|
@Nullable String returnScreenName,
|
||||||
|
@Nullable String callingFragmentTag) {
|
||||||
try {
|
try {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putInt(ContextMenuFragment.MENU_STATE_KEY, MenuState.HEADER_ONLY);
|
args.putInt(ContextMenuFragment.MENU_STATE_KEY, MenuState.HEADER_ONLY);
|
||||||
|
@ -1333,6 +1345,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
fragment.setRetainInstance(true);
|
fragment.setRetainInstance(true);
|
||||||
fragment.setSelectedGpxFile(selectedGpxFile);
|
fragment.setSelectedGpxFile(selectedGpxFile);
|
||||||
fragment.setReturnScreenName(returnScreenName);
|
fragment.setReturnScreenName(returnScreenName);
|
||||||
|
fragment.setCallingFragmentTag(callingFragmentTag);
|
||||||
|
|
||||||
if (latLon != null) {
|
if (latLon != null) {
|
||||||
fragment.setLatLon(latLon);
|
fragment.setLatLon(latLon);
|
||||||
|
|
Loading…
Reference in a new issue