diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java index 5ab04e5637..10003bb637 100644 --- a/OsmAnd/src/net/osmand/AndroidUtils.java +++ b/OsmAnd/src/net/osmand/AndroidUtils.java @@ -40,6 +40,12 @@ public class AndroidUtils { return DateFormat.getDateFormat(ctx).format(new Date(time)); } + public static String formatDateTime(Context ctx, long time) { + Date d = new Date(time); + return DateFormat.getDateFormat(ctx).format(d) + + " " + DateFormat.getTimeFormat(ctx).format(d); + } + public static String formatTime(Context ctx, long time) { return DateFormat.getTimeFormat(ctx).format(new Date(time)); } diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 71317fff01..67a5099d6b 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -275,20 +275,23 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { public String getDescription(Context ctx) { String nm = name == null ? "" : name; + String time = AndroidUtils.formatDateTime(ctx, file.lastModified()); if (isPhoto()) { - return ctx.getString(R.string.recording_photo_description, nm, AndroidUtils.formatTime(ctx, file.lastModified())).trim(); + return ctx.getString(R.string.recording_photo_description, nm, time).trim(); } updateInternalDescription(); - return ctx.getString(R.string.recording_description, nm, getDuration(ctx), AndroidUtils.formatTime(ctx, file.lastModified())) + return ctx.getString(R.string.recording_description, nm, getDuration(ctx), time) .trim(); } public String getSmallDescription(Context ctx) { String nm = name == null ? "" : name; + + String time = AndroidUtils.formatDateTime(ctx,file.lastModified()); if (isPhoto()) { - return ctx.getString(R.string.recording_photo_description, nm, AndroidUtils.formatTime(ctx,file.lastModified())).trim(); + return ctx.getString(R.string.recording_photo_description, nm, time).trim(); } - return ctx.getString(R.string.recording_description, nm, "", AndroidUtils.formatTime(ctx, file.lastModified())).trim(); + return ctx.getString(R.string.recording_description, nm, "", time).trim(); } private String getDuration(Context ctx) { @@ -307,6 +310,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { private static void initializeRemoteControlRegistrationMethods() { try { + // API 8 if (mRegisterMediaButtonEventReceiver == null) { mRegisterMediaButtonEventReceiver = AudioManager.class.getMethod("registerMediaButtonEventReceiver", new Class[] { ComponentName.class }); diff --git a/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java b/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java index 70d1c9b05a..f529e8e33a 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java @@ -15,7 +15,7 @@ public class MediaRemoteControlReceiver extends BroadcastReceiver { AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); if(plugin != null && intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) != null) { System.out.println("OsmAnd AV Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0)); - Toast.makeText(context, "Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0), Toast.LENGTH_LONG).show(); + // Toast.makeText(context, "Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0), Toast.LENGTH_LONG).show(); } } }