Open wpt menu from TrackMenuFragment
This commit is contained in:
parent
2f74a497d0
commit
d01ff166d1
2 changed files with 11 additions and 1 deletions
|
@ -828,7 +828,9 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
|||
|
||||
@Override
|
||||
protected void onHeaderClick() {
|
||||
updateMenuState();
|
||||
if (getCurrentMenuState() == MenuState.HEADER_ONLY) {
|
||||
updateMenuState();
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustMapPosition(int y) {
|
||||
|
|
|
@ -26,6 +26,8 @@ import net.osmand.AndroidUtils;
|
|||
import net.osmand.Collator;
|
||||
import net.osmand.GPXUtilities.WptPt;
|
||||
import net.osmand.OsmAndCollator;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItemType;
|
||||
|
@ -173,6 +175,12 @@ public class TrackPointsCard extends BaseCard implements OnChildClickListener, O
|
|||
|
||||
@Override
|
||||
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
|
||||
GpxDisplayItem item = adapter.getChild(groupPosition, childPosition);
|
||||
if (item != null && item.locationStart != null) {
|
||||
LatLon location = new LatLon(item.locationStart.lat, item.locationStart.lon);
|
||||
PointDescription description = new PointDescription(PointDescription.POINT_TYPE_WPT, item.name);
|
||||
mapActivity.getContextMenu().show(location, description, item.locationStart);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue