From cb426eae75b20e58ededbb39964990124653abaa Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 20 Jan 2020 15:55:43 +0200 Subject: [PATCH] Register multimedia plugin preferences --- .../audionotes/AudioVideoNotesPlugin.java | 30 +++++++++---------- .../audionotes/MultimediaNotesFragment.java | 1 + 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 36e8bcc4f2..4b08add243 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -51,7 +51,6 @@ import net.osmand.plus.ContextMenuAdapter.ItemClickListener; import net.osmand.plus.ContextMenuItem; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings.CommonPreference; import net.osmand.plus.OsmandSettings.OsmandPreference; import net.osmand.plus.R; @@ -537,27 +536,26 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { public AudioVideoNotesPlugin(OsmandApplication app) { this.app = app; - OsmandSettings settings = app.getSettings(); ApplicationMode.regWidgetVisibility("audionotes", (ApplicationMode[]) null); - AV_EXTERNAL_RECORDER = settings.registerBooleanPreference("av_external_recorder", false); - AV_EXTERNAL_PHOTO_CAM = settings.registerBooleanPreference("av_external_cam", true); - AV_VIDEO_FORMAT = settings.registerIntPreference("av_video_format", VIDEO_OUTPUT_MP4); - AV_VIDEO_QUALITY = settings.registerIntPreference("av_video_quality", VIDEO_QUALITY_DEFAULT); - AV_AUDIO_FORMAT = settings.registerIntPreference("av_audio_format", AUDIO_FORMAT_DEFAULT); - AV_AUDIO_BITRATE = settings.registerIntPreference("av_audio_bitrate", AUDIO_BITRATE_DEFAULT); - AV_DEFAULT_ACTION = settings.registerIntPreference("av_default_action", AV_DEFAULT_ACTION_CHOOSE); + AV_EXTERNAL_RECORDER = registerBooleanPreference(app, "av_external_recorder", false); + AV_EXTERNAL_PHOTO_CAM = registerBooleanPreference(app, "av_external_cam", true); + AV_VIDEO_FORMAT = registerIntPreference(app, "av_video_format", VIDEO_OUTPUT_MP4); + AV_VIDEO_QUALITY = registerIntPreference(app, "av_video_quality", VIDEO_QUALITY_DEFAULT); + AV_AUDIO_FORMAT = registerIntPreference(app, "av_audio_format", AUDIO_FORMAT_DEFAULT); + AV_AUDIO_BITRATE = registerIntPreference(app, "av_audio_bitrate", AUDIO_BITRATE_DEFAULT); + AV_DEFAULT_ACTION = registerIntPreference(app, "av_default_action", AV_DEFAULT_ACTION_CHOOSE); // camera picture size: - AV_CAMERA_PICTURE_SIZE = settings.registerIntPreference("av_camera_picture_size", AV_PHOTO_SIZE_DEFAULT); + AV_CAMERA_PICTURE_SIZE = registerIntPreference(app, "av_camera_picture_size", AV_PHOTO_SIZE_DEFAULT); // camera focus type: - AV_CAMERA_FOCUS_TYPE = settings.registerIntPreference("av_camera_focus_type", AV_CAMERA_FOCUS_AUTO); + AV_CAMERA_FOCUS_TYPE = registerIntPreference(app, "av_camera_focus_type", AV_CAMERA_FOCUS_AUTO); // camera sound: - AV_PHOTO_PLAY_SOUND = settings.registerBooleanPreference("av_photo_play_sound", true); + AV_PHOTO_PLAY_SOUND = registerBooleanPreference(app, "av_photo_play_sound", true); - SHOW_RECORDINGS = settings.registerBooleanPreference("show_recordings", true); + SHOW_RECORDINGS = registerBooleanPreference(app, "show_recordings", true); - AV_RECORDER_SPLIT = settings.registerBooleanPreference("av_recorder_split", false); - AV_RS_CLIP_LENGTH = settings.registerIntPreference("av_rs_clip_length", CLIP_LENGTH_DEFAULT); - AV_RS_STORAGE_SIZE = settings.registerIntPreference("av_rs_storage_size", STORAGE_SIZE_DEFAULT); + AV_RECORDER_SPLIT = registerBooleanPreference(app, "av_recorder_split", false); + AV_RS_CLIP_LENGTH = registerIntPreference(app, "av_rs_clip_length", CLIP_LENGTH_DEFAULT); + AV_RS_STORAGE_SIZE = registerIntPreference(app, "av_rs_storage_size", STORAGE_SIZE_DEFAULT); } @Override diff --git a/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java index 58fddf092c..26660951e2 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java @@ -6,6 +6,7 @@ import android.media.CamcorderProfile; import android.media.MediaRecorder; import android.os.Build; import android.os.StatFs; +import android.support.v4.app.FragmentManager; import android.support.v7.preference.Preference; import net.osmand.PlatformUtil;