Merge pull request #6798 from osmandapp/GpxPointsFixes

Fix selecting route points in track
This commit is contained in:
Alexey 2019-04-08 18:07:35 +03:00 committed by GitHub
commit 850bfe600c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,6 +157,9 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
setUpdateEnable(false); setUpdateEnable(false);
if (actionMode != null) {
actionMode.finish();
}
if (optionsMenu != null) { if (optionsMenu != null) {
optionsMenu.close(); optionsMenu.close();
} }
@ -1004,7 +1007,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
public void onClick(View v) { public void onClick(View v) {
List<GpxDisplayItem> items = itemGroups.get(group); List<GpxDisplayItem> items = itemGroups.get(group);
if (ch.isChecked()) { if (ch.isChecked()) {
if (groupPosition == 0) { if (groupPosition == 0 && groups.size() > 1) {
setTrackPointsSelection(true); setTrackPointsSelection(true);
} else { } else {
setGroupSelection(items, groupPosition, true); setGroupSelection(items, groupPosition, true);
@ -1027,7 +1030,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
} }
private void setTrackPointsSelection(boolean select) { private void setTrackPointsSelection(boolean select) {
if (groups.size() > 1) { if (!groups.isEmpty()) {
setGroupSelection(null, 0, select); setGroupSelection(null, 0, select);
for (int i = 1; i < groups.size(); i++) { for (int i = 1; i < groups.size(); i++) {
GpxDisplayGroup g = groups.get(i); GpxDisplayGroup g = groups.get(i);