Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fc633fcd3d
3 changed files with 33 additions and 1 deletions
|
@ -274,7 +274,11 @@ public class MapContextMenu extends MenuTitleController {
|
|||
}
|
||||
|
||||
public void buttonSharePressed() {
|
||||
ShareMenu.show(latLon, nameStr, mapActivity);
|
||||
if (menuController != null) {
|
||||
menuController.share(latLon, nameStr);
|
||||
} else {
|
||||
ShareMenu.show(latLon, nameStr, mapActivity);
|
||||
}
|
||||
}
|
||||
|
||||
public void buttonMorePressed() {
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.osmand.plus.mapcontextmenu.controllers.ParkingPositionMenuController;
|
|||
import net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.AudioVideoNoteMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
|
||||
import net.osmand.plus.mapcontextmenu.other.ShareMenu;
|
||||
import net.osmand.plus.osmedit.OsmPoint;
|
||||
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
|
||||
|
||||
|
@ -217,4 +218,8 @@ public abstract class MenuController extends BaseMenuController {
|
|||
public String getTypeStr() { return ""; }
|
||||
|
||||
public String getNameStr() { return ""; }
|
||||
|
||||
public void share(LatLon latLon, String title) {
|
||||
ShareMenu.show(latLon, title, getMapActivity());
|
||||
}
|
||||
}
|
|
@ -1,7 +1,10 @@
|
|||
package net.osmand.plus.mapcontextmenu.controllers;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
|
@ -76,4 +79,24 @@ public class AudioVideoNoteMenuController extends MenuController {
|
|||
public boolean needStreetName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share(LatLon latLon, String title) {
|
||||
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
|
||||
if (recording.isPhoto()) {
|
||||
Uri screenshotUri = Uri.parse(recording.getFile().getAbsolutePath());
|
||||
sharingIntent.setType("image/*");
|
||||
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
|
||||
} else if (recording.isAudio()) {
|
||||
Uri audioUri = Uri.parse(recording.getFile().getAbsolutePath());
|
||||
sharingIntent.setType("audio/*");
|
||||
sharingIntent.putExtra(Intent.EXTRA_STREAM, audioUri);
|
||||
} else if (recording.isVideo()) {
|
||||
Uri videoUri = Uri.parse(recording.getFile().getAbsolutePath());
|
||||
sharingIntent.setType("video/*");
|
||||
sharingIntent.putExtra(Intent.EXTRA_STREAM, videoUri);
|
||||
}
|
||||
getMapActivity().getContextMenu().findMenuFragment()
|
||||
.startActivity(Intent.createChooser(sharingIntent, getMapActivity().getString(R.string.share_note)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue