From 276c47d4f0f29984c80937619f7279c1eafd97f7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Sep 2016 20:35:03 +0200 Subject: [PATCH] remove the Focus before capture feature --- .../com/simplemobiletools/camera/Config.java | 8 ------ .../simplemobiletools/camera/Constants.java | 1 - .../com/simplemobiletools/camera/Preview.java | 12 +-------- .../camera/activities/MainActivity.java | 2 +- .../camera/activities/SettingsActivity.java | 12 --------- app/src/main/res/layout/activity_settings.xml | 26 ------------------- app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-ja/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sv/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 12 files changed, 2 insertions(+), 65 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/camera/Config.java b/app/src/main/java/com/simplemobiletools/camera/Config.java index 03d58dce..c498ce6a 100644 --- a/app/src/main/java/com/simplemobiletools/camera/Config.java +++ b/app/src/main/java/com/simplemobiletools/camera/Config.java @@ -38,14 +38,6 @@ public class Config { mPrefs.edit().putBoolean(Constants.USE_DCIM, useDCIM).apply(); } - public boolean getFocusBeforeCaptureEnabled() { - return mPrefs.getBoolean(Constants.FOCUS_BEFORE_CAPTURE, false); - } - - public void setFocusBeforeCaptureEnabled(boolean enabled) { - mPrefs.edit().putBoolean(Constants.FOCUS_BEFORE_CAPTURE, enabled).apply(); - } - public boolean getForceRatioEnabled() { return mPrefs.getBoolean(Constants.FORCE_RATIO, true); } diff --git a/app/src/main/java/com/simplemobiletools/camera/Constants.java b/app/src/main/java/com/simplemobiletools/camera/Constants.java index 27268aa3..5d3ef5cf 100644 --- a/app/src/main/java/com/simplemobiletools/camera/Constants.java +++ b/app/src/main/java/com/simplemobiletools/camera/Constants.java @@ -10,7 +10,6 @@ public class Constants { public static final String IS_FIRST_RUN = "is_first_run"; public static final String IS_DARK_THEME = "is_dark_theme"; public static final String USE_DCIM = "use_dcim"; - public static final String FOCUS_BEFORE_CAPTURE = "focus_before_capture"; public static final String SOUND = "sound"; public static final String FORCE_RATIO = "force_ratio"; public static final String MAX_RESOLUTION = "max_resolution"; diff --git a/app/src/main/java/com/simplemobiletools/camera/Preview.java b/app/src/main/java/com/simplemobiletools/camera/Preview.java index ac060fd4..33b6debc 100644 --- a/app/src/main/java/com/simplemobiletools/camera/Preview.java +++ b/app/src/main/java/com/simplemobiletools/camera/Preview.java @@ -59,7 +59,6 @@ public class Preview extends ViewGroup private static boolean mIsSurfaceCreated; private static boolean mSwitchToVideoAsap; private static boolean mSetupPreviewAfterMeasure; - private static boolean mFocusBeforeCapture; private static boolean mForceAspectRatio; private static boolean mWasZooming; private static int mLastClickX; @@ -156,7 +155,6 @@ public class Preview extends ViewGroup } final Config config = Config.newInstance(mContext); - mFocusBeforeCapture = config.getFocusBeforeCaptureEnabled(); mForceAspectRatio = config.getForceRatioEnabled(); return true; @@ -258,15 +256,7 @@ public class Preview extends ViewGroup } } - public void tryTakePicture() { - if (mFocusBeforeCapture) { - focusArea(true); - } else { - takePicture(); - } - } - - private void takePicture() { + public void takePicture() { if (mCanTakePicture) { if (mIsFlashEnabled) { mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); diff --git a/app/src/main/java/com/simplemobiletools/camera/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/camera/activities/MainActivity.java index 306c85e6..7ae60ee0 100644 --- a/app/src/main/java/com/simplemobiletools/camera/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/camera/activities/MainActivity.java @@ -291,7 +291,7 @@ public class MainActivity extends SimpleActivity private void handleShutter() { if (mIsInPhotoMode) { mShutterBtn.animate().rotationBy(90).start(); - mPreview.tryTakePicture(); + mPreview.takePicture(); } else { final Resources res = getResources(); final boolean isRecording = mPreview.toggleRecording(); diff --git a/app/src/main/java/com/simplemobiletools/camera/activities/SettingsActivity.java b/app/src/main/java/com/simplemobiletools/camera/activities/SettingsActivity.java index 33e5e50e..2bfb3ed5 100644 --- a/app/src/main/java/com/simplemobiletools/camera/activities/SettingsActivity.java +++ b/app/src/main/java/com/simplemobiletools/camera/activities/SettingsActivity.java @@ -19,7 +19,6 @@ import butterknife.OnItemSelected; public class SettingsActivity extends SimpleActivity { @BindView(R.id.settings_dark_theme) SwitchCompat mDarkThemeSwitch; @BindView(R.id.settings_use_dcim) SwitchCompat mUseDCIMSwitch; - @BindView(R.id.settings_focus_before_capture) SwitchCompat mFocusBeforeCaptureSwitch; @BindView(R.id.settings_sound) SwitchCompat mSoundSwitch; @BindView(R.id.settings_force_ratio) SwitchCompat mForceRatioSwitch; @BindView(R.id.settings_max_photo_resolution) AppCompatSpinner mMaxPhotoResolutionSpinner; @@ -36,7 +35,6 @@ public class SettingsActivity extends SimpleActivity { setupDarkTheme(); setupUseDCIM(); - setupFocusBeforeCapture(); setupSound(); setupForceRatio(); setupMaxPhotoResolution(); @@ -69,10 +67,6 @@ public class SettingsActivity extends SimpleActivity { mUseDCIMSwitch.setChecked(mConfig.getUseDCIMFolder()); } - private void setupFocusBeforeCapture() { - mFocusBeforeCaptureSwitch.setChecked(mConfig.getFocusBeforeCaptureEnabled()); - } - private void setupSound() { mSoundSwitch.setChecked(mConfig.getIsSoundEnabled()); } @@ -102,12 +96,6 @@ public class SettingsActivity extends SimpleActivity { mConfig.setUseDCIMFolder(mUseDCIMSwitch.isChecked()); } - @OnClick(R.id.settings_focus_before_capture_holder) - public void handleFocusBeforeCapture() { - mFocusBeforeCaptureSwitch.setChecked(!mFocusBeforeCaptureSwitch.isChecked()); - mConfig.setFocusBeforeCaptureEnabled(mFocusBeforeCaptureSwitch.isChecked()); - } - @OnClick(R.id.settings_sound_holder) public void handleSound() { mSoundSwitch.setChecked(!mSoundSwitch.isChecked()); diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 224f6b5f..ff3d0f11 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -64,32 +64,6 @@ - - - - - - - - Einstellungen Dunkles Thema Speichere Dateien im vorgegebenen DCIM Ordner - Vor der Aufnahme fokussieren Erzwinge 16:9 Format Maximale Fotoauflösung Maximale Videoauflösung diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 29f4621f..a1f5d247 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -19,7 +19,6 @@ Impostazioni Tema scuro Store media in the default DCIM folder - Messa a fuoco prima della cattura Forza proporzione 16:9 Limite risoluzione foto Video resolution limit diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 26b4282f..0163d94e 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -19,7 +19,6 @@ 設定 ダークテーマ Store media in the default DCIM folder - キャプチャ前に再度焦点を合わせる 強制的に 16:9 レシオにする 写真解像度の限度 Video resolution limit diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index a3a2173c..e347bbe5 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -19,7 +19,6 @@ Настройки темная тема Store media in the default DCIM folder - Перефокусировка перед захватом Принудительное соотношение сторон 16:9 Лимит разрешения фото Video resolution limit diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index cc3da046..c4a79293 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -19,7 +19,6 @@ Inställningar Mörkt tema Store media in the default DCIM folder - Fokusera om innan bildtagning Tvinga 16:9-förhållande Bildupplösningsgräns Video resolution limit diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bc0114e2..be4d791b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,7 +19,6 @@ Settings Dark theme Store media in the default DCIM folder - Refocus before capture Use 16:9 ratio Photo resolution limit Video resolution limit