OSDN Git Service

設定画面を表示するようにした。
authorMRSa <mrsa@myad.jp>
Sun, 5 Aug 2018 02:15:24 +0000 (11:15 +0900)
committerMRSa <mrsa@myad.jp>
Sun, 5 Aug 2018 02:15:24 +0000 (11:15 +0900)
app/src/main/AndroidManifest.xml
app/src/main/java/net/osdn/gokigen/gr2control/liveview/LiveViewClickTouchListener.java
app/src/main/java/net/osdn/gokigen/gr2control/liveview/LiveViewFragment.java
app/src/main/java/net/osdn/gokigen/gr2control/preference/IPreferencePropertyAccessor.java
app/src/main/java/net/osdn/gokigen/gr2control/preference/ricohgr2/RicohGr2PreferenceFragment.java
app/src/main/res/drawable/ic_raw_black_1x.png [new file with mode: 0644]
app/src/main/res/drawable/ic_settings_black_24dp.xml [new file with mode: 0644]
app/src/main/res/layout-land/fragment_live_view.xml
app/src/main/res/values-ja/styles.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preferences_ricoh_gr2.xml

index b59c59a..7e3de3f 100644 (file)
         <activity android:name=".Gr2ControlMain">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
         <meta-data android:name="android.max_aspect" android:value="ratio_float"/>
     </application>
-
 </manifest>
index 22bb391..3e6a687 100644 (file)
@@ -140,6 +140,12 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
                     confirmExitApplication();
                     break;
 
+                case R.id.show_preference_button:
+                    // カメラの設定
+                    changeScene.changeSceneToConfiguration();
+                    break;
+
+
                     /*
                 case R.id.show_hide_grid_button:
                     // グリッドの ON/OFF
@@ -147,11 +153,6 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
                     statusViewDrawer.updateGridIcon();
                     break;
 
-                case R.id.show_preference_button:
-                    // カメラの設定
-                    changeScene.changeSceneToConfiguration();
-                    break;
-
                 case R.id.camera_property_settings_button:
                     // カメラのプロパティ設定
                     changeScene.changeSceneToCameraPropertyList();
index ac40051..9a6893a 100644 (file)
@@ -7,6 +7,8 @@ import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.v4.app.Fragment;
 import android.support.v4.content.res.ResourcesCompat;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
 import android.support.v7.preference.PreferenceManager;
 import android.util.Log;
 import android.view.LayoutInflater;
@@ -154,6 +156,7 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             setOnClickListener(view, R.id.focusUnlockImageView);
             setOnClickListener(view, R.id.show_images_button);
             setOnClickListener(view, R.id.camera_power_off_button);
+            setOnClickListener(view, R.id.show_preference_button);
 
             /*
             view.findViewById(R.id.show_preference_button).setOnClickListener(onClickTouchListener);
@@ -463,6 +466,17 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
     {
         super.onResume();
         Log.v(TAG, "onResume() Start");
+
+        AppCompatActivity activity = (AppCompatActivity)getActivity();
+        if (activity != null)
+        {
+            ActionBar bar = activity.getSupportActionBar();
+            if (bar != null)
+            {
+                bar.hide();   // ActionBarの表示を消す
+            }
+        }
+
 /*
         // 撮影モードかどうかを確認して、撮影モードではなかったら撮影モードに切り替える
         if ((changeRunModeExecutor != null)&&(!changeRunModeExecutor.isRecordingMode()))
@@ -562,7 +576,6 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
     public void startLiveView()
     {
         ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
-
         if (liveViewControl == null)
         {
             if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
index 8b4e1ec..7fdaeab 100644 (file)
@@ -18,6 +18,8 @@ public interface IPreferencePropertyAccessor
     String SOUND_VOLUME_LEVEL = "sound_volume_level";
     String SOUND_VOLUME_LEVEL_DEFAULT_VALUE = "OFF";
 
+    String USE_PLAYBACK_MENU = "use_playback_menu";
+
     String RAW = "raw";
 
     String LIVE_VIEW_QUALITY = "live_view_quality";
@@ -41,7 +43,7 @@ public interface IPreferencePropertyAccessor
     String OLYCAMERA_BLUETOOTH_SETTINGS = "olympus_air_bt";
 
     String CONNECTION_METHOD = "connection_method";
-    String CONNECTION_METHOD_DEFAULT_VALUE = "OPC";
+    String CONNECTION_METHOD_DEFAULT_VALUE = "RICOH_GR2";
 
     String GR2_DISPLAY_MODE = "gr2_display_mode";
     String GR2_DISPLAY_MODE_DEFAULT_VALUE = "0";
index 974a8e5..be93792 100644 (file)
@@ -75,7 +75,6 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
     {
         super.onAttach(activity);
         Log.v(TAG, "onAttach()");
-
         try
         {
             // Preference をつかまえる
@@ -109,6 +108,9 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
             if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW)) {
                 editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
             }
+            if (!items.containsKey(IPreferencePropertyAccessor.USE_PLAYBACK_MENU)) {
+                editor.putBoolean(IPreferencePropertyAccessor.USE_PLAYBACK_MENU, false);
+            }
             if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
                 editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
             }
@@ -149,6 +151,11 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
                     Log.v(TAG, " " + key + " , " + value);
                     break;
 
+                case IPreferencePropertyAccessor.USE_PLAYBACK_MENU:
+                    value = preferences.getBoolean(key, false);
+                    Log.v(TAG, " " + key + " , " + value);
+                    break;
+
                 case IPreferencePropertyAccessor.GR2_LCD_SLEEP:
                     value = preferences.getBoolean(key, false);
                     Log.v(TAG, " " + key + " , " + value);
@@ -213,7 +220,6 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
     {
         super.onResume();
         Log.v(TAG, "onResume() Start");
-
         try
         {
             synchronizedProperty();
@@ -224,7 +230,6 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
         }
 
         Log.v(TAG, "onResume() End");
-
     }
 
     /**
@@ -236,7 +241,6 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
     {
         super.onPause();
         Log.v(TAG, "onPause() Start");
-
         try
         {
             // Preference変更のリスナを解除
@@ -317,8 +321,8 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
                         // 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.USE_PLAYBACK_MENU, IPreferencePropertyAccessor.USE_PLAYBACK_MENU, defaultValue);
                         setBooleanPreference(IPreferencePropertyAccessor.GR2_LCD_SLEEP, IPreferencePropertyAccessor.GR2_LCD_SLEEP, defaultValue);
-
                     }
                     catch (Exception e)
                     {
diff --git a/app/src/main/res/drawable/ic_raw_black_1x.png b/app/src/main/res/drawable/ic_raw_black_1x.png
new file mode 100644 (file)
index 0000000..980f2b7
Binary files /dev/null and b/app/src/main/res/drawable/ic_raw_black_1x.png differ
diff --git a/app/src/main/res/drawable/ic_settings_black_24dp.xml b/app/src/main/res/drawable/ic_settings_black_24dp.xml
new file mode 100644 (file)
index 0000000..ace746c
--- /dev/null
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
+</vector>
index 797ddc4..25cc52f 100644 (file)
                 android:textStyle="normal"
                 android:textSize="6pt" />
 
+            <ImageView
+                android:id="@+id/show_preference_button"
+                android:layout_width="match_parent"
+                android:layout_height="24dp"
+                android:layout_alignParentTop="true"
+                android:layout_alignParentLeft="true"
+                android:layout_alignParentStart="true"
+                android:layout_marginTop="46dp"
+                android:clickable="true"
+                android:focusable="true"
+                android:gravity="center"
+                android:scaleType="fitCenter"
+                android:src="@drawable/ic_settings_black_24dp"
+                android:visibility="visible" />
 
             <ImageButton
                 android:id="@+id/shutter_button"
index 5885930..cda8251 100644 (file)
@@ -6,6 +6,6 @@
         <item name="colorPrimary">@color/colorPrimary</item>
         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
         <item name="colorAccent">@color/colorAccent</item>
+        <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
     </style>
-
 </resources>
index 5274a0f..df66f24 100644 (file)
     <string name="pref_auto_connect_camera">Auto Connect To Camera</string>
     <string name="pref_summary_auto_connect_camera">Normally to keep ON.</string>
 
+    <string name="pref_cat_others">Others</string>
+    <string name="pref_call_share_after_save">Share after Save</string>
+    <string name="pref_use_playback_menu">Use playback screen menu</string>
+
+
     <string name="pref_cat_gokigen">GOKIGEN</string>
-    <string name="pref_instruction_manual">A01d Instructions</string>
+    <string name="pref_instruction_manual">Instructions</string>
     <string name="pref_privacy_policy">Privacy Policy</string>
 
     <string name="only_opc_feature">This feature is only available for a OPC Camera.</string>
index 5ed4cbe..a35e379 100644 (file)
     </PreferenceCategory>
 
     <PreferenceCategory
+        android:title="@string/pref_cat_others">
+<!--
+                <CheckBoxPreference
+                    android:key="share_after_save"
+                    android:title="@string/pref_call_share_after_save" />
+
+                <CheckBoxPreference
+                    android:key="use_custom_splash"
+                    android:title="@string/pref_custom_splash" />
+
+                <PreferenceScreen
+                    android:key="select_splash_image"
+                    android:title="@string/pref_select_splash_image" />
+-->
+        <CheckBoxPreference
+            android:key="use_playback_menu"
+            android:title="@string/pref_use_playback_menu"
+            />
+    </PreferenceCategory>
+
+    <PreferenceCategory
         android:title="@string/pref_cat_gokigen">
 
         <Preference
             android:key="instruction_link"
             android:title="@string/pref_instruction_manual"
-            android:summary="https://osdn.net/projects/gokigen/wiki/A01d"
+            android:summary="https://osdn.net/projects/gokigen/wiki/GR2Control"
             android:selectable="true">
             <intent android:action="android.intent.action.VIEW"
-                android:data="https://osdn.net/projects/gokigen/wiki/A01d" />
+                android:data="https://osdn.net/projects/gokigen/wiki/GR2Control" />
         </Preference>
 
         <Preference