• R/O
  • HTTP
  • SSH
  • HTTPS

Gr2Control: Commit

Ricoh GR2 Control App for Android.


Commit MetaInfo

Revision78871207d0817480796d556e61e4b953292ec8b8 (tree)
Zeit2020-05-05 20:54:15
AutorMRSa <mrsa@myad...>
CommiterMRSa

Log Message

Preferenceを階層化して整理。

Ändern Zusammenfassung

Diff

--- a/app/src/main/java/net/osdn/gokigen/gr2control/liveview/LiveViewClickTouchListener.java
+++ b/app/src/main/java/net/osdn/gokigen/gr2control/liveview/LiveViewClickTouchListener.java
@@ -132,7 +132,7 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
132132
133133 case R.id.show_preference_button:
134134 // カメラの設定
135- changeScene.changeSceneToConfiguration();
135+ changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.UNKNOWN);
136136 isVibrate = true;
137137 break;
138138
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/gr2control/preference/Gr2ControlPreferenceFragment.java
@@ -0,0 +1,437 @@
1+package net.osdn.gokigen.gr2control.preference;
2+
3+import android.content.Context;
4+import android.content.Intent;
5+import android.content.SharedPreferences;
6+import android.os.Bundle;
7+import android.provider.Settings;
8+import android.util.Log;
9+
10+import net.osdn.gokigen.gr2control.R;
11+import net.osdn.gokigen.gr2control.camera.ICameraConnection;
12+import net.osdn.gokigen.gr2control.logcat.LogCatViewer;
13+import net.osdn.gokigen.gr2control.scene.IChangeScene;
14+
15+import java.util.Map;
16+
17+import androidx.annotation.NonNull;
18+import androidx.appcompat.app.AppCompatActivity;
19+import androidx.fragment.app.FragmentActivity;
20+import androidx.preference.CheckBoxPreference;
21+import androidx.preference.ListPreference;
22+import androidx.preference.Preference;
23+import androidx.preference.PreferenceFragmentCompat;
24+import androidx.preference.PreferenceManager;
25+
26+public class Gr2ControlPreferenceFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener, Preference.OnPreferenceClickListener
27+{
28+ private final String TAG = toString();
29+ private IChangeScene changeScene = null;
30+ private AppCompatActivity context = null;
31+ private SharedPreferences preferences = null;
32+ private LogCatViewer logCatViewer = null;
33+
34+ /**
35+ *
36+ *
37+ */
38+ public static Gr2ControlPreferenceFragment newInstance(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
39+ {
40+ Gr2ControlPreferenceFragment instance = new Gr2ControlPreferenceFragment();
41+ instance.prepare(context, changeScene);
42+
43+ // パラメータはBundleにまとめておく
44+ Bundle arguments = new Bundle();
45+ //arguments.putString("title", title);
46+ //arguments.putString("message", message);
47+ instance.setArguments(arguments);
48+
49+ return (instance);
50+ }
51+
52+ /**
53+ *
54+ *
55+ */
56+ private void prepare(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
57+ {
58+ try
59+ {
60+ logCatViewer = new LogCatViewer(changeScene);
61+ logCatViewer.prepare();
62+ this.changeScene = changeScene;
63+ this.context = context;
64+ }
65+ catch (Exception e)
66+ {
67+ e.printStackTrace();
68+ }
69+ }
70+
71+ /**
72+ *
73+ *
74+ */
75+ @Override
76+ public void onAttach(@NonNull Context activity)
77+ {
78+ super.onAttach(activity);
79+ Log.v(TAG, " onAttach()");
80+ try
81+ {
82+ // Preference をつかまえる
83+ preferences = PreferenceManager.getDefaultSharedPreferences(activity);
84+
85+ // Preference を初期設定する
86+ initializePreferences();
87+
88+ preferences.registerOnSharedPreferenceChangeListener(this);
89+ }
90+ catch (Exception e)
91+ {
92+ e.printStackTrace();
93+ }
94+ }
95+
96+ /**
97+ * Preferenceの初期化...
98+ *
99+ */
100+ private void initializePreferences()
101+ {
102+ try
103+ {
104+ Map<String, ?> items = preferences.getAll();
105+ SharedPreferences.Editor editor = preferences.edit();
106+
107+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
108+ {
109+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
110+ }
111+ if (!items.containsKey(IPreferencePropertyAccessor.LIVE_VIEW_QUALITY))
112+ {
113+ editor.putString(IPreferencePropertyAccessor.LIVE_VIEW_QUALITY, IPreferencePropertyAccessor.LIVE_VIEW_QUALITY_DEFAULT_VALUE);
114+ }
115+ if (!items.containsKey(IPreferencePropertyAccessor.SOUND_VOLUME_LEVEL))
116+ {
117+ editor.putString(IPreferencePropertyAccessor.SOUND_VOLUME_LEVEL, IPreferencePropertyAccessor.SOUND_VOLUME_LEVEL_DEFAULT_VALUE);
118+ }
119+ if (!items.containsKey(IPreferencePropertyAccessor.RAW))
120+ {
121+ editor.putBoolean(IPreferencePropertyAccessor.RAW, true);
122+ }
123+ if (!items.containsKey(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA))
124+ {
125+ editor.putBoolean(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
126+ }
127+ if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW))
128+ {
129+ editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, false);
130+ }
131+ if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD))
132+ {
133+ editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
134+ }
135+ if (!items.containsKey(IPreferencePropertyAccessor.SHARE_AFTER_SAVE)) {
136+ editor.putBoolean(IPreferencePropertyAccessor.SHARE_AFTER_SAVE, false);
137+ }
138+ if (!items.containsKey(IPreferencePropertyAccessor.USE_PLAYBACK_MENU)) {
139+ editor.putBoolean(IPreferencePropertyAccessor.USE_PLAYBACK_MENU, true);
140+ }
141+ if (!items.containsKey(IPreferencePropertyAccessor.GR2_DISPLAY_CAMERA_VIEW)) {
142+ editor.putBoolean(IPreferencePropertyAccessor.GR2_DISPLAY_CAMERA_VIEW, true);
143+ }
144+ if (!items.containsKey(IPreferencePropertyAccessor.GR2_LCD_SLEEP)) {
145+ editor.putBoolean(IPreferencePropertyAccessor.GR2_LCD_SLEEP, false);
146+ }
147+ if (!items.containsKey(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND)) {
148+ editor.putBoolean(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND, true);
149+ }
150+ if (!items.containsKey(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF)) {
151+ editor.putBoolean(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF, false);
152+ }
153+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_DISPLAY_CAMERA_VIEW)) {
154+ editor.putBoolean(IPreferencePropertyAccessor.FUJI_X_DISPLAY_CAMERA_VIEW, false);
155+ }
156+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_FOCUS_XY)) {
157+ editor.putString(IPreferencePropertyAccessor.FUJI_X_FOCUS_XY, IPreferencePropertyAccessor.FUJI_X_FOCUS_XY_DEFAULT_VALUE);
158+ }
159+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_LIVEVIEW_WAIT)) {
160+ editor.putString(IPreferencePropertyAccessor.FUJI_X_LIVEVIEW_WAIT, IPreferencePropertyAccessor.FUJI_X_LIVEVIEW_WAIT_DEFAULT_VALUE);
161+ }
162+ if (!items.containsKey(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT)) {
163+ editor.putString(IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT, IPreferencePropertyAccessor.FUJI_X_COMMAND_POLLING_WAIT_DEFAULT_VALUE);
164+ }
165+ editor.apply();
166+ }
167+ catch (Exception e)
168+ {
169+ e.printStackTrace();
170+ }
171+ }
172+
173+ /**
174+ *
175+ *
176+ */
177+ @Override
178+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
179+ {
180+ Log.v(TAG, " onSharedPreferenceChanged() : " + key);
181+ boolean value;
182+ if (key != null)
183+ {
184+ switch (key)
185+ {
186+ case IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA:
187+ value = preferences.getBoolean(key, true);
188+ Log.v(TAG, " " + key + " , " + value);
189+ break;
190+
191+ case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
192+ value = preferences.getBoolean(key, false);
193+ Log.v(TAG, " BOTH LV : " + key + " , " + value);
194+ break;
195+
196+ case IPreferencePropertyAccessor.USE_PLAYBACK_MENU:
197+ value = preferences.getBoolean(key, true);
198+ Log.v(TAG, " PLAYBACK MENU : " + key + " , " + value);
199+ break;
200+
201+ case IPreferencePropertyAccessor.SHARE_AFTER_SAVE:
202+ value = preferences.getBoolean(key, false);
203+ Log.v(TAG, " SHARE : " + key + " , " + value);
204+ break;
205+
206+ default:
207+ String strValue = preferences.getString(key, "");
208+ setListPreference(key, key, strValue);
209+ break;
210+ }
211+ }
212+ }
213+
214+ /**
215+ *
216+ *
217+ */
218+ @Override
219+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
220+ {
221+ Log.v(TAG, " onCreatePreferences()");
222+ try
223+ {
224+ //super.onCreate(savedInstanceState);
225+ addPreferencesFromResource(R.xml.preferences_summary);
226+
227+ ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
228+ if (connectionMethod != null)
229+ {
230+ connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
231+ @Override
232+ public boolean onPreferenceChange(Preference preference, Object newValue) {
233+ preference.setSummary(newValue + " ");
234+ return (true);
235+ }
236+ });
237+ connectionMethod.setSummary(connectionMethod.getValue() + " ");
238+ }
239+
240+ Preference opcPreference = findPreference("opc_settings");
241+ if (opcPreference != null)
242+ {
243+ opcPreference.setOnPreferenceClickListener(this);
244+ }
245+ Preference gr2Preference = findPreference("ricoh_settings");
246+ if (gr2Preference != null)
247+ {
248+ gr2Preference.setOnPreferenceClickListener(this);
249+ }
250+ Preference fujiXPreference = findPreference("fuji_x_settings");
251+ if (fujiXPreference != null)
252+ {
253+ fujiXPreference.setOnPreferenceClickListener(this);
254+ }
255+
256+ Preference debug = findPreference("debug_info");
257+ if (debug != null)
258+ {
259+ debug.setOnPreferenceClickListener(logCatViewer);
260+ }
261+
262+ Preference wifi = findPreference("wifi_settings");
263+ if (wifi != null)
264+ {
265+ wifi.setOnPreferenceClickListener(this);
266+ }
267+ }
268+ catch (Exception e)
269+ {
270+ e.printStackTrace();
271+ }
272+ }
273+
274+ /**
275+ *
276+ *
277+ */
278+ @Override
279+ public void onResume()
280+ {
281+ super.onResume();
282+ Log.v(TAG, " onResume() Start");
283+ try
284+ {
285+ synchronizedProperty();
286+ }
287+ catch (Exception e)
288+ {
289+ e.printStackTrace();
290+ }
291+
292+ Log.v(TAG, " onResume() End");
293+ }
294+
295+ /**
296+ *
297+ *
298+ */
299+ @Override
300+ public void onPause()
301+ {
302+ super.onPause();
303+ Log.v(TAG, " onPause() Start");
304+ try
305+ {
306+ // Preference変更のリスナを解除
307+ preferences.unregisterOnSharedPreferenceChangeListener(this);
308+ }
309+ catch (Exception e)
310+ {
311+ e.printStackTrace();
312+ }
313+
314+ Log.v(TAG, " onPause() End");
315+ }
316+
317+ /**
318+ * ListPreference の表示データを設定
319+ *
320+ * @param pref_key Preference(表示)のキー
321+ * @param key Preference(データ)のキー
322+ * @param defaultValue Preferenceのデフォルト値
323+ */
324+ private void setListPreference(String pref_key, String key, String defaultValue)
325+ {
326+ try
327+ {
328+ ListPreference pref;
329+ pref = findPreference(pref_key);
330+ String value = preferences.getString(key, defaultValue);
331+ if (pref != null)
332+ {
333+ pref.setValue(value);
334+ pref.setSummary(value);
335+ }
336+ }
337+ catch (Exception e)
338+ {
339+ e.printStackTrace();
340+ }
341+ }
342+
343+ /**
344+ * BooleanPreference の表示データを設定
345+ *
346+ * @param pref_key Preference(表示)のキー
347+ * @param key Preference(データ)のキー
348+ * @param defaultValue Preferenceのデフォルト値
349+ */
350+ private void setBooleanPreference(String pref_key, String key, boolean defaultValue)
351+ {
352+ try
353+ {
354+ CheckBoxPreference pref = findPreference(pref_key);
355+ if (pref != null)
356+ {
357+ boolean value = preferences.getBoolean(key, defaultValue);
358+ pref.setChecked(value);
359+ }
360+ }
361+ catch (Exception e)
362+ {
363+ e.printStackTrace();
364+ }
365+ }
366+
367+ /**
368+ *
369+ *
370+ */
371+ private void synchronizedProperty()
372+ {
373+ final FragmentActivity activity = getActivity();
374+ if (activity != null)
375+ {
376+ activity.runOnUiThread(new Runnable() {
377+ @Override
378+ public void run() {
379+ try
380+ {
381+ // Preferenceの画面に反映させる
382+ setBooleanPreference(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
383+ setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, false);
384+ setBooleanPreference(IPreferencePropertyAccessor.USE_PLAYBACK_MENU, IPreferencePropertyAccessor.USE_PLAYBACK_MENU, true);
385+ setBooleanPreference(IPreferencePropertyAccessor.SHARE_AFTER_SAVE, IPreferencePropertyAccessor.SHARE_AFTER_SAVE, false);
386+ }
387+ catch (Exception e)
388+ {
389+ e.printStackTrace();
390+ }
391+ }
392+ });
393+ }
394+ }
395+
396+
397+ @Override
398+ public boolean onPreferenceClick(Preference preference)
399+ {
400+ try
401+ {
402+ String preferenceKey = preference.getKey();
403+ Log.v(TAG, " onPreferenceClick() : " + preferenceKey);
404+ if (preferenceKey.contains("wifi_settings"))
405+ {
406+ // Wifi 設定画面を表示する
407+ Log.v(TAG, " onPreferenceClick : " + preferenceKey);
408+ if (context != null)
409+ {
410+ context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
411+ }
412+ }
413+ else if (preferenceKey.contains("ricoh_settings"))
414+ {
415+ changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.RICOH_GR2);
416+ }
417+ else if (preferenceKey.contains("fuji_x_settings"))
418+ {
419+ changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.FUJI_X);
420+ }
421+ else if (preferenceKey.contains("opc_settings"))
422+ {
423+ changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.OPC);
424+ }
425+ else
426+ {
427+ return (false);
428+ }
429+ return (true);
430+ }
431+ catch (Exception e)
432+ {
433+ e.printStackTrace();
434+ }
435+ return (false);
436+ }
437+}
--- a/app/src/main/java/net/osdn/gokigen/gr2control/scene/CameraSceneUpdater.java
+++ b/app/src/main/java/net/osdn/gokigen/gr2control/scene/CameraSceneUpdater.java
@@ -9,6 +9,7 @@ import net.osdn.gokigen.gr2control.camera.IInterfaceProvider;
99 import net.osdn.gokigen.gr2control.liveview.IStatusViewDrawer;
1010 import net.osdn.gokigen.gr2control.logcat.LogCatFragment;
1111 import net.osdn.gokigen.gr2control.playback.ImageGridViewFragment;
12+import net.osdn.gokigen.gr2control.preference.Gr2ControlPreferenceFragment;
1213 import net.osdn.gokigen.gr2control.preference.fuji_x.FujiXPreferenceFragment;
1314 import net.osdn.gokigen.gr2control.preference.olympus.PreferenceFragment;
1415 import net.osdn.gokigen.gr2control.preference.ricohgr2.RicohGr2PreferenceFragment;
@@ -30,6 +31,10 @@ public class CameraSceneUpdater implements ICameraStatusReceiver, IChangeScene
3031 private IStatusViewDrawer statusViewDrawer;
3132
3233 private PreferenceFragmentCompat preferenceFragment = null;
34+ private PreferenceFragmentCompat preferenceFragmentOpc = null;
35+ private PreferenceFragmentCompat preferenceFragmentRicoh = null;
36+ private PreferenceFragmentCompat preferenceFragmentFujiX = null;
37+
3338 private LogCatFragment logCatFragment = null;
3439 private ImageGridViewFragment imageGridViewFragment = null;
3540
@@ -194,37 +199,41 @@ public class CameraSceneUpdater implements ICameraStatusReceiver, IChangeScene
194199
195200 // IChangeScene
196201 @Override
197- public void changeSceneToConfiguration()
202+ public void changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod connectionMethod)
198203 {
199204 try
200205 {
201- if (preferenceFragment == null)
206+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2)
202207 {
203- try
204- {
205- //preferenceFragment = RicohGr2PreferenceFragment.newInstance(activity, this);
206- ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
207- if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2) {
208- preferenceFragment = RicohGr2PreferenceFragment.newInstance(activity, this);
209- //} else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY) {
210- // preferenceFragment = SonyPreferenceFragment.newInstance(this, this);
211- }
212- else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
213- {
214- preferenceFragment = FujiXPreferenceFragment.newInstance(activity, this);
215- }
216- else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
217- {
218- preferenceFragment = PreferenceFragment.newInstance(activity, interfaceProvider, this);
219- }
220- }
221- catch (Exception e)
222- {
223- e.printStackTrace();
224- //preferenceFragment = SonyPreferenceFragment.newInstance(this, this);
225- }
208+ changeSceneToRicohConfiguration();
209+ }
210+ else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
211+ {
212+ changeSceneToFujiXConfiguration();
213+ }
214+ else if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
215+ {
216+ changeSceneToOpcConfiguration();
226217 }
218+ else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.UNKNOWN)
219+ {
220+ changeSceneToSummaryConfiguration();
221+ }
222+ }
223+ catch (Exception e)
224+ {
225+ e.printStackTrace();
226+ }
227+ }
227228
229+ private void changeSceneToSummaryConfiguration()
230+ {
231+ try
232+ {
233+ if (preferenceFragment == null)
234+ {
235+ preferenceFragment = Gr2ControlPreferenceFragment.newInstance(activity, this);
236+ }
228237 FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
229238 transaction.replace(R.id.fragment1, preferenceFragment);
230239 // backstackに追加
@@ -237,6 +246,66 @@ public class CameraSceneUpdater implements ICameraStatusReceiver, IChangeScene
237246 }
238247 }
239248
249+ private void changeSceneToOpcConfiguration()
250+ {
251+ try
252+ {
253+ if (preferenceFragmentOpc == null)
254+ {
255+ preferenceFragmentOpc = PreferenceFragment.newInstance(activity, interfaceProvider, this);
256+ }
257+ FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
258+ transaction.replace(R.id.fragment1, preferenceFragmentOpc);
259+ // backstackに追加
260+ transaction.addToBackStack(null);
261+ transaction.commit();
262+ }
263+ catch (Exception e)
264+ {
265+ e.printStackTrace();
266+ }
267+ }
268+
269+ private void changeSceneToRicohConfiguration()
270+ {
271+ try
272+ {
273+ if (preferenceFragmentRicoh == null)
274+ {
275+ preferenceFragmentRicoh = RicohGr2PreferenceFragment.newInstance(activity, this);
276+ }
277+ FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
278+ transaction.replace(R.id.fragment1, preferenceFragmentRicoh);
279+ // backstackに追加
280+ transaction.addToBackStack(null);
281+ transaction.commit();
282+ }
283+ catch (Exception e)
284+ {
285+ e.printStackTrace();
286+ }
287+ }
288+
289+ private void changeSceneToFujiXConfiguration()
290+ {
291+ try
292+ {
293+ if (preferenceFragmentFujiX == null)
294+ {
295+ preferenceFragmentFujiX = FujiXPreferenceFragment.newInstance(activity, this);
296+ }
297+ FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
298+ transaction.replace(R.id.fragment1, preferenceFragmentFujiX);
299+ // backstackに追加
300+ transaction.addToBackStack(null);
301+ transaction.commit();
302+ }
303+ catch (Exception e)
304+ {
305+ e.printStackTrace();
306+ }
307+ }
308+
240309 // IChangeScene
241310 @Override
242311 public void changeCameraConnection()
--- a/app/src/main/java/net/osdn/gokigen/gr2control/scene/IChangeScene.java
+++ b/app/src/main/java/net/osdn/gokigen/gr2control/scene/IChangeScene.java
@@ -1,12 +1,14 @@
11 package net.osdn.gokigen.gr2control.scene;
22
3+import net.osdn.gokigen.gr2control.camera.ICameraConnection;
4+
35 /**
46 *
57 */
68 public interface IChangeScene
79 {
810 void changeSceneToCameraPropertyList();
9- void changeSceneToConfiguration();
11+ void changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod connectionMethod);
1012 void changeCameraConnection();
1113 void changeSceneToDebugInformation();
1214 void changeSceneToApiList();
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -136,7 +136,7 @@
136136 <string name="pref_fujix_focus_xy">フォーカス点数[X,Y] (default: 7,7)</string>
137137 <string name="pref_summary_fujix_focus_xy">接続するカメラに合わせてフォーカス点数を指定します</string>
138138 <string name="pref_fujix_liveview_wait">LV画像受信待ち間隔(default: 80)</string>
139- <string name="pref_summary_fujix_liveview_wait">ライブビュー画像受信間隔を指定します</string>
139+ <string name="pref_summary_fujix_liveview_wait">ライブビュー画像受信待ち間隔を指定します。(単位:ms)</string>
140140 <string name="pref_fujix_command_polling_wait">コマンド間隔(default: 500)</string>
141141 <string name="pref_summary_fujix_command_polling_wait">カメラ状態の確認間隔を調整します</string>
142142 <string name="pref_special_thanks">Special Thanks to</string>
@@ -191,4 +191,16 @@
191191 <string name="shutter_speed">Shutter</string>
192192 <string name="aperture">Aperture</string>
193193
194+ <string name="pref_ricoh_settings">RICOH GR/PENTAX用設定</string>
195+ <string name="pref_summary_ricoh_settings"> </string>
196+
197+ <string name="pref_fuji_x_settings">Fujifilm X用設定</string>
198+ <string name="pref_summary_fuji_x_settings"> </string>
199+
200+ <string name="pref_opc_settings">Olympus Air用設定</string>
201+ <string name="pref_summary_opc_settings"> </string>
202+
203+ <string name="pref_fuji_x_exit_only">アプリ終了 (FUJI)</string>
204+ <string name="pref_opc_exit_power_off">アプリ終了 (OPC)</string>
205+ <string name="pref_ricoh_exit_power_off">アプリ終了 (RICOH)</string>
194206 </resources>
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -231,4 +231,17 @@
231231
232232 <string name="shutter_speed">Shutter</string>
233233 <string name="aperture">Aperture</string>
234+
235+ <string name="pref_ricoh_settings">RICOH GR/PENTAX Settings</string>
236+ <string name="pref_summary_ricoh_settings"> </string>
237+
238+ <string name="pref_fuji_x_settings">Fujifilm X Settings</string>
239+ <string name="pref_summary_fuji_x_settings"> </string>
240+
241+ <string name="pref_opc_settings">Olympus Air Settings</string>
242+ <string name="pref_summary_opc_settings"> </string>
243+
244+ <string name="pref_fuji_x_exit_only">Exit Application (FUJI)</string>
245+ <string name="pref_opc_exit_power_off">Exit Application (OPC)</string>
246+ <string name="pref_ricoh_exit_power_off">Exit Application (RICOH)</string>
234247 </resources>
--- a/app/src/main/res/xml/preferences_fuji_x.xml
+++ b/app/src/main/res/xml/preferences_fuji_x.xml
@@ -6,8 +6,8 @@
66 <PreferenceScreen
77 android:key="exit_application"
88 android:icon="@drawable/ic_power_settings_new_black_24dp"
9- android:title="@string/pref_exit_only" />
10-
9+ android:title="@string/pref_fuji_x_exit_only" />
10+<!--
1111 <ListPreference
1212 android:title="@string/pref_connection_method"
1313 android:entryValues="@array/connection_method_value"
@@ -19,16 +19,16 @@
1919 android:key="wifi_settings"
2020 android:title="@string/pref_wifi_settings"
2121 android:summary="@string/pref_summary_wifi_settings" />
22-
22+-->
2323 </PreferenceCategory>
2424
2525 <PreferenceCategory
2626 android:title="@string/pref_cat_camera">
27-
27+<!--
2828 <CheckBoxPreference
2929 android:key="capture_both_camera_and_live_view"
3030 android:title="@string/pref_capture_both_camera_and_live_view" />
31-
31+-->
3232 <CheckBoxPreference
3333 android:key="fujix_display_camera_view"
3434 android:title="@string/pref_fujix_display_camera_view"
@@ -53,7 +53,7 @@
5353 android:summary="@string/pref_summary_fujix_liveview_wait" />
5454
5555 </PreferenceCategory>
56-
56+<!--
5757 <PreferenceCategory
5858 android:title="@string/pref_cat_initialize">
5959
@@ -62,10 +62,11 @@
6262 android:title="@string/pref_auto_connect_camera"
6363 android:summary="@string/pref_summary_auto_connect_camera" />
6464 </PreferenceCategory>
65+-->
6566
6667 <PreferenceCategory
6768 android:title="@string/pref_cat_others">
68-
69+<!--
6970 <CheckBoxPreference
7071 android:key="share_after_save"
7172 android:title="@string/pref_call_share_after_save" />
@@ -74,6 +75,7 @@
7475 android:key="use_playback_menu"
7576 android:title="@string/pref_use_playback_menu"
7677 android:summary="@string/summary_use_playback_menu" />
78+-->
7779
7880 <Preference
7981 android:key="special_thanks"
@@ -83,9 +85,8 @@
8385 <intent android:action="android.intent.action.VIEW"
8486 android:data="https://github.com/hkr/fuji-cam-wifi-tool" />
8587 </Preference>
86-
8788 </PreferenceCategory>
88-
89+<!--
8990 <PreferenceCategory
9091 android:title="@string/pref_cat_gokigen">
9192
@@ -111,6 +112,6 @@
111112 android:key="debug_info"
112113 android:title="@string/pref_degug_info"
113114 android:summary="@string/pref_summary_debug_info" />
114-
115115 </PreferenceCategory>
116+-->
116117 </PreferenceScreen>
--- a/app/src/main/res/xml/preferences_opc.xml
+++ b/app/src/main/res/xml/preferences_opc.xml
@@ -6,8 +6,8 @@
66 <PreferenceScreen
77 android:key="exit_application"
88 android:icon="@drawable/ic_power_settings_new_black_24dp"
9- android:title="@string/pref_exit_power_off" />
10-
9+ android:title="@string/pref_opc_exit_power_off" />
10+<!--
1111 <ListPreference
1212 android:title="@string/pref_connection_method"
1313 android:entryValues="@array/connection_method_value"
@@ -19,7 +19,7 @@
1919 android:key="wifi_settings"
2020 android:title="@string/pref_wifi_settings"
2121 android:summary="@string/pref_summary_wifi_settings" />
22-
22+-->
2323 </PreferenceCategory>
2424
2525 <PreferenceCategory
@@ -35,11 +35,11 @@
3535 <CheckBoxPreference
3636 android:key="raw"
3737 android:title="@string/pref_take_raw" />
38-
38+<!--
3939 <CheckBoxPreference
4040 android:key="capture_both_camera_and_live_view"
4141 android:title="@string/pref_capture_both_camera_and_live_view" />
42-
42+-->
4343 </PreferenceCategory>
4444
4545 <PreferenceCategory
@@ -53,6 +53,7 @@
5353
5454 </PreferenceCategory>
5555
56+ <!--
5657 <PreferenceCategory
5758 android:title="@string/pref_cat_others">
5859
@@ -63,8 +64,8 @@
6364 <CheckBoxPreference
6465 android:key="use_playback_menu"
6566 android:title="@string/pref_use_playback_menu" />
66-
6767 </PreferenceCategory>
68+-->
6869
6970 <PreferenceCategory
7071 android:title="@string/pref_cat_info">
@@ -94,6 +95,7 @@
9495 android:selectable="false" />
9596 </PreferenceCategory>
9697
98+<!--
9799 <PreferenceCategory
98100 android:title="@string/pref_cat_initialize">
99101
@@ -101,7 +103,6 @@
101103 android:key="auto_connect_to_camera"
102104 android:title="@string/pref_auto_connect_camera"
103105 android:summary="@string/pref_summary_auto_connect_camera" />
104-
105106 </PreferenceCategory>
106107
107108 <PreferenceCategory
@@ -129,6 +130,6 @@
129130 android:key="debug_info"
130131 android:title="@string/pref_degug_info"
131132 android:summary="@string/pref_summary_debug_info" />
132-
133133 </PreferenceCategory>
134+-->
134135 </PreferenceScreen>
--- a/app/src/main/res/xml/preferences_ricoh_gr2.xml
+++ b/app/src/main/res/xml/preferences_ricoh_gr2.xml
@@ -6,8 +6,8 @@
66 <PreferenceScreen
77 android:key="exit_application"
88 android:icon="@drawable/ic_power_settings_new_black_24dp"
9- android:title="@string/pref_exit_power_off" />
10-
9+ android:title="@string/pref_ricoh_exit_power_off" />
10+<!--
1111 <ListPreference
1212 android:title="@string/pref_connection_method"
1313 android:entryValues="@array/connection_method_value"
@@ -19,17 +19,18 @@
1919 android:key="wifi_settings"
2020 android:title="@string/pref_wifi_settings"
2121 android:summary="@string/pref_summary_wifi_settings" />
22-
22+-->
2323 </PreferenceCategory>
2424
25+<!--
2526 <PreferenceCategory
2627 android:title="@string/pref_cat_camera">
2728
2829 <CheckBoxPreference
2930 android:key="capture_both_camera_and_live_view"
3031 android:title="@string/pref_capture_both_camera_and_live_view" />
31-
3232 </PreferenceCategory>
33+-->
3334
3435 <PreferenceCategory
3536 android:title="@string/pref_cat_initialize">
@@ -43,15 +44,17 @@
4344 android:key="gr2_lcd_sleep"
4445 android:title="@string/pref_gr2_lcd_sleep" />
4546
47+<!--
4648 <CheckBoxPreference
4749 android:key="auto_connect_to_camera"
4850 android:title="@string/pref_auto_connect_camera"
4951 android:summary="@string/pref_summary_auto_connect_camera" />
52+-->
5053 </PreferenceCategory>
5154
5255 <PreferenceCategory
5356 android:title="@string/pref_cat_others">
54-
57+<!--
5558 <CheckBoxPreference
5659 android:key="share_after_save"
5760 android:title="@string/pref_call_share_after_save" />
@@ -59,10 +62,8 @@
5962 <CheckBoxPreference
6063 android:key="use_playback_menu"
6164 android:title="@string/pref_use_playback_menu"
62- android:summary="@string/summary_use_playback_menu"
63-
64- />
65-
65+ android:summary="@string/summary_use_playback_menu" />
66+-->
6667 <CheckBoxPreference
6768 android:key="use_gr2_special_command"
6869 android:title="@string/pref_use_gr2_special_command"
@@ -81,9 +82,9 @@
8182 android:defaultValue="5"
8283 android:inputType="number"
8384 android:summary="@string/pref_summary_ricoh_get_pics_list_timeout" />
84-
8585 </PreferenceCategory>
8686
87+ <!--
8788 <PreferenceCategory
8889 android:title="@string/pref_cat_gokigen">
8990
@@ -109,6 +110,6 @@
109110 android:key="debug_info"
110111 android:title="@string/pref_degug_info"
111112 android:summary="@string/pref_summary_debug_info" />
112-
113113 </PreferenceCategory>
114+-->
114115 </PreferenceScreen>
--- /dev/null
+++ b/app/src/main/res/xml/preferences_summary.xml
@@ -0,0 +1,94 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
3+ <PreferenceCategory
4+ android:title="@string/pref_cat_application_control">
5+
6+ <ListPreference
7+ android:title="@string/pref_connection_method"
8+ android:entryValues="@array/connection_method_value"
9+ android:entries="@array/connection_method"
10+ android:key="connection_method"
11+ android:defaultValue="RICOH_GR2"/>
12+
13+ <PreferenceScreen
14+ android:key="wifi_settings"
15+ android:title="@string/pref_wifi_settings"
16+ android:summary="@string/pref_summary_wifi_settings" />
17+
18+ </PreferenceCategory>
19+
20+ <PreferenceCategory
21+ android:title="@string/pref_cat_camera">
22+
23+ <PreferenceScreen
24+ android:key="ricoh_settings"
25+ android:title="@string/pref_ricoh_settings"
26+ android:summary="@string/pref_summary_ricoh_settings" />
27+
28+ <PreferenceScreen
29+ android:key="fuji_x_settings"
30+ android:title="@string/pref_fuji_x_settings"
31+ android:summary="@string/pref_summary_fuji_x_settings" />
32+
33+ <PreferenceScreen
34+ android:key="opc_settings"
35+ android:title="@string/pref_opc_settings"
36+ android:summary="@string/pref_summary_opc_settings" />
37+
38+ <CheckBoxPreference
39+ android:key="capture_both_camera_and_live_view"
40+ android:title="@string/pref_capture_both_camera_and_live_view" />
41+
42+ </PreferenceCategory>
43+
44+ <PreferenceCategory
45+ android:title="@string/pref_cat_initialize">
46+
47+ <CheckBoxPreference
48+ android:key="auto_connect_to_camera"
49+ android:title="@string/pref_auto_connect_camera"
50+ android:summary="@string/pref_summary_auto_connect_camera" />
51+ </PreferenceCategory>
52+
53+ <PreferenceCategory
54+ android:title="@string/pref_cat_others">
55+
56+ <CheckBoxPreference
57+ android:key="share_after_save"
58+ android:title="@string/pref_call_share_after_save" />
59+
60+ <CheckBoxPreference
61+ android:key="use_playback_menu"
62+ android:title="@string/pref_use_playback_menu"
63+ android:summary="@string/summary_use_playback_menu" />
64+
65+ </PreferenceCategory>
66+
67+ <PreferenceCategory
68+ android:title="@string/pref_cat_gokigen">
69+
70+ <Preference
71+ android:key="instruction_link"
72+ android:title="@string/pref_instruction_manual"
73+ android:summary="https://osdn.net/projects/gokigen/wiki/GR2Control"
74+ android:selectable="true">
75+ <intent android:action="android.intent.action.VIEW"
76+ android:data="https://osdn.net/projects/gokigen/wiki/GR2Control" />
77+ </Preference>
78+
79+ <Preference
80+ android:key="privacy_policy"
81+ android:title="@string/pref_privacy_policy"
82+ android:summary="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy"
83+ android:selectable="true">
84+ <intent android:action="android.intent.action.VIEW"
85+ android:data="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy" />
86+ </Preference>
87+
88+ <PreferenceScreen
89+ android:key="debug_info"
90+ android:title="@string/pref_degug_info"
91+ android:summary="@string/pref_summary_debug_info" />
92+
93+ </PreferenceCategory>
94+</PreferenceScreen>
Show on old repository browser