Add recordings to local manager
This commit is contained in:
parent
c8612654be
commit
8eae34b9e1
4 changed files with 26 additions and 11 deletions
|
@ -150,6 +150,10 @@ public abstract class OsmandPlugin {
|
|||
|
||||
public List<String> indexingFiles(IProgress progress) { return null;}
|
||||
|
||||
public boolean mapActivityKeyUp(MapActivity mapActivity, int keyCode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onMapActivityExternalResult(int requestCode, int resultCode, Intent data) {
|
||||
}
|
||||
|
||||
|
@ -306,6 +310,13 @@ public abstract class OsmandPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean onMapActivityKeyUp(MapActivity mapActivity, int keyCode) {
|
||||
for(OsmandPlugin p : installedPlugins){
|
||||
if(p.mapActivityKeyUp(mapActivity, keyCode))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1295,6 +1295,8 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
|||
LatLon l = mapView.getLatLonFromScreenPoint(mapView.getCenterPointX() + dx, mapView.getCenterPointY() + dy);
|
||||
setMapLocation(l.getLatitude(), l.getLongitude());
|
||||
return true;
|
||||
} else if(OsmandPlugin.onMapActivityKeyUp(this, keyCode)) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(keyCode,event);
|
||||
}
|
||||
|
|
|
@ -18,23 +18,16 @@ import net.osmand.plus.views.OsmandMapTileView;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.BitmapFactory.Options;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Paint.Style;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.RectF;
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.MediaPlayer.OnPreparedListener;
|
||||
import android.net.Uri;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class AudioNotesLayer extends OsmandMapLayer implements IContextMenuProvider {
|
||||
|
|
|
@ -691,9 +691,9 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
}
|
||||
};
|
||||
if(ri.rec.isPhoto()) {
|
||||
adapter.registerItem(R.string.recording_context_menu_show, 0, listener, -1);
|
||||
adapter.registerItem(R.string.recording_context_menu_show, 0, listener, 0);
|
||||
} else {
|
||||
adapter.registerItem(R.string.recording_context_menu_play, 0, listener, -1);
|
||||
adapter.registerItem(R.string.recording_context_menu_play, 0, listener, 0);
|
||||
}
|
||||
adapter.registerItem(R.string.show_location, 0, new OnContextMenuClick() {
|
||||
@Override
|
||||
|
@ -795,5 +795,14 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
AccessibleToast.makeText(ctx, R.string.recording_can_not_be_played, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mapActivityKeyUp(MapActivity mapActivity, int keyCode) {
|
||||
if (keyCode == KeyEvent.KEYCODE_CAMERA) {
|
||||
defaultAction(mapActivity);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue