OSDN Git Service

リモートシャッターを無効にするスイッチを入れた。
authorMRSa <mrsa@myad.jp>
Sat, 13 Jun 2020 07:35:25 +0000 (16:35 +0900)
committerMRSa <mrsa@myad.jp>
Sat, 13 Jun 2020 07:35:25 +0000 (16:35 +0900)
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewClickTouchListener.java
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/IPreferencePropertyAccessor.java
app/src/main/java/net/osdn/gokigen/a01d/preference/summary/PreferenceFragmentSummary.java
app/src/main/res/values-ja/strings.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preferences_summary.xml

index 33e1afc..4fb5196 100644 (file)
@@ -263,13 +263,16 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
         Log.v(TAG, "pushedShutterButton()");
         try
         {
-            // カメラで撮影する
-            captureControl.doCapture(0);
-
             SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
+
+            if (!preferences.getBoolean(IPreferencePropertyAccessor.CAPTURE_ONLY_LIVE_VIEW, false))
+            {
+                // カメラで撮影する
+                captureControl.doCapture(0);
+            }
             if (preferences.getBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true))
             {
-                // ã\83©ã\82¤ã\83\96ã\83\93ã\83¥ã\83¼ç\94»å\83\8fã\82\82保管する
+                // ã\83©ã\82¤ã\83\96ã\83\93ã\83¥ã\83¼ç\94»å\83\8fã\82\92保管する
                 statusNotify.takePicture();
             }
         }
index 9b61e11..1fa828d 100644 (file)
@@ -128,7 +128,8 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
         View view = inflater.inflate(R.layout.fragment_live_view, container, false);
         myView = view;
         imageViewCreated = true;
-        try {
+        try
+        {
             imageView = view.findViewById(R.id.cameraLiveImageView);
             if (interfaceInjector != null) {
                 interfaceInjector.injectDisplay(imageView, imageView, this);
@@ -149,14 +150,35 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             view.setOnKeyListener(onClickTouchListener);
             view.setFocusableInTouchMode(true);
 
+            boolean captureLv = true;
+            boolean captureRemote = false;
+            Activity activity = this.getActivity();
+            if (activity != null)
+            {
+                SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
+                captureLv = preferences.getBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
+                captureRemote = preferences.getBoolean(IPreferencePropertyAccessor.CAPTURE_ONLY_LIVE_VIEW, false);
+            }
+
+            ImageButton shutterButton = view.findViewById(R.id.shutter_button);
+            if ((!captureLv)&&(captureRemote))
+            {
+                // シャッターボタンを消す
+                shutterButton.setVisibility(View.INVISIBLE);
+            }
+            else
+            {
+                // シャッターボタンのクリックイベントを拾うよう設定
+                shutterButton.setOnClickListener(onClickTouchListener);
+            }
             view.findViewById(R.id.show_preference_button).setOnClickListener(onClickTouchListener);
             view.findViewById(R.id.camera_property_settings_button).setOnClickListener(onClickTouchListener);
-            view.findViewById(R.id.shutter_button).setOnClickListener(onClickTouchListener);
             view.findViewById(R.id.btn_zoomin).setOnClickListener(onClickTouchListener);
             view.findViewById(R.id.btn_zoomout).setOnClickListener(onClickTouchListener);
 
             focusIndicator = view.findViewById(R.id.focus_indicator);
-            if (focusIndicator != null) {
+            if (focusIndicator != null)
+            {
                 focusIndicator.setOnClickListener(onClickTouchListener);
             }
             manualFocus = view.findViewById(R.id.focusing_button);
@@ -164,11 +186,13 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
 
             ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
 
-            if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC) {
+            if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
+            {
                 view.findViewById(R.id.show_favorite_settings_button).setOnClickListener(onClickTouchListener);
 
                 // OPCのときには、フォーカスインジケータのマークを消す。
-                if (focusIndicator != null) {
+                if (focusIndicator != null)
+                {
                     focusIndicator.setVisibility(View.INVISIBLE);
                 }
             } else {
index 423c200..e0a5367 100644 (file)
@@ -39,6 +39,8 @@ public interface IPreferencePropertyAccessor
     String MAGNIFYING_LIVE_VIEW_SCALE_DEFAULT_VALUE = "10.0";
 
     String CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW = "capture_both_camera_and_live_view";
+    String CAPTURE_ONLY_LIVE_VIEW = "capture_only_live_view";
+
 
     String OLYCAMERA_BLUETOOTH_SETTINGS = "olympus_air_bt";
 
index e1f696d..48e731f 100644 (file)
@@ -137,6 +137,10 @@ public class PreferenceFragmentSummary extends PreferenceFragmentCompat implemen
             {
                 editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
             }
+            if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_ONLY_LIVE_VIEW))
+            {
+                editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_ONLY_LIVE_VIEW, false);
+            }
             if (!items.containsKey(IPreferencePropertyAccessor.CACHE_LIVEVIEW_PICTURES))
             {
                 editor.putBoolean(IPreferencePropertyAccessor.CACHE_LIVEVIEW_PICTURES, false);
@@ -176,8 +180,13 @@ public class PreferenceFragmentSummary extends PreferenceFragmentCompat implemen
                     Log.v(TAG, " " + key + " , " + value);
                     break;
 
+                case IPreferencePropertyAccessor.CAPTURE_ONLY_LIVE_VIEW:
+                    value = preferences.getBoolean(key, false);
+                    Log.v(TAG, "  " + key + "  , " + value);
+                    break;
+
                 case IPreferencePropertyAccessor.CACHE_LIVEVIEW_PICTURES:
-                    value = preferences.getBoolean(key, true);
+                    value = preferences.getBoolean(key, false);
                     Log.v(TAG, " " + key + "  , " + value);
                     break;
 
@@ -399,6 +408,7 @@ public class PreferenceFragmentSummary extends PreferenceFragmentCompat implemen
                         // Preferenceの画面に反映させる
                         setBooleanPreference(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, defaultValue);
                         setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, defaultValue);
+                        setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_ONLY_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_ONLY_LIVE_VIEW, false);
                         setBooleanPreference(IPreferencePropertyAccessor.CACHE_LIVEVIEW_PICTURES, IPreferencePropertyAccessor.CACHE_LIVEVIEW_PICTURES, false);
                     }
                     catch (Exception e)
index 2f25026..e29ca91 100644 (file)
@@ -21,7 +21,8 @@
     <string name="pref_camera_sound_volume">シャッター音</string>
     <string name="pref_take_raw">RAW撮影</string>
 
-    <string name="pref_capture_both_camera_and_live_view">ライブビュー画像も同時に撮影</string>
+    <string name="pref_capture_both_camera_and_live_view">ライブビュー画像を撮影する</string>
+    <string name="pref_summary_capture_both_live_view">シャッターボタンを押すとライブビュー画像を保存します。</string>
 
     <string name="pref_cat_application_control">アプリ制御</string>
     <string name="pref_exit_power_off">アプリ終了(とカメラOFF)</string>
     <string name="pref_number_of_cache_pictures">ライブビュー画像の遅延最大数</string>
     <string name="pref_summary_number_of_cache_pictures">ライブビューを遅らせる画像の最大枚数を指定します。(初期値:500、再起動後に有効)</string>
 
+    <string name="pref_capture_only_live_view">カメラのシャッターを使用しない</string>
+    <string name="pref_summary_capture_only_live_view">チェックを入れると、シャッターを押してもリモート(カメラ)側で撮影を行いません。</string>
+
 </resources>
index 393f5a0..eb2f32a 100644 (file)
@@ -22,7 +22,8 @@
     <string name="pref_camera_sound_volume">Shutter Sound</string>
     <string name="pref_take_raw">Take Raw</string>
 
-    <string name="pref_capture_both_camera_and_live_view">Capture both camera and Live View</string>
+    <string name="pref_capture_both_camera_and_live_view">Capture LiveView Image</string>
+    <string name="pref_summary_capture_both_live_view">Captutes a liveview image.</string>
 
     <string name="pref_cat_application_control">App. Control</string>
     <string name="pref_exit_power_off">Exit Application(and Camera OFF)</string>
     <string name="pref_number_of_cache_pictures">Max number of cache pictures</string>
     <string name="pref_summary_number_of_cache_pictures">Set number of cache pictures. (Default:500, enables after restart.)</string>
 
+    <string name="pref_capture_only_live_view">DO NOT USE REMOTE SHUTTER</string>
+    <string name="pref_summary_capture_only_live_view"> </string>
 </resources>
index 3962fe9..4fbbef5 100644 (file)
 
         <CheckBoxPreference
             android:key="capture_both_camera_and_live_view"
-            android:title="@string/pref_capture_both_camera_and_live_view" />
+            android:title="@string/pref_capture_both_camera_and_live_view"
+            android:summary="@string/pref_summary_capture_both_live_view"/>
+
+        <CheckBoxPreference
+            android:key="capture_only_live_view"
+            android:title="@string/pref_capture_only_live_view"
+            android:summary="@string/pref_summary_capture_only_live_view" />
 
         <CheckBoxPreference
             android:key="cache_liveview_pictures"