• R/O
  • HTTP
  • SSH
  • HTTPS

A01d: Commit

OPC(Olympus Air)用望遠鏡アプリ。


Commit MetaInfo

Révisionc8102b51fa7e0cb863e64da8e2f1c1a2aab74bfa (tree)
l'heure2018-07-01 23:14:03
AuteurMRSa <mrsa@myad...>
CommiterMRSa

Message de Log

RICOH GR IIのリモート制御ロジックを組み込みはじめる。

Change Summary

Modification

--- a/app/build.gradle
+++ b/app/build.gradle
@@ -7,8 +7,8 @@ android {
77 applicationId "net.osdn.gokigen.a01d"
88 minSdkVersion 14
99 targetSdkVersion 27
10- versionCode 10101
11- versionName "1.1.1"
10+ versionCode 10200
11+ versionName "1.2.0"
1212 }
1313 buildTypes {
1414 release {
--- a/app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
@@ -26,8 +26,9 @@ import net.osdn.gokigen.a01d.camera.sony.cameraproperty.SonyCameraApiListFragmen
2626 import net.osdn.gokigen.a01d.liveview.IStatusViewDrawer;
2727 import net.osdn.gokigen.a01d.liveview.LiveViewFragment;
2828 import net.osdn.gokigen.a01d.logcat.LogCatFragment;
29-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
29+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
3030 import net.osdn.gokigen.a01d.preference.olympus.PreferenceFragment;
31+import net.osdn.gokigen.a01d.preference.ricohgr2.RicohGr2PreferenceFragment;
3132 import net.osdn.gokigen.a01d.preference.sony.SonyPreferenceFragment;
3233
3334 /**
@@ -135,7 +136,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
135136 if (isBlePowerOn())
136137 {
137138 // BLEでPower ONは、OPCのみ対応
138- if (interfaceProvider.useOlympusCamera())
139+ if (interfaceProvider.getCammeraConnectionMethod() == ICameraConnection.CameraConnectionMethod.OPC)
139140 {
140141 // BLEでカメラの電源をONにする設定だった時
141142 try
@@ -185,7 +186,8 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
185186 super.onPause();
186187 try
187188 {
188- ICameraConnection connection = getCameraConnection();
189+ ICameraConnection.CameraConnectionMethod method = interfaceProvider.getCammeraConnectionMethod();
190+ ICameraConnection connection = getCameraConnection(method);
189191 if (connection != null)
190192 {
191193 connection.stopWatchWifiStatus(this);
@@ -206,30 +208,17 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
206208 {
207209 try
208210 {
209- ICameraConnection connection = getCameraConnection();
210- if (!useOlympusCamera())
211+ ICameraConnection.CameraConnectionMethod method = interfaceProvider.getCammeraConnectionMethod();
212+ ICameraConnection connection = getCameraConnection(method);
213+ if (method == ICameraConnection.CameraConnectionMethod.RICOH_GR2)
214+ {
215+ // OPCカメラでない場合には、「OPCカメラのみ有効です」表示をして画面遷移させない
216+ Toast.makeText(getApplicationContext(), getText(R.string.only_opc_feature), Toast.LENGTH_SHORT).show();
217+ }
218+ else if (method == ICameraConnection.CameraConnectionMethod.SONY)
211219 {
212220 // OPCカメラでない場合には、「OPCカメラのみ有効です」表示をして画面遷移させない
213221 Toast.makeText(getApplicationContext(), getText(R.string.only_opc_feature), Toast.LENGTH_SHORT).show();
214-
215- /* // フラグメントができたらつなぐ
216- if (connection != null)
217- {
218- ICameraConnection.CameraConnectionStatus status = connection.getConnectionStatus();
219- if (status == ICameraConnection.CameraConnectionStatus.CONNECTED)
220- {
221- if (propertyListFragmentSony == null)
222- {
223- propertyListFragmentSony = SonyCameraApiListFragment.newInstance(this, interfaceProvider);
224- }
225- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
226- transaction.replace(R.id.fragment1, propertyListFragmentSony);
227- // backstackに追加
228- transaction.addToBackStack(null);
229- transaction.commit();
230- }
231- }
232- */
233222 }
234223 else
235224 {
@@ -267,13 +256,23 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
267256 {
268257 try
269258 {
270- if (preferenceFragment == null) {
271- if (useOlympusCamera())
259+ if (preferenceFragment == null)
260+ {
261+ try
272262 {
273- preferenceFragment = PreferenceFragment.newInstance(this, interfaceProvider, this);
263+ ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
264+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2) {
265+ preferenceFragment = RicohGr2PreferenceFragment.newInstance(this, this);
266+ } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY) {
267+ preferenceFragment = SonyPreferenceFragment.newInstance(this, this);
268+ } else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
269+ {
270+ preferenceFragment = PreferenceFragment.newInstance(this, interfaceProvider, this);
271+ }
274272 }
275- else
273+ catch (Exception e)
276274 {
275+ e.printStackTrace();
277276 preferenceFragment = SonyPreferenceFragment.newInstance(this, this);
278277 }
279278 }
@@ -339,7 +338,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
339338 }
340339 try
341340 {
342- ICameraConnection connection = getCameraConnection();
341+ ICameraConnection connection = getCameraConnection(interfaceProvider.getCammeraConnectionMethod());
343342 if (connection != null)
344343 {
345344 ICameraConnection.CameraConnectionStatus status = connection.getConnectionStatus();
@@ -368,7 +367,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
368367 Log.v(TAG, "exitApplication()");
369368 try
370369 {
371- ICameraConnection connection = getCameraConnection();
370+ ICameraConnection connection = getCameraConnection(interfaceProvider.getCammeraConnectionMethod());
372371 if (connection != null)
373372 {
374373 connection.disconnect(true);
@@ -394,7 +393,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
394393 if (statusViewDrawer != null)
395394 {
396395 statusViewDrawer.updateStatusView(message);
397- ICameraConnection connection = getCameraConnection();
396+ ICameraConnection connection = getCameraConnection(interfaceProvider.getCammeraConnectionMethod());
398397 if (connection != null)
399398 {
400399 statusViewDrawer.updateConnectionStatus(connection.getConnectionStatus());
@@ -418,7 +417,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
418417
419418 try
420419 {
421- ICameraConnection connection = getCameraConnection();
420+ ICameraConnection connection = getCameraConnection(interfaceProvider.getCammeraConnectionMethod());
422421 if (connection != null)
423422 {
424423 // クラス構造をミスった...のでこんなところで、無理やりステータスを更新する
@@ -464,7 +463,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
464463 try
465464 {
466465 e.printStackTrace();
467- ICameraConnection connection = getCameraConnection();
466+ ICameraConnection connection = getCameraConnection(interfaceProvider.getCammeraConnectionMethod());
468467 if (connection != null)
469468 {
470469 connection.alertConnectingFailed(message + " " + e.getLocalizedMessage());
@@ -493,9 +492,9 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
493492 boolean ret = false;
494493 try
495494 {
496- SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
497- if (useOlympusCamera())
495+ if (interfaceProvider.getCammeraConnectionMethod() == ICameraConnection.CameraConnectionMethod.OPC)
498496 {
497+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
499498 ret = preferences.getBoolean(IPreferencePropertyAccessor.BLE_POWER_ON, false);
500499 // Log.v(TAG, "isBlePowerOn() : " + ret);
501500 }
@@ -528,41 +527,25 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
528527 }
529528
530529 /**
531- * OPCカメラを使用するかどうか
532- *
533- * @return true : OPCカメラ / false : OPCカメラではない
534- */
535- private boolean useOlympusCamera()
536- {
537- boolean ret = true;
538- try
539- {
540- SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
541- String connectionMethod = preferences.getString(IPreferencePropertyAccessor.CONNECTION_METHOD, "OPC");
542- ret = connectionMethod.contains("OPC");
543- }
544- catch (Exception e)
545- {
546- e.printStackTrace();
547- }
548- return (ret);
549- }
550-
551- /**
552530 *
553531 *
554532 *
555533 */
556- private ICameraConnection getCameraConnection()
534+ private ICameraConnection getCameraConnection(ICameraConnection.CameraConnectionMethod connectionMethod)
557535 {
558536 ICameraConnection connection;
559- if (interfaceProvider.useOlympusCamera())
537+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2)
560538 {
561- connection = interfaceProvider.getOlympusInterface().getOlyCameraConnection();
562- } else
539+ connection = interfaceProvider.getRicohGr2Infterface().getRicohGr2CameraConnection();
540+ }
541+ else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY)
563542 {
564543 connection = interfaceProvider.getSonyInterface().getSonyCameraConnection();
565544 }
545+ else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
546+ {
547+ connection = interfaceProvider.getOlympusInterface().getOlyCameraConnection();
548+ }
566549 return (connection);
567550 }
568551
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/CameraInterfaceProvider.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/CameraInterfaceProvider.java
@@ -8,21 +8,25 @@ import android.support.v7.preference.PreferenceManager;
88 import net.osdn.gokigen.a01d.camera.olympus.wrapper.IOlympusLiveViewListener;
99 import net.osdn.gokigen.a01d.camera.olympus.IOlympusInterfaceProvider;
1010 import net.osdn.gokigen.a01d.camera.olympus.wrapper.OlympusInterfaceProvider;
11+import net.osdn.gokigen.a01d.camera.ricohgr2.IRicohGr2InterfaceProvider;
12+import net.osdn.gokigen.a01d.camera.ricohgr2.wrapper.RicohGr2InterfaceProvider;
1113 import net.osdn.gokigen.a01d.camera.sony.ISonyInterfaceProvider;
1214 import net.osdn.gokigen.a01d.camera.sony.wrapper.SonyCameraWrapper;
13-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
15+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
1416
1517 public class CameraInterfaceProvider implements IInterfaceProvider
1618 {
1719 private final Activity context;
1820 private final OlympusInterfaceProvider olympus;
1921 private final SonyCameraWrapper sony;
22+ private final RicohGr2InterfaceProvider ricohGr2;
2023
2124 public CameraInterfaceProvider(@NonNull Activity context, @NonNull ICameraStatusReceiver provider)
2225 {
2326 this.context = context;
2427 olympus = new OlympusInterfaceProvider(context, provider);
2528 sony = new SonyCameraWrapper(context, provider);
29+ ricohGr2 = new RicohGr2InterfaceProvider(context, provider);
2630 }
2731
2832 @Override
@@ -43,19 +47,32 @@ public class CameraInterfaceProvider implements IInterfaceProvider
4347 return (sony);
4448 }
4549
50+ @Override
51+ public IRicohGr2InterfaceProvider getRicohGr2Infterface()
52+ {
53+ return (ricohGr2);
54+ }
55+
4656 /**
4757 * OPCカメラを使用するかどうか
4858 *
49- * @return true : OPCカメラ / false : OPCカメラではない
59+ * @return OPC / SONY / RICOH_GR2 (ICameraConnection.CameraConnectionMethod)
5060 */
51- public boolean useOlympusCamera()
61+ public ICameraConnection.CameraConnectionMethod getCammeraConnectionMethod()
5262 {
53- boolean ret = true;
63+ ICameraConnection.CameraConnectionMethod ret = ICameraConnection.CameraConnectionMethod.OPC;
5464 try
5565 {
5666 SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
5767 String connectionMethod = preferences.getString(IPreferencePropertyAccessor.CONNECTION_METHOD, "OPC");
58- ret = connectionMethod.contains("OPC");
68+ if (connectionMethod.contains("SONY"))
69+ {
70+ ret = ICameraConnection.CameraConnectionMethod.SONY;
71+ }
72+ else if (connectionMethod.contains("RICOH_GR2"))
73+ {
74+ ret = ICameraConnection.CameraConnectionMethod.RICOH_GR2;
75+ }
5976 }
6077 catch (Exception e)
6178 {
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/ICameraConnection.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ICameraConnection.java
@@ -8,6 +8,13 @@ import android.content.Context;
88 */
99 public interface ICameraConnection
1010 {
11+ enum CameraConnectionMethod
12+ {
13+ OPC,
14+ SONY,
15+ RICOH_GR2
16+ }
17+
1118 enum CameraConnectionStatus
1219 {
1320 UNKNOWN,
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/ISonyCameraLiveViewListener.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ICameraLiveViewListener.java
@@ -1,8 +1,8 @@
1-package net.osdn.gokigen.a01d.camera.sony.wrapper;
1+package net.osdn.gokigen.a01d.camera;
22
33 import java.util.Map;
44
5-public interface ISonyCameraLiveViewListener
5+public interface ICameraLiveViewListener
66 {
77 void onUpdateLiveView(byte[] data, Map<String, Object> metadata);
88 }
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/IDisplayInjector.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/IDisplayInjector.java
@@ -1,6 +1,5 @@
1-package net.osdn.gokigen.a01d.camera.sony.wrapper;
1+package net.osdn.gokigen.a01d.camera;
22
3-import net.osdn.gokigen.a01d.camera.olympus.wrapper.IFocusingModeNotify;
43 import net.osdn.gokigen.a01d.liveview.IAutoFocusFrameDisplay;
54 import net.osdn.gokigen.a01d.liveview.IIndicatorControl;
65
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/IFocusingModeNotify.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/IFocusingModeNotify.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.a01d.camera.olympus.wrapper;
1+package net.osdn.gokigen.a01d.camera;
22
33
44 public interface IFocusingModeNotify
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/IInterfaceProvider.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/IInterfaceProvider.java
@@ -1,8 +1,8 @@
11 package net.osdn.gokigen.a01d.camera;
22
33 import net.osdn.gokigen.a01d.camera.olympus.wrapper.IOlympusLiveViewListener;
4-import net.osdn.gokigen.a01d.camera.sony.wrapper.IDisplayInjector;
54 import net.osdn.gokigen.a01d.camera.olympus.IOlympusInterfaceProvider;
5+import net.osdn.gokigen.a01d.camera.ricohgr2.IRicohGr2InterfaceProvider;
66 import net.osdn.gokigen.a01d.camera.sony.ISonyInterfaceProvider;
77
88 /**
@@ -14,6 +14,7 @@ public interface IInterfaceProvider
1414 IOlympusLiveViewListener getOlympusLiveViewListener();
1515
1616 ISonyInterfaceProvider getSonyInterface();
17+ IRicohGr2InterfaceProvider getRicohGr2Infterface();
1718
18- boolean useOlympusCamera();
19+ ICameraConnection.CameraConnectionMethod getCammeraConnectionMethod();
1920 }
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/IOlympusInterfaceProvider.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/IOlympusInterfaceProvider.java
@@ -11,7 +11,7 @@ import net.osdn.gokigen.a01d.camera.olympus.wrapper.IOlympusLiveViewListener;
1111 import net.osdn.gokigen.a01d.camera.olympus.wrapper.connection.ble.ICameraPowerOn;
1212 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraPropertyProvider;
1313 import net.osdn.gokigen.a01d.camera.ICameraConnection;
14-import net.osdn.gokigen.a01d.camera.sony.wrapper.IDisplayInjector;
14+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
1515
1616 /**
1717 *
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/operation/CameraPowerOff.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/operation/CameraPowerOff.java
@@ -7,7 +7,7 @@ import android.support.v7.preference.Preference;
77 import net.osdn.gokigen.a01d.ConfirmationDialog;
88 import net.osdn.gokigen.a01d.IChangeScene;
99 import net.osdn.gokigen.a01d.R;
10-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
10+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
1111
1212 /**
1313 * Preferenceがクリックされた時に処理するクラス
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OLYCameraPropertyListenerImpl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OLYCameraPropertyListenerImpl.java
@@ -3,6 +3,7 @@ package net.osdn.gokigen.a01d.camera.olympus.wrapper;
33 import android.util.Log;
44
55 import net.osdn.gokigen.a01d.camera.ICameraInformation;
6+import net.osdn.gokigen.a01d.camera.IFocusingModeNotify;
67 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraProperty;
78
89 import jp.co.olympus.camerakit.OLYCamera;
@@ -22,7 +23,7 @@ public class OLYCameraPropertyListenerImpl implements OLYCameraPropertyListener,
2223 *
2324 *
2425 */
25- public OLYCameraPropertyListenerImpl(OLYCamera olyCamera)
26+ OLYCameraPropertyListenerImpl(OLYCamera olyCamera)
2627 {
2728 olyCamera.setCameraPropertyListener(this);
2829 this.camera = olyCamera;
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OlyCameraWrapper.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OlyCameraWrapper.java
@@ -8,7 +8,7 @@ import android.util.Log;
88
99 import net.osdn.gokigen.a01d.camera.ILiveViewControl;
1010 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.CameraPropertyUtilities;
11-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
11+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
1212
1313 import java.util.Map;
1414
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OlyCameraZoomLensControl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OlyCameraZoomLensControl.java
@@ -6,7 +6,7 @@ import android.support.v7.preference.PreferenceManager;
66 import android.util.Log;
77
88 import net.osdn.gokigen.a01d.camera.IZoomLensControl;
9-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
9+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
1010
1111 import jp.co.olympus.camerakit.OLYCamera;
1212
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OlympusInterfaceProvider.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/OlympusInterfaceProvider.java
@@ -3,8 +3,9 @@ package net.osdn.gokigen.a01d.camera.olympus.wrapper;
33 import android.app.Activity;
44
55 import net.osdn.gokigen.a01d.camera.ICameraInformation;
6+import net.osdn.gokigen.a01d.camera.IFocusingModeNotify;
67 import net.osdn.gokigen.a01d.camera.ILiveViewControl;
7-import net.osdn.gokigen.a01d.camera.sony.wrapper.IDisplayInjector;
8+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
89 import net.osdn.gokigen.a01d.camera.olympus.IOlympusInterfaceProvider;
910 import net.osdn.gokigen.a01d.camera.ICaptureControl;
1011 import net.osdn.gokigen.a01d.camera.IFocusingControl;
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/connection/ble/OlyCameraPowerOnSelector.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/wrapper/connection/ble/OlyCameraPowerOnSelector.java
@@ -5,7 +5,7 @@ import android.util.Log;
55
66 import net.osdn.gokigen.a01d.ConfirmationDialog;
77 import net.osdn.gokigen.a01d.R;
8-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
8+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
99
1010 /**
1111 * Olympus AIR の Bluetooth設定を記録する
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/IRicohGr2InterfaceProvider.java
@@ -0,0 +1,23 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2;
2+
3+import net.osdn.gokigen.a01d.camera.ICameraConnection;
4+import net.osdn.gokigen.a01d.camera.ICameraInformation;
5+import net.osdn.gokigen.a01d.camera.ICaptureControl;
6+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
7+import net.osdn.gokigen.a01d.camera.IFocusingControl;
8+import net.osdn.gokigen.a01d.camera.ILiveViewControl;
9+import net.osdn.gokigen.a01d.camera.IZoomLensControl;
10+import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
11+
12+
13+public interface IRicohGr2InterfaceProvider
14+{
15+ ICameraConnection getRicohGr2CameraConnection();
16+ ILiveViewControl getLiveViewControl();
17+ ILiveViewListener getLiveViewListener();
18+ IFocusingControl getFocusingControl();
19+ ICameraInformation getCameraInformation();
20+ IZoomLensControl getZoomLensControl();
21+ ICaptureControl getCaptureControl();
22+ IDisplayInjector getDisplayInjector();
23+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/operation/CameraPowerOffRicohGr2.java
@@ -0,0 +1,75 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.operation;
2+
3+import android.content.Context;
4+import android.support.v7.preference.Preference;
5+
6+import net.osdn.gokigen.a01d.ConfirmationDialog;
7+import net.osdn.gokigen.a01d.IChangeScene;
8+import net.osdn.gokigen.a01d.R;
9+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
10+
11+public class CameraPowerOffRicohGr2 implements Preference.OnPreferenceClickListener, ConfirmationDialog.Callback
12+{
13+
14+ private final Context context;
15+ private final IChangeScene changeScene;
16+ private String preferenceKey = null;
17+
18+ /**
19+ * コンストラクタ
20+ *
21+ */
22+ public CameraPowerOffRicohGr2(Context context, IChangeScene changeScene)
23+ {
24+ this.context = context;
25+ this.changeScene = changeScene;
26+ }
27+
28+ /**
29+ * クラスの準備
30+ *
31+ */
32+ public void prepare()
33+ {
34+ // 何もしない
35+ }
36+
37+ /**
38+ *
39+ *
40+ * @param preference クリックしたpreference
41+ * @return false : ハンドルしない / true : ハンドルした
42+ */
43+ @Override
44+ public boolean onPreferenceClick(Preference preference)
45+ {
46+ if (!preference.hasKey())
47+ {
48+ return (false);
49+ }
50+
51+ preferenceKey = preference.getKey();
52+ if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
53+ {
54+
55+ // 確認ダイアログの生成と表示
56+ ConfirmationDialog dialog = ConfirmationDialog.newInstance(context);
57+ dialog.show(R.string.dialog_title_confirmation, R.string.dialog_message_power_off, this);
58+ return (true);
59+ }
60+ return (false);
61+ }
62+
63+ /**
64+ *
65+ *
66+ */
67+ @Override
68+ public void confirm()
69+ {
70+ if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
71+ {
72+ // カメラの電源をOFFにしたうえで、アプリケーションを終了する。
73+ changeScene.exitApplication();
74+ }
75+ }}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/operation/RicohGr2CameraCaptureControl.java
@@ -0,0 +1,13 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.operation;
2+
3+import net.osdn.gokigen.a01d.camera.ICaptureControl;
4+
5+public class RicohGr2CameraCaptureControl implements ICaptureControl
6+{
7+
8+ @Override
9+ public void doCapture(int kind)
10+ {
11+
12+ }
13+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/operation/RicohGr2CameraFocusControl.java
@@ -0,0 +1,20 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.operation;
2+
3+import android.view.MotionEvent;
4+
5+import net.osdn.gokigen.a01d.camera.IFocusingControl;
6+
7+public class RicohGr2CameraFocusControl implements IFocusingControl
8+{
9+
10+ @Override
11+ public boolean driveAutoFocus(MotionEvent motionEvent) {
12+ return false;
13+ }
14+
15+ @Override
16+ public void unlockAutoFocus()
17+ {
18+
19+ }
20+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/operation/RicohGr2CameraZoomLensControl.java
@@ -0,0 +1,51 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.operation;
2+
3+import net.osdn.gokigen.a01d.camera.IZoomLensControl;
4+
5+public class RicohGr2CameraZoomLensControl implements IZoomLensControl
6+{
7+ @Override
8+ public boolean canZoom() {
9+ return false;
10+ }
11+
12+ @Override
13+ public void updateStatus() {
14+
15+ }
16+
17+ @Override
18+ public float getMaximumFocalLength() {
19+ return 0;
20+ }
21+
22+ @Override
23+ public float getMinimumFocalLength() {
24+ return 0;
25+ }
26+
27+ @Override
28+ public float getCurrentFocalLength() {
29+ return 0;
30+ }
31+
32+ @Override
33+ public void driveZoomLens(float targetLength) {
34+
35+ }
36+
37+ @Override
38+ public void driveZoomLens(boolean isZoomIn) {
39+
40+ }
41+
42+ @Override
43+ public void moveInitialZoomPosition() {
44+
45+ }
46+
47+ @Override
48+ public boolean isDrivingZoomLens() {
49+ return false;
50+ }
51+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/wrapper/RicohGr2InterfaceProvider.java
@@ -0,0 +1,138 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.wrapper;
2+
3+import android.app.Activity;
4+import android.support.annotation.NonNull;
5+import android.util.Log;
6+
7+import net.osdn.gokigen.a01d.camera.ICameraConnection;
8+import net.osdn.gokigen.a01d.camera.ICameraInformation;
9+import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
10+import net.osdn.gokigen.a01d.camera.ICaptureControl;
11+import net.osdn.gokigen.a01d.camera.IFocusingControl;
12+import net.osdn.gokigen.a01d.camera.ILiveViewControl;
13+import net.osdn.gokigen.a01d.camera.IFocusingModeNotify;
14+import net.osdn.gokigen.a01d.camera.IZoomLensControl;
15+import net.osdn.gokigen.a01d.camera.ricohgr2.IRicohGr2InterfaceProvider;
16+import net.osdn.gokigen.a01d.camera.ricohgr2.operation.RicohGr2CameraCaptureControl;
17+import net.osdn.gokigen.a01d.camera.ricohgr2.operation.RicohGr2CameraFocusControl;
18+import net.osdn.gokigen.a01d.camera.ricohgr2.operation.RicohGr2CameraZoomLensControl;
19+import net.osdn.gokigen.a01d.camera.ricohgr2.wrapper.connection.RicohGr2Connection;
20+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
21+import net.osdn.gokigen.a01d.liveview.IAutoFocusFrameDisplay;
22+import net.osdn.gokigen.a01d.liveview.IIndicatorControl;
23+import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
24+
25+/**
26+ *
27+ *
28+ */
29+public class RicohGr2InterfaceProvider implements IRicohGr2InterfaceProvider, IDisplayInjector
30+{
31+ private final String TAG = toString();
32+ private final Activity activity;
33+ private final ICameraStatusReceiver provider;
34+ private final RicohGr2Connection gr2Connection;
35+ private RicohGr2LiveViewControl liveViewControl;
36+ private RicohGr2CameraCaptureControl captureControl;
37+ private RicohGr2CameraZoomLensControl zoomControl;
38+ private RicohGr2CameraFocusControl focusControl;
39+
40+ /**
41+ *
42+ *
43+ */
44+ public RicohGr2InterfaceProvider(@NonNull Activity context, @NonNull ICameraStatusReceiver provider)
45+ {
46+ this.activity = context;
47+ this.provider = provider;
48+ gr2Connection = new RicohGr2Connection(context, provider);
49+ liveViewControl = new RicohGr2LiveViewControl();
50+ captureControl = new RicohGr2CameraCaptureControl();
51+ zoomControl = new RicohGr2CameraZoomLensControl();
52+ focusControl = new RicohGr2CameraFocusControl();
53+
54+ }
55+
56+ /**
57+ *
58+ *
59+ */
60+ public void prepare()
61+ {
62+ // liveViewControl = new RicohGr2LiveViewControl();
63+ }
64+
65+ /**
66+ *
67+ *
68+ */
69+ @Override
70+ public void injectDisplay(IAutoFocusFrameDisplay frameDisplayer, IIndicatorControl indicator, IFocusingModeNotify focusingModeNotify)
71+ {
72+ Log.v(TAG, "injectDisplay()");
73+
74+ }
75+
76+ /**
77+ *
78+ *
79+ */
80+ @Override
81+ public ICameraConnection getRicohGr2CameraConnection()
82+ {
83+ return (gr2Connection);
84+ }
85+
86+ /**
87+ *
88+ *
89+ */
90+ @Override
91+ public ILiveViewControl getLiveViewControl()
92+ {
93+ return (liveViewControl);
94+ }
95+
96+ /**
97+ *
98+ *
99+ */
100+ @Override
101+ public ILiveViewListener getLiveViewListener()
102+ {
103+ if (liveViewControl == null)
104+ {
105+ return (null);
106+ }
107+ return (liveViewControl.getLiveViewListener());
108+ }
109+
110+ @Override
111+ public IFocusingControl getFocusingControl()
112+ {
113+ return (focusControl);
114+ }
115+
116+ @Override
117+ public ICameraInformation getCameraInformation()
118+ {
119+ return null;
120+ }
121+
122+ @Override
123+ public IZoomLensControl getZoomLensControl()
124+ {
125+ return (zoomControl);
126+ }
127+
128+ @Override
129+ public ICaptureControl getCaptureControl()
130+ {
131+ return (captureControl);
132+ }
133+
134+ @Override
135+ public IDisplayInjector getDisplayInjector() {
136+ return (this);
137+ }
138+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/wrapper/RicohGr2LiveViewControl.java
@@ -0,0 +1,196 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.wrapper;
2+
3+import android.support.annotation.NonNull;
4+import android.util.Log;
5+
6+import net.osdn.gokigen.a01d.camera.ILiveViewControl;
7+import net.osdn.gokigen.a01d.camera.utils.SimpleLiveviewSlicer;
8+import net.osdn.gokigen.a01d.liveview.liveviewlistener.CameraLiveViewListenerImpl;
9+import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
10+
11+/**
12+ *
13+ *
14+ */
15+public class RicohGr2LiveViewControl implements ILiveViewControl
16+{
17+ private final String TAG = toString();
18+ private final CameraLiveViewListenerImpl liveViewListener;
19+ private String liveViewUrl = "http://192.168.0.1/v1/display";
20+ private boolean whileFetching = false;
21+ private static final int FETCH_ERROR_MAX = 30;
22+
23+ /**
24+ *
25+ *
26+ */
27+ RicohGr2LiveViewControl()
28+ {
29+ liveViewListener = new CameraLiveViewListenerImpl();
30+ }
31+
32+/*
33+ public void setLiveViewAddress(@NonNull String address, @NonNull String page)
34+ {
35+ liveViewUrl = "http://" + address + "/" + page;
36+ }
37+*/
38+
39+ @Override
40+ public void changeLiveViewSize(String size)
41+ {
42+ //
43+
44+ }
45+
46+ @Override
47+ public void startLiveView()
48+ {
49+ Log.v(TAG, "startLiveView()");
50+ try
51+ {
52+ Thread thread = new Thread(new Runnable()
53+ {
54+ @Override
55+ public void run()
56+ {
57+ try
58+ {
59+ start(liveViewUrl);
60+ }
61+ catch (Exception e)
62+ {
63+ e.printStackTrace();
64+ }
65+ }
66+ });
67+ thread.start();
68+ }
69+ catch (Exception e)
70+ {
71+ e.printStackTrace();
72+ }
73+
74+ }
75+
76+ @Override
77+ public void stopLiveView()
78+ {
79+
80+ }
81+
82+
83+ private void start(@NonNull final String streamUrl)
84+ {
85+ if (whileFetching)
86+ {
87+ Log.v(TAG, "start() already starting.");
88+ }
89+ whileFetching = true;
90+
91+ // A thread for retrieving liveview data from server.
92+ try
93+ {
94+ Thread thread = new Thread(new Runnable()
95+ {
96+ @Override
97+ public void run()
98+ {
99+ Log.d(TAG, "Starting retrieving streaming data from server.");
100+ SimpleLiveviewSlicer slicer = null;
101+ int continuousNullDataReceived = 0;
102+ try
103+ {
104+ // Create Slicer to open the stream and parse it.
105+ slicer = new SimpleLiveviewSlicer();
106+ slicer.open(streamUrl);
107+
108+ while (whileFetching)
109+ {
110+ final SimpleLiveviewSlicer.Payload payload = slicer.nextPayloadForMotionJpeg();
111+ if (payload == null)
112+ {
113+ //Log.v(TAG, "Liveview Payload is null.");
114+ continuousNullDataReceived++;
115+ if (continuousNullDataReceived > FETCH_ERROR_MAX)
116+ {
117+ Log.d(TAG, " FETCH ERROR MAX OVER ");
118+ break;
119+ }
120+ continue;
121+ }
122+ //if (mJpegQueue.size() == 2)
123+ //{
124+ // mJpegQueue.remove();
125+ //}
126+ //mJpegQueue.add(payload.getJpegData());
127+ liveViewListener.onUpdateLiveView(payload.getJpegData(), null);
128+ continuousNullDataReceived = 0;
129+ }
130+ }
131+ catch (Exception e)
132+ {
133+ e.printStackTrace();
134+ }
135+ finally
136+ {
137+ try
138+ {
139+ if (slicer != null)
140+ {
141+ slicer.close();
142+ }
143+ }
144+ catch (Exception e)
145+ {
146+ e.printStackTrace();
147+ }
148+ //mJpegQueue.clear();
149+ if ((!whileFetching)&&(continuousNullDataReceived > FETCH_ERROR_MAX))
150+ {
151+ // 再度ライブビューのスタートをやってみる。
152+ whileFetching = false;
153+ //continuousNullDataReceived = 0;
154+ start(streamUrl);
155+ }
156+ }
157+ }
158+ });
159+ thread.start();
160+ }
161+ catch (Exception e)
162+ {
163+ e.printStackTrace();
164+ }
165+ }
166+
167+
168+ @Override
169+ public void updateDigitalZoom()
170+ {
171+
172+ }
173+
174+ @Override
175+ public void updateMagnifyingLiveViewScale(boolean isChangeScale)
176+ {
177+
178+ }
179+
180+ @Override
181+ public float getMagnifyingLiveViewScale()
182+ {
183+ return (1.0f);
184+ }
185+
186+ @Override
187+ public float getDigitalZoomScale()
188+ {
189+ return (1.0f);
190+ }
191+
192+ public ILiveViewListener getLiveViewListener()
193+ {
194+ return (liveViewListener);
195+ }
196+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/wrapper/connection/RicohGr2CameraConnectSequence.java
@@ -0,0 +1,92 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.wrapper.connection;
2+
3+import android.app.Activity;
4+import android.support.annotation.NonNull;
5+import android.util.Log;
6+
7+import net.osdn.gokigen.a01d.R;
8+import net.osdn.gokigen.a01d.camera.ICameraConnection;
9+import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
10+import net.osdn.gokigen.a01d.camera.utils.SimpleHttpClient;
11+
12+class RicohGr2CameraConnectSequence implements Runnable
13+{
14+ private final String TAG = this.toString();
15+ private final Activity context;
16+ private final ICameraConnection cameraConnection;
17+ private final ICameraStatusReceiver cameraStatusReceiver;
18+
19+ RicohGr2CameraConnectSequence(@NonNull Activity context, @NonNull ICameraStatusReceiver statusReceiver, @NonNull final ICameraConnection cameraConnection)
20+ {
21+ Log.v(TAG, "RicohGr2CameraConnectSequence");
22+ this.context = context;
23+ this.cameraConnection = cameraConnection;
24+ this.cameraStatusReceiver = statusReceiver;
25+ }
26+
27+ @Override
28+ public void run()
29+ {
30+ final String areYouThereUrl = "http://192.168.0.1/v1/ping";
31+ final int TIMEOUT_MS = 5000;
32+ try
33+ {
34+ String response = SimpleHttpClient.httpGet(areYouThereUrl, TIMEOUT_MS);
35+ Log.v(TAG, areYouThereUrl + " " + response);
36+ if (response.length() > 0)
37+ {
38+ onConnectNotify();
39+ }
40+ else
41+ {
42+ onConnectError(context.getString(R.string.camera_not_found));
43+ }
44+ }
45+ catch (Exception e)
46+ {
47+ e.printStackTrace();
48+ onConnectError(e.getLocalizedMessage());
49+ }
50+ }
51+
52+ private void onConnectNotify()
53+ {
54+ try
55+ {
56+ final Thread thread = new Thread(new Runnable()
57+ {
58+ @Override
59+ public void run()
60+ {
61+ // カメラとの接続確立を通知する
62+ cameraStatusReceiver.onStatusNotify(context.getString(R.string.connect_connected));
63+ cameraStatusReceiver.onCameraConnected();
64+ Log.v(TAG, "onConnectNotify()");
65+ }
66+ });
67+ thread.start();
68+ }
69+ catch (Exception e)
70+ {
71+ e.printStackTrace();
72+ }
73+ }
74+
75+ private void waitForAMoment(long mills)
76+ {
77+ if (mills > 0)
78+ {
79+ try {
80+ Log.v(TAG, " WAIT " + mills + "ms");
81+ Thread.sleep(mills);
82+ } catch (Exception e) {
83+ e.printStackTrace();
84+ }
85+ }
86+ }
87+
88+ private void onConnectError(String reason)
89+ {
90+ cameraConnection.alertConnectingFailed(reason);
91+ }
92+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/wrapper/connection/RicohGr2CameraDisconnectSequence.java
@@ -0,0 +1,38 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.wrapper.connection;
2+
3+import android.util.Log;
4+
5+import net.osdn.gokigen.a01d.R;
6+import net.osdn.gokigen.a01d.camera.utils.SimpleHttpClient;
7+
8+public class RicohGr2CameraDisconnectSequence implements Runnable
9+{
10+ private final String TAG = this.toString();
11+ private final boolean powerOff;
12+
13+ RicohGr2CameraDisconnectSequence(boolean isOff)
14+ {
15+ this.powerOff = isOff;
16+ }
17+
18+ @Override
19+ public void run()
20+ {
21+ // カメラをPowerOffして接続を切る
22+ try
23+ {
24+ if (powerOff)
25+ {
26+ final String cameraPowerOffUrl = "http://192.168.0.1/v1/device/finish";
27+ final String postData = "";
28+ final int TIMEOUT_MS = 5000;
29+ String response = SimpleHttpClient.httpPost(cameraPowerOffUrl, postData, TIMEOUT_MS);
30+ Log.v(TAG, cameraPowerOffUrl + " " + response);
31+ }
32+ }
33+ catch (Exception e)
34+ {
35+ e.printStackTrace();
36+ }
37+ }
38+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/ricohgr2/wrapper/connection/RicohGr2Connection.java
@@ -0,0 +1,269 @@
1+package net.osdn.gokigen.a01d.camera.ricohgr2.wrapper.connection;
2+
3+import android.app.Activity;
4+import android.content.BroadcastReceiver;
5+import android.content.Context;
6+import android.content.DialogInterface;
7+import android.content.Intent;
8+import android.content.IntentFilter;
9+import android.net.ConnectivityManager;
10+import android.net.wifi.WifiInfo;
11+import android.net.wifi.WifiManager;
12+import android.provider.Settings;
13+import android.support.annotation.NonNull;
14+import android.support.v7.app.AlertDialog;
15+import android.util.Log;
16+
17+import net.osdn.gokigen.a01d.R;
18+import net.osdn.gokigen.a01d.camera.ICameraConnection;
19+import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
20+
21+import java.util.concurrent.Executor;
22+import java.util.concurrent.Executors;
23+
24+
25+/**
26+ *
27+ *
28+ */
29+public class RicohGr2Connection implements ICameraConnection
30+{
31+ private final String TAG = toString();
32+ private final Activity context;
33+ private final ICameraStatusReceiver statusReceiver;
34+ private final BroadcastReceiver connectionReceiver;
35+ //private final ConnectivityManager connectivityManager;
36+ private final Executor cameraExecutor = Executors.newFixedThreadPool(1);
37+ //private final Handler networkConnectionTimeoutHandler;
38+ //private static final int MESSAGE_CONNECTIVITY_TIMEOUT = 1;
39+ private CameraConnectionStatus connectionStatus = CameraConnectionStatus.UNKNOWN;
40+
41+
42+ /**
43+ *
44+ *
45+ */
46+ public RicohGr2Connection(@NonNull final Activity context, @NonNull final ICameraStatusReceiver statusReceiver)
47+ {
48+ Log.v(TAG, "SonyCameraConnection()");
49+ this.context = context;
50+ this.statusReceiver = statusReceiver;
51+ connectionReceiver = new BroadcastReceiver()
52+ {
53+ @Override
54+ public void onReceive(Context context, Intent intent)
55+ {
56+ onReceiveBroadcastOfConnection(context, intent);
57+ }
58+ };
59+ }
60+
61+ /**
62+ *
63+ *
64+ */
65+ private void onReceiveBroadcastOfConnection(Context context, Intent intent)
66+ {
67+ statusReceiver.onStatusNotify(context.getString(R.string.connect_check_wifi));
68+ Log.v(TAG,context.getString(R.string.connect_check_wifi));
69+
70+ String action = intent.getAction();
71+ if (action == null)
72+ {
73+ //
74+ Log.v(TAG, "intent.getAction() : null");
75+ return;
76+ }
77+
78+ try
79+ {
80+ if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION))
81+ {
82+ Log.v(TAG, "onReceiveBroadcastOfConnection() : CONNECTIVITY_ACTION");
83+
84+ WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
85+ if (wifiManager != null) {
86+ WifiInfo info = wifiManager.getConnectionInfo();
87+ if (wifiManager.isWifiEnabled() && info != null)
88+ {
89+ if (info.getNetworkId() != -1)
90+ {
91+ Log.v(TAG, "Network ID is -1, there is no currently connected network.");
92+ }
93+ // 自動接続が指示されていた場合は、カメラとの接続処理を行う
94+ connectToCamera();
95+ } else {
96+ if (info == null)
97+ {
98+ Log.v(TAG, "NETWORK INFO IS NULL.");
99+ } else {
100+ Log.v(TAG, "isWifiEnabled : " + wifiManager.isWifiEnabled() + " NetworkId : " + info.getNetworkId());
101+ }
102+ }
103+ }
104+ }
105+ }
106+ catch (Exception e)
107+ {
108+ Log.w(TAG, "onReceiveBroadcastOfConnection() EXCEPTION" + e.getMessage());
109+ e.printStackTrace();
110+ }
111+ }
112+
113+ /**
114+ *
115+ *
116+ */
117+ @Override
118+ public void startWatchWifiStatus(Context context)
119+ {
120+ Log.v(TAG, "startWatchWifiStatus()");
121+ statusReceiver.onStatusNotify("prepare");
122+
123+ IntentFilter filter = new IntentFilter();
124+ filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
125+ filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
126+ context.registerReceiver(connectionReceiver, filter);
127+ }
128+
129+ /**
130+ *
131+ *
132+ */
133+ @Override
134+ public void stopWatchWifiStatus(Context context)
135+ {
136+ Log.v(TAG, "stopWatchWifiStatus()");
137+ context.unregisterReceiver(connectionReceiver);
138+ disconnect(false);
139+ }
140+
141+ /**
142+ *
143+ *
144+ */
145+ @Override
146+ public void disconnect(boolean powerOff)
147+ {
148+ Log.v(TAG, "disconnect()");
149+ disconnectFromCamera(powerOff);
150+ connectionStatus = CameraConnectionStatus.DISCONNECTED;
151+ statusReceiver.onCameraDisconnected();
152+ }
153+
154+
155+ /**
156+ *
157+ *
158+ */
159+ @Override
160+ public void connect()
161+ {
162+ Log.v(TAG, "connect()");
163+ connectToCamera();
164+ }
165+
166+
167+ /**
168+ *
169+ *
170+ */
171+ @Override
172+ public void alertConnectingFailed(String message)
173+ {
174+ Log.v(TAG, "alertConnectingFailed() : " + message);
175+ final AlertDialog.Builder builder = new AlertDialog.Builder(context)
176+ .setTitle(context.getString(R.string.dialog_title_connect_failed))
177+ .setMessage(message)
178+ .setPositiveButton(context.getString(R.string.dialog_title_button_retry), new DialogInterface.OnClickListener() {
179+ @Override
180+ public void onClick(DialogInterface dialog, int which)
181+ {
182+ connect();
183+ }
184+ })
185+ .setNeutralButton(R.string.dialog_title_button_network_settings, new DialogInterface.OnClickListener() {
186+ @Override
187+ public void onClick(DialogInterface dialog, int which)
188+ {
189+ try
190+ {
191+ // Wifi 設定画面を表示する
192+ context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
193+ }
194+ catch (android.content.ActivityNotFoundException ex)
195+ {
196+ // Activity が存在しなかった...設定画面が起動できなかった
197+ Log.v(TAG, "android.content.ActivityNotFoundException...");
198+
199+ // この場合は、再試行と等価な動きとする
200+ connect();
201+ }
202+ catch (Exception e)
203+ {
204+ e.printStackTrace();
205+ }
206+ }
207+ });
208+ context.runOnUiThread(new Runnable()
209+ {
210+ @Override
211+ public void run()
212+ {
213+ builder.show();
214+ }
215+ });
216+ }
217+
218+ @Override
219+ public CameraConnectionStatus getConnectionStatus()
220+ {
221+ Log.v(TAG, "getConnectionStatus()");
222+ return (connectionStatus);
223+ }
224+
225+ /**
226+ *
227+ *
228+ */
229+ @Override
230+ public void forceUpdateConnectionStatus(CameraConnectionStatus status)
231+ {
232+ Log.v(TAG, "forceUpdateConnectionStatus()");
233+ connectionStatus = status;
234+ }
235+
236+ /**
237+ * カメラとの切断処理
238+ */
239+ private void disconnectFromCamera(final boolean powerOff)
240+ {
241+ Log.v(TAG, "disconnectFromCamera()");
242+ try
243+ {
244+ cameraExecutor.execute(new RicohGr2CameraDisconnectSequence(powerOff));
245+ }
246+ catch (Exception e)
247+ {
248+ e.printStackTrace();
249+ }
250+ }
251+
252+ /**
253+ * カメラとの接続処理
254+ */
255+ private void connectToCamera()
256+ {
257+ Log.v(TAG, "connectToCamera()");
258+ connectionStatus = CameraConnectionStatus.CONNECTING;
259+ try
260+ {
261+ cameraExecutor.execute(new RicohGr2CameraConnectSequence(context, statusReceiver, this));
262+ }
263+ catch (Exception e)
264+ {
265+ Log.v(TAG, "connectToCamera() EXCEPTION : " + e.getMessage());
266+ e.printStackTrace();
267+ }
268+ }
269+}
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/ISonyInterfaceProvider.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/ISonyInterfaceProvider.java
@@ -6,8 +6,7 @@ import net.osdn.gokigen.a01d.camera.ICaptureControl;
66 import net.osdn.gokigen.a01d.camera.IFocusingControl;
77 import net.osdn.gokigen.a01d.camera.ILiveViewControl;
88 import net.osdn.gokigen.a01d.camera.IZoomLensControl;
9-import net.osdn.gokigen.a01d.camera.sony.wrapper.IDisplayInjector;
10-import net.osdn.gokigen.a01d.camera.sony.wrapper.ISonyApiService;
9+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
1110 import net.osdn.gokigen.a01d.camera.sony.wrapper.ISonyCameraApi;
1211 import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
1312
@@ -17,7 +16,7 @@ public interface ISonyInterfaceProvider
1716 {
1817 ICameraConnection getSonyCameraConnection();
1918 ILiveViewControl getSonyLiveViewControl();
20- ILiveViewListener getSonyLiveViewListener();
19+ ILiveViewListener getLiveViewListener();
2120 IFocusingControl getFocusingControl();
2221 ICameraInformation getCameraInformation();
2322 IZoomLensControl getZoomLensControl();
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/operation/CameraPowerOffSony.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/operation/CameraPowerOffSony.java
@@ -6,13 +6,14 @@ import android.support.v7.preference.Preference;
66 import net.osdn.gokigen.a01d.ConfirmationDialog;
77 import net.osdn.gokigen.a01d.IChangeScene;
88 import net.osdn.gokigen.a01d.R;
9-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
9+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
1010
1111
1212 /**
1313 * Preferenceがクリックされた時に処理するクラス
1414 *
15- */public class CameraPowerOffSony implements Preference.OnPreferenceClickListener, ConfirmationDialog.Callback
15+ */
16+public class CameraPowerOffSony implements Preference.OnPreferenceClickListener, ConfirmationDialog.Callback
1617 {
1718
1819 private final Context context;
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/ISonyLiveViewListener.java
+++ /dev/null
@@ -1,6 +0,0 @@
1-package net.osdn.gokigen.a01d.camera.sony.wrapper;
2-
3-public interface ISonyLiveViewListener
4-{
5- void setSonyLiveViewListener(ISonyCameraLiveViewListener listener);
6-}
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyCameraApi.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyCameraApi.java
@@ -3,7 +3,7 @@ package net.osdn.gokigen.a01d.camera.sony.wrapper;
33 import android.support.annotation.NonNull;
44 import android.util.Log;
55
6-import net.osdn.gokigen.a01d.camera.sony.wrapper.utils.SimpleHttpClient;
6+import net.osdn.gokigen.a01d.camera.utils.SimpleHttpClient;
77
88 import org.json.JSONArray;
99 import org.json.JSONObject;
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyCameraDeviceProvider.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyCameraDeviceProvider.java
@@ -3,8 +3,8 @@ package net.osdn.gokigen.a01d.camera.sony.wrapper;
33 import android.support.annotation.NonNull;
44 import android.util.Log;
55
6-import net.osdn.gokigen.a01d.camera.sony.wrapper.utils.SimpleHttpClient;
7-import net.osdn.gokigen.a01d.camera.sony.wrapper.utils.XmlElement;
6+import net.osdn.gokigen.a01d.camera.utils.SimpleHttpClient;
7+import net.osdn.gokigen.a01d.camera.utils.XmlElement;
88
99 import java.util.ArrayList;
1010 import java.util.List;
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyCameraWrapper.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyCameraWrapper.java
@@ -9,10 +9,11 @@ import net.osdn.gokigen.a01d.camera.ICameraConnection;
99 import net.osdn.gokigen.a01d.camera.ICameraInformation;
1010 import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
1111 import net.osdn.gokigen.a01d.camera.ICaptureControl;
12+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
1213 import net.osdn.gokigen.a01d.camera.IFocusingControl;
1314 import net.osdn.gokigen.a01d.camera.ILiveViewControl;
1415 import net.osdn.gokigen.a01d.camera.IZoomLensControl;
15-import net.osdn.gokigen.a01d.camera.olympus.wrapper.IFocusingModeNotify;
16+import net.osdn.gokigen.a01d.camera.IFocusingModeNotify;
1617 import net.osdn.gokigen.a01d.camera.sony.ISonyInterfaceProvider;
1718 import net.osdn.gokigen.a01d.camera.sony.operation.SonyCameraCaptureControl;
1819 import net.osdn.gokigen.a01d.camera.sony.operation.SonyCameraFocusControl;
@@ -26,9 +27,6 @@ import net.osdn.gokigen.a01d.liveview.IAutoFocusFrameDisplay;
2627 import net.osdn.gokigen.a01d.liveview.IIndicatorControl;
2728 import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
2829
29-import org.json.JSONArray;
30-import org.json.JSONObject;
31-
3230 import java.util.ArrayList;
3331 import java.util.Arrays;
3432 import java.util.List;
@@ -114,9 +112,9 @@ public class SonyCameraWrapper implements ISonyCameraHolder, ISonyInterfaceProvi
114112 }
115113
116114 @Override
117- public ILiveViewListener getSonyLiveViewListener()
115+ public ILiveViewListener getLiveViewListener()
118116 {
119- return (liveViewControl.getSonyLiveViewListener());
117+ return (liveViewControl.getLiveViewListener());
120118 }
121119
122120 @Override
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyLiveViewControl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/SonyLiveViewControl.java
@@ -4,9 +4,9 @@ import android.support.annotation.NonNull;
44 import android.util.Log;
55
66 import net.osdn.gokigen.a01d.camera.ILiveViewControl;
7-import net.osdn.gokigen.a01d.camera.sony.wrapper.utils.SimpleLiveviewSlicer;
7+import net.osdn.gokigen.a01d.camera.utils.SimpleLiveviewSlicer;
88 import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
9-import net.osdn.gokigen.a01d.liveview.liveviewlistener.SonyCameraLiveViewListenerImpl;
9+import net.osdn.gokigen.a01d.liveview.liveviewlistener.CameraLiveViewListenerImpl;
1010
1111 import org.json.JSONArray;
1212 import org.json.JSONObject;
@@ -16,14 +16,14 @@ public class SonyLiveViewControl implements ILiveViewControl
1616 private final String TAG = toString();
1717 private final ISonyCameraApi cameraApi;
1818 //private final BlockingQueue<byte[]> mJpegQueue = new ArrayBlockingQueue<>(2);
19- private final SonyCameraLiveViewListenerImpl liveViewListener;
19+ private final CameraLiveViewListenerImpl liveViewListener;
2020 private boolean whileFetching = false;
2121 private static final int FETCH_ERROR_MAX = 30;
2222
2323 SonyLiveViewControl(@NonNull ISonyCameraApi cameraApi)
2424 {
2525 this.cameraApi = cameraApi;
26- liveViewListener = new SonyCameraLiveViewListenerImpl();
26+ liveViewListener = new CameraLiveViewListenerImpl();
2727 }
2828
2929 @Override
@@ -228,7 +228,7 @@ public class SonyLiveViewControl implements ILiveViewControl
228228 return (true);
229229 }
230230
231- public ILiveViewListener getSonyLiveViewListener()
231+ public ILiveViewListener getLiveViewListener()
232232 {
233233 return (liveViewListener);
234234 }
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/connection/SonyCameraConnection.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/connection/SonyCameraConnection.java
@@ -158,7 +158,6 @@ public class SonyCameraConnection implements ICameraConnection
158158 public void disconnect(boolean powerOff)
159159 {
160160 Log.v(TAG, "disconnect()");
161- Log.v(TAG, "disconnect()");
162161 disconnectFromCamera(powerOff);
163162 connectionStatus = CameraConnectionStatus.DISCONNECTED;
164163 statusReceiver.onCameraDisconnected();
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/utils/SimpleHttpClient.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/utils/SimpleHttpClient.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.a01d.camera.sony.wrapper.utils;
1+package net.osdn.gokigen.a01d.camera.utils;
22
33 import android.util.Log;
44
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/utils/SimpleLiveviewSlicer.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/utils/SimpleLiveviewSlicer.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.a01d.camera.sony.wrapper.utils;
1+package net.osdn.gokigen.a01d.camera.utils;
22
33 import android.util.Log;
44
@@ -96,7 +96,6 @@ public class SimpleLiveviewSlicer
9696 Payload payload = null;
9797 try
9898 {
99-
10099 while ((mInputStream != null)&&(payload == null))
101100 {
102101 // Common Header
@@ -229,4 +228,89 @@ public class SimpleLiveviewSlicer
229228 }
230229 return (ret);
231230 }
231+
232+ /**
233+ * 先頭のjpegマーカーが出てくるまで読み飛ばす
234+ *
235+ */
236+ private void skipJpegMarkStart(InputStream stream)
237+ {
238+ int searchIndex = 0;
239+ int[] startmarker = { 0x0d, 0x0a, 0x0d, 0x0a, 0xff, 0xd8 };
240+ while (true)
241+ {
242+ try
243+ {
244+ int data = stream.read();
245+ if (data == startmarker[searchIndex])
246+ {
247+ searchIndex++;
248+ if (searchIndex >= startmarker.length)
249+ {
250+ break;
251+ }
252+ }
253+ }
254+ catch (Exception e)
255+ {
256+ e.printStackTrace();
257+ return;
258+ }
259+ }
260+ }
261+
262+ /**
263+ *
264+ *
265+ */
266+ public Payload nextPayloadForMotionJpeg()
267+ {
268+ int searchIndex = 0;
269+ int[] endmarker = { 0xff, 0xd9, 0x0d, 0x0a, 0x0d, 0x0a };
270+ Payload payload = null;
271+ try
272+ {
273+ while ((mInputStream != null)&&(payload == null))
274+ {
275+ skipJpegMarkStart(mInputStream);
276+ ByteArrayOutputStream tmpByteArray = new ByteArrayOutputStream();
277+ // 先頭にJPEGのマークを詰める
278+ tmpByteArray.write(0xff);
279+ tmpByteArray.write(0xd8);
280+ while (true)
281+ {
282+ try
283+ {
284+ // 1byteづつの読み込み... 本当は複数バイト読み出しで処理したい
285+ int data = mInputStream.read();
286+ tmpByteArray.write(data);
287+ if (data == endmarker[searchIndex])
288+ {
289+ searchIndex++;
290+ if (searchIndex >= endmarker.length)
291+ {
292+ break;
293+ }
294+ }
295+ else
296+ {
297+ searchIndex = 0;
298+ }
299+ }
300+ catch (Exception e)
301+ {
302+ Log.v(TAG, "INPUT STREAM EXCEPTION : " + e.getLocalizedMessage());
303+ // e.printStackTrace();
304+ return (null);
305+ }
306+ }
307+ payload = new Payload(tmpByteArray.toByteArray(), null);
308+ }
309+ }
310+ catch (Exception e)
311+ {
312+ e.printStackTrace();
313+ }
314+ return (payload);
315+ }
232316 }
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/wrapper/utils/XmlElement.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/utils/XmlElement.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.a01d.camera.sony.wrapper.utils;
1+package net.osdn.gokigen.a01d.camera.utils;
22
33 import android.support.annotation.NonNull;
44 import android.util.Log;
--- a/app/src/main/java/net/osdn/gokigen/a01d/liveview/CameraLiveImageView.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/liveview/CameraLiveImageView.java
@@ -10,7 +10,7 @@ import android.graphics.Paint;
1010 import android.graphics.PointF;
1111 import android.graphics.Rect;
1212 import android.graphics.RectF;
13-import android.media.ExifInterface;
13+import android.support.media.ExifInterface;
1414 import android.os.Looper;
1515 import android.preference.PreferenceManager;
1616 import android.util.AttributeSet;
@@ -30,7 +30,7 @@ import net.osdn.gokigen.a01d.liveview.liveviewlistener.IImageDataReceiver;
3030 import net.osdn.gokigen.a01d.liveview.message.IMessageDrawer;
3131 import net.osdn.gokigen.a01d.liveview.message.IMessageHolder;
3232 import net.osdn.gokigen.a01d.liveview.message.ShowMessageHolder;
33-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
33+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
3434
3535 import java.util.Map;
3636 import java.util.Timer;
--- a/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewClickTouchListener.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewClickTouchListener.java
@@ -18,7 +18,7 @@ import net.osdn.gokigen.a01d.camera.ICameraConnection;
1818 import net.osdn.gokigen.a01d.camera.IZoomLensControl;
1919 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraProperty;
2020 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraPropertyProvider;
21-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
21+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
2222
2323 /**
2424 *
@@ -48,16 +48,17 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
4848 this.changeScene = changeScene;
4949 this.interfaceProvider = interfaceProvider;
5050
51- if (interfaceProvider.useOlympusCamera())
51+ ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
52+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2)
5253 {
53- this.focusingControl = interfaceProvider.getOlympusInterface().getFocusingControl();
54- this.captureControl = interfaceProvider.getOlympusInterface().getCaptureControl();
55- this.propertyProvider = interfaceProvider.getOlympusInterface().getCameraPropertyProvider();
56- this.cameraInformation = interfaceProvider.getOlympusInterface().getCameraInformation();
57- this.cameraConnection = interfaceProvider.getOlympusInterface().getOlyCameraConnection();
58- this.zoomLensControl = interfaceProvider.getOlympusInterface().getZoomLensControl();
54+ this.focusingControl = interfaceProvider.getRicohGr2Infterface().getFocusingControl();
55+ this.captureControl = interfaceProvider.getRicohGr2Infterface().getCaptureControl();
56+ this.propertyProvider = interfaceProvider.getOlympusInterface().getCameraPropertyProvider(); // 要変更
57+ this.cameraInformation = interfaceProvider.getRicohGr2Infterface().getCameraInformation();
58+ this.cameraConnection = interfaceProvider.getRicohGr2Infterface().getRicohGr2CameraConnection();
59+ this.zoomLensControl = interfaceProvider.getRicohGr2Infterface().getZoomLensControl();
5960 }
60- else
61+ else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY)
6162 {
6263 this.focusingControl = interfaceProvider.getSonyInterface().getFocusingControl();
6364 this.captureControl = interfaceProvider.getSonyInterface().getCaptureControl();
@@ -66,6 +67,16 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
6667 this.cameraConnection = interfaceProvider.getSonyInterface().getSonyCameraConnection();
6768 this.zoomLensControl = interfaceProvider.getSonyInterface().getZoomLensControl();
6869 }
70+ else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
71+ {
72+ this.focusingControl = interfaceProvider.getOlympusInterface().getFocusingControl();
73+ this.captureControl = interfaceProvider.getOlympusInterface().getCaptureControl();
74+ this.propertyProvider = interfaceProvider.getOlympusInterface().getCameraPropertyProvider();
75+ this.cameraInformation = interfaceProvider.getOlympusInterface().getCameraInformation();
76+ this.cameraConnection = interfaceProvider.getOlympusInterface().getOlyCameraConnection();
77+ this.zoomLensControl = interfaceProvider.getOlympusInterface().getZoomLensControl();
78+ }
79+
6980 this.dialogKicker = dialogKicker;
7081 }
7182
@@ -243,7 +254,7 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
243254 Log.v(TAG, "showFavoriteDialog()");
244255 try
245256 {
246- if (!interfaceProvider.useOlympusCamera())
257+ if (interfaceProvider.getCammeraConnectionMethod() != ICameraConnection.CameraConnectionMethod.OPC)
247258 {
248259 // OPCカメラでない場合には、「OPCカメラのみ有効です」表示をして画面遷移させない
249260 Toast.makeText(context, context.getText(R.string.only_opc_feature), Toast.LENGTH_SHORT).show();
--- a/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java
@@ -21,19 +21,19 @@ import android.widget.TextView;
2121 import net.osdn.gokigen.a01d.IChangeScene;
2222 import net.osdn.gokigen.a01d.R;
2323 import net.osdn.gokigen.a01d.camera.IInterfaceProvider;
24-import net.osdn.gokigen.a01d.camera.sony.wrapper.IDisplayInjector;
24+import net.osdn.gokigen.a01d.camera.IDisplayInjector;
2525 import net.osdn.gokigen.a01d.camera.olympus.myolycameraprops.LoadSaveCameraProperties;
2626 import net.osdn.gokigen.a01d.camera.olympus.myolycameraprops.LoadSaveMyCameraPropertyDialog;
2727 import net.osdn.gokigen.a01d.camera.IZoomLensControl;
2828 import net.osdn.gokigen.a01d.camera.ICameraInformation;
29-import net.osdn.gokigen.a01d.camera.olympus.wrapper.IFocusingModeNotify;
29+import net.osdn.gokigen.a01d.camera.IFocusingModeNotify;
3030 import net.osdn.gokigen.a01d.camera.ILiveViewControl;
3131 import net.osdn.gokigen.a01d.camera.ICameraConnection;
3232 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraProperty;
3333 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraPropertyProvider;
3434 import net.osdn.gokigen.a01d.liveview.liveviewlistener.ILiveViewListener;
3535 import net.osdn.gokigen.a01d.liveview.liveviewlistener.OlympusCameraLiveViewListenerImpl;
36-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
36+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
3737
3838 /**
3939 * 撮影用ライブビュー画面
@@ -155,13 +155,13 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
155155 manualFocus = view.findViewById(R.id.focusing_button);
156156 changeLiveViewScale = view.findViewById(R.id.live_view_scale_button);
157157
158- if (interfaceProvider.useOlympusCamera())
158+ if (interfaceProvider.getCammeraConnectionMethod() == ICameraConnection.CameraConnectionMethod.OPC)
159159 {
160160 view.findViewById(R.id.show_favorite_settings_button).setOnClickListener(onClickTouchListener);
161161 }
162162 else
163163 {
164- // お気に入りボタン(とMFボタン)は、SONYモードのときには表示しない
164+ // お気に入りボタン(とMFボタン)は、SONYモード, RICOH GR2モードのときには表示しない
165165 final View favoriteButton = view.findViewById(R.id.show_favorite_settings_button);
166166 final View propertyButton = view.findViewById(R.id.camera_property_settings_button);
167167 if ((favoriteButton != null)&&(manualFocus != null))
@@ -225,30 +225,41 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
225225 Log.v(TAG, "prepare()");
226226
227227 IDisplayInjector interfaceInjector;
228- if (interfaceProvider.useOlympusCamera())
228+ ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
229+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2)
229230 {
230- interfaceInjector = interfaceProvider.getOlympusInterface().getDisplayInjector();
231+ interfaceInjector = interfaceProvider.getRicohGr2Infterface().getDisplayInjector();
231232 }
232- else
233+ else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY)
233234 {
234235 interfaceInjector = interfaceProvider.getSonyInterface().getDisplayInjector();
235236 }
237+ else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
238+ {
239+ interfaceInjector = interfaceProvider.getOlympusInterface().getDisplayInjector();
240+ }
236241 this.changeScene = sceneSelector;
237242 this.interfaceProvider = interfaceProvider;
238243 this.interfaceInjector = interfaceInjector;
239244
240- if (interfaceProvider.useOlympusCamera())
245+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2)
241246 {
242- this.liveViewControl = interfaceProvider.getOlympusInterface().getLiveViewControl();
243- this.zoomLensControl = interfaceProvider.getOlympusInterface().getZoomLensControl();
244- this.cameraInformation = interfaceProvider.getOlympusInterface().getCameraInformation();
247+ this.liveViewControl = interfaceProvider.getRicohGr2Infterface().getLiveViewControl();
248+ this.zoomLensControl = interfaceProvider.getRicohGr2Infterface().getZoomLensControl();
249+ this.cameraInformation = interfaceProvider.getRicohGr2Infterface().getCameraInformation();
245250 }
246- else
251+ else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY)
247252 {
248253 this.liveViewControl = interfaceProvider.getSonyInterface().getSonyLiveViewControl();
249254 this.zoomLensControl = interfaceProvider.getSonyInterface().getZoomLensControl();
250255 this.cameraInformation = interfaceProvider.getSonyInterface().getCameraInformation();
251256 }
257+ else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
258+ {
259+ this.liveViewControl = interfaceProvider.getOlympusInterface().getLiveViewControl();
260+ this.zoomLensControl = interfaceProvider.getOlympusInterface().getZoomLensControl();
261+ this.cameraInformation = interfaceProvider.getOlympusInterface().getCameraInformation();
262+ }
252263 }
253264
254265 /**
@@ -496,9 +507,11 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
496507 @Override
497508 public void startLiveView()
498509 {
510+ ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
511+
499512 if (liveViewControl == null)
500513 {
501- if (interfaceProvider.useOlympusCamera())
514+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
502515 {
503516 Log.v(TAG, "startLiveView() : liveViewControl is null.");
504517 return;
@@ -519,14 +532,18 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
519532 liveViewControl.changeLiveViewSize(preferences.getString(IPreferencePropertyAccessor.LIVE_VIEW_QUALITY, IPreferencePropertyAccessor.LIVE_VIEW_QUALITY_DEFAULT_VALUE));
520533 }
521534 ILiveViewListener lvListener;
522- if (interfaceProvider.useOlympusCamera())
535+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2)
523536 {
524- interfaceProvider.getOlympusLiveViewListener().setOlympusLiveViewListener(liveViewListener);
525- lvListener = liveViewListener;
537+ lvListener = interfaceProvider.getRicohGr2Infterface().getLiveViewListener();
526538 }
527- else
539+ else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY)
528540 {
529- lvListener = interfaceProvider.getSonyInterface().getSonyLiveViewListener();
541+ lvListener = interfaceProvider.getSonyInterface().getLiveViewListener();
542+ }
543+ else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
544+ {
545+ interfaceProvider.getOlympusLiveViewListener().setOlympusLiveViewListener(liveViewListener);
546+ lvListener = liveViewListener;
530547 }
531548 lvListener.setCameraLiveImageView(imageView);
532549 liveViewControl.startLiveView();
@@ -557,8 +574,11 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
557574 zoomLensControl.moveInitialZoomPosition();
558575 }
559576
560- // 測光モードをスポットに切り替える
561- setAEtoSpot();
577+ // 測光モードをスポットに切り替える (OPCのみ)
578+ if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
579+ {
580+ setAEtoSpot();
581+ }
562582
563583 // ライブビューの倍率設定
564584 updateLiveViewScale(false);
--- a/app/src/main/java/net/osdn/gokigen/a01d/liveview/liveviewlistener/SonyCameraLiveViewListenerImpl.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/liveview/liveviewlistener/CameraLiveViewListenerImpl.java
@@ -1,20 +1,17 @@
11 package net.osdn.gokigen.a01d.liveview.liveviewlistener;
22
3-import android.util.Log;
4-
5-import net.osdn.gokigen.a01d.camera.sony.wrapper.ISonyCameraLiveViewListener;
3+import net.osdn.gokigen.a01d.camera.ICameraLiveViewListener;
64
75 import java.util.Map;
86
9-public class SonyCameraLiveViewListenerImpl implements ILiveViewListener, ISonyCameraLiveViewListener
7+public class CameraLiveViewListenerImpl implements ILiveViewListener, ICameraLiveViewListener
108 {
11- private final String TAG = toString();
129 private IImageDataReceiver imageView = null;
1310
1411 /**
1512 * コンストラクタ
1613 */
17- public SonyCameraLiveViewListenerImpl()
14+ public CameraLiveViewListenerImpl()
1815 {
1916
2017 }
@@ -38,7 +35,6 @@ public class SonyCameraLiveViewListenerImpl implements ILiveViewListener, ISonyC
3835 {
3936 if (imageView != null)
4037 {
41- //Log.v(TAG, "onUpdateLiveView() " + data.length);
4238 imageView.setImageData(data, metadata);
4339 }
4440 }
--- a/app/src/main/java/net/osdn/gokigen/a01d/preference/olympus/IPreferencePropertyAccessor.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/preference/IPreferencePropertyAccessor.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.a01d.preference.olympus;
1+package net.osdn.gokigen.a01d.preference;
22
33 /**
44 *
--- a/app/src/main/java/net/osdn/gokigen/a01d/preference/olympus/PreferenceFragment.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/preference/olympus/PreferenceFragment.java
@@ -24,6 +24,7 @@ import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraProperty;
2424 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraPropertyProvider;
2525 import net.osdn.gokigen.a01d.camera.olympus.operation.CameraPowerOff;
2626 import net.osdn.gokigen.a01d.logcat.LogCatViewer;
27+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
2728
2829 import java.util.HashMap;
2930 import java.util.Locale;
--- a/app/src/main/java/net/osdn/gokigen/a01d/preference/olympus/PreferenceSynchronizer.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/preference/olympus/PreferenceSynchronizer.java
@@ -6,6 +6,7 @@ import android.util.Log;
66 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraProperty;
77 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.IOlyCameraPropertyProvider;
88 import net.osdn.gokigen.a01d.camera.olympus.wrapper.property.CameraPropertyUtilities;
9+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
910
1011 class PreferenceSynchronizer implements Runnable
1112 {
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/preference/ricohgr2/RicohGr2PreferenceFragment.java
@@ -0,0 +1,310 @@
1+package net.osdn.gokigen.a01d.preference.ricohgr2;
2+
3+
4+import android.content.Context;
5+import android.content.SharedPreferences;
6+import android.os.Bundle;
7+import android.support.annotation.NonNull;
8+import android.support.v4.app.FragmentActivity;
9+import android.support.v7.app.AppCompatActivity;
10+import android.support.v7.preference.CheckBoxPreference;
11+import android.support.v7.preference.ListPreference;
12+import android.support.v7.preference.Preference;
13+import android.support.v7.preference.PreferenceFragmentCompat;
14+import android.support.v7.preference.PreferenceManager;
15+import android.util.Log;
16+
17+import net.osdn.gokigen.a01d.IChangeScene;
18+import net.osdn.gokigen.a01d.R;
19+import net.osdn.gokigen.a01d.camera.ricohgr2.operation.CameraPowerOffRicohGr2;
20+import net.osdn.gokigen.a01d.logcat.LogCatViewer;
21+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
22+
23+import java.util.Map;
24+
25+public class RicohGr2PreferenceFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener
26+{
27+ private final String TAG = toString();
28+ private SharedPreferences preferences = null;
29+ private CameraPowerOffRicohGr2 powerOffController = null;
30+ private LogCatViewer logCatViewer = null;
31+
32+ /**
33+ *
34+ *
35+ */
36+ public static RicohGr2PreferenceFragment newInstance(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
37+ {
38+ RicohGr2PreferenceFragment instance = new RicohGr2PreferenceFragment();
39+ instance.prepare(context, changeScene);
40+
41+ // パラメータはBundleにまとめておく
42+ Bundle arguments = new Bundle();
43+ //arguments.putString("title", title);
44+ //arguments.putString("message", message);
45+ instance.setArguments(arguments);
46+
47+ return (instance);
48+ }
49+
50+ /**
51+ *
52+ *
53+ */
54+ private void prepare(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
55+ {
56+ try
57+ {
58+ powerOffController = new CameraPowerOffRicohGr2(context, changeScene);
59+ powerOffController.prepare();
60+
61+ logCatViewer = new LogCatViewer(changeScene);
62+ logCatViewer.prepare();
63+ }
64+ catch (Exception e)
65+ {
66+ e.printStackTrace();
67+ }
68+ }
69+
70+ /**
71+ *
72+ *
73+ */
74+ @Override
75+ public void onAttach(Context activity)
76+ {
77+ super.onAttach(activity);
78+ Log.v(TAG, "onAttach()");
79+
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.AUTO_CONNECT_TO_CAMERA)) {
108+ editor.putBoolean(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
109+ }
110+ if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW)) {
111+ editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
112+ }
113+ if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
114+ editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
115+ }
116+ editor.apply();
117+ }
118+ catch (Exception e)
119+ {
120+ e.printStackTrace();
121+ }
122+ }
123+
124+ /**
125+ *
126+ *
127+ */
128+ @Override
129+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
130+ {
131+ Log.v(TAG, "onSharedPreferenceChanged() : " + key);
132+ boolean value;
133+ if (key != null)
134+ {
135+ switch (key)
136+ {
137+ case IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA:
138+ value = preferences.getBoolean(key, true);
139+ Log.v(TAG, " " + key + " , " + value);
140+ break;
141+
142+ case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
143+ value = preferences.getBoolean(key, true);
144+ Log.v(TAG, " " + key + " , " + value);
145+ break;
146+
147+ default:
148+ String strValue = preferences.getString(key, "");
149+ setListPreference(key, key, strValue);
150+ break;
151+ }
152+ }
153+ }
154+
155+ /**
156+ *
157+ *
158+ */
159+ @Override
160+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
161+ {
162+ Log.v(TAG, "onCreatePreferences()");
163+ try
164+ {
165+ //super.onCreate(savedInstanceState);
166+ addPreferencesFromResource(R.xml.preferences_ricoh_gr2);
167+
168+ ListPreference connectionMethod = (ListPreference) findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
169+ connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
170+ @Override
171+ public boolean onPreferenceChange(Preference preference, Object newValue) {
172+ preference.setSummary(newValue + " ");
173+ return (true);
174+ }
175+ });
176+ connectionMethod.setSummary(connectionMethod.getValue() + " ");
177+
178+ findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
179+ findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
180+ }
181+ catch (Exception e)
182+ {
183+ e.printStackTrace();
184+ }
185+ }
186+
187+ /**
188+ *
189+ *
190+ */
191+ @Override
192+ public void onResume()
193+ {
194+ super.onResume();
195+ Log.v(TAG, "onResume() Start");
196+
197+ try
198+ {
199+ synchronizedProperty();
200+ }
201+ catch (Exception e)
202+ {
203+ e.printStackTrace();
204+ }
205+
206+ Log.v(TAG, "onResume() End");
207+
208+ }
209+
210+ /**
211+ *
212+ *
213+ */
214+ @Override
215+ public void onPause()
216+ {
217+ super.onPause();
218+ Log.v(TAG, "onPause() Start");
219+
220+ try
221+ {
222+ // Preference変更のリスナを解除
223+ preferences.unregisterOnSharedPreferenceChangeListener(this);
224+ }
225+ catch (Exception e)
226+ {
227+ e.printStackTrace();
228+ }
229+
230+ Log.v(TAG, "onPause() End");
231+ }
232+
233+ /**
234+ * ListPreference の表示データを設定
235+ *
236+ * @param pref_key Preference(表示)のキー
237+ * @param key Preference(データ)のキー
238+ * @param defaultValue Preferenceのデフォルト値
239+ */
240+ private void setListPreference(String pref_key, String key, String defaultValue)
241+ {
242+ try
243+ {
244+ ListPreference pref;
245+ pref = (ListPreference) findPreference(pref_key);
246+ String value = preferences.getString(key, defaultValue);
247+ if (pref != null)
248+ {
249+ pref.setValue(value);
250+ pref.setSummary(value);
251+ }
252+ }
253+ catch (Exception e)
254+ {
255+ e.printStackTrace();
256+ }
257+ }
258+
259+ /**
260+ * BooleanPreference の表示データを設定
261+ *
262+ * @param pref_key Preference(表示)のキー
263+ * @param key Preference(データ)のキー
264+ * @param defaultValue Preferenceのデフォルト値
265+ */
266+ private void setBooleanPreference(String pref_key, String key, boolean defaultValue)
267+ {
268+ try
269+ {
270+ CheckBoxPreference pref = (CheckBoxPreference) findPreference(pref_key);
271+ if (pref != null) {
272+ boolean value = preferences.getBoolean(key, defaultValue);
273+ pref.setChecked(value);
274+ }
275+ }
276+ catch (Exception e)
277+ {
278+ e.printStackTrace();
279+ }
280+ }
281+
282+ /**
283+ *
284+ *
285+ */
286+ private void synchronizedProperty()
287+ {
288+ final FragmentActivity activity = getActivity();
289+ final boolean defaultValue = true;
290+ if (activity != null)
291+ {
292+ activity.runOnUiThread(new Runnable() {
293+ @Override
294+ public void run() {
295+ try
296+ {
297+ // Preferenceの画面に反映させる
298+ setBooleanPreference(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, defaultValue);
299+ setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, defaultValue);
300+ }
301+ catch (Exception e)
302+ {
303+ e.printStackTrace();
304+ }
305+ }
306+ });
307+ }
308+ }
309+
310+}
--- a/app/src/main/java/net/osdn/gokigen/a01d/preference/sony/SonyPreferenceFragment.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/preference/sony/SonyPreferenceFragment.java
@@ -18,7 +18,7 @@ import net.osdn.gokigen.a01d.R;
1818 import net.osdn.gokigen.a01d.camera.sony.cameraproperty.SonyCameraApiListViewer;
1919 import net.osdn.gokigen.a01d.camera.sony.operation.CameraPowerOffSony;
2020 import net.osdn.gokigen.a01d.logcat.LogCatViewer;
21-import net.osdn.gokigen.a01d.preference.olympus.IPreferencePropertyAccessor;
21+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
2222
2323 import java.util.Map;
2424
--- a/app/src/main/res/values-ja/arrays.xml
+++ b/app/src/main/res/values-ja/arrays.xml
@@ -101,11 +101,13 @@
101101 <string-array name="connection_method">
102102 <item >OPC (Olympus Air)</item>
103103 <item >Sony</item>
104+ <item>Ricoh GR II</item>
104105 </string-array>
105106
106107 <string-array name="connection_method_value">
107108 <item >OPC</item>
108109 <item >SONY</item>
110+ <item >RICOH_GR2</item>
109111 </string-array>
110112
111113 </resources>
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -102,11 +102,13 @@
102102 <string-array name="connection_method">
103103 <item >OPC (Olympus Air)</item>
104104 <item >Sony</item>
105+ <item>Ricoh GR II</item>
105106 </string-array>
106107
107108 <string-array name="connection_method_value">
108109 <item >OPC</item>
109110 <item >SONY</item>
111+ <item >RICOH_GR2</item>
110112 </string-array>
111113
112114 </resources>
--- /dev/null
+++ b/app/src/main/res/xml/preferences_ricoh_gr2.xml
@@ -0,0 +1,65 @@
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+ <PreferenceScreen
7+ android:key="exit_application"
8+ android:icon="@drawable/ic_power_settings_new_black_24dp"
9+ android:title="@string/pref_exit_power_off" />
10+
11+ <ListPreference
12+ android:title="@string/pref_connection_method"
13+ android:entryValues="@array/connection_method_value"
14+ android:entries="@array/connection_method"
15+ android:key="connection_method"
16+ android:defaultValue="OPC"/>
17+
18+ </PreferenceCategory>
19+
20+ <PreferenceCategory
21+ android:title="@string/pref_cat_camera">
22+
23+ <CheckBoxPreference
24+ android:key="capture_both_camera_and_live_view"
25+ android:title="@string/pref_capture_both_camera_and_live_view" />
26+
27+ </PreferenceCategory>
28+
29+ <PreferenceCategory
30+ android:title="@string/pref_cat_initialize">
31+
32+ <CheckBoxPreference
33+ android:key="auto_connect_to_camera"
34+ android:title="@string/pref_auto_connect_camera"
35+ android:summary="@string/pref_summary_auto_connect_camera" />
36+ </PreferenceCategory>
37+
38+ <PreferenceCategory
39+ android:title="@string/pref_cat_gokigen">
40+
41+ <Preference
42+ android:key="instruction_link"
43+ android:title="@string/pref_instruction_manual"
44+ android:summary="https://osdn.net/projects/gokigen/wiki/A01d"
45+ android:selectable="true">
46+ <intent android:action="android.intent.action.VIEW"
47+ android:data="https://osdn.net/projects/gokigen/wiki/A01d" />
48+ </Preference>
49+
50+ <Preference
51+ android:key="privacy_policy"
52+ android:title="@string/pref_privacy_policy"
53+ android:summary="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy"
54+ android:selectable="true">
55+ <intent android:action="android.intent.action.VIEW"
56+ android:data="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy" />
57+ </Preference>
58+
59+ <PreferenceScreen
60+ android:key="debug_info"
61+ android:title="@string/pref_degug_info"
62+ android:summary="@string/pref_summary_debug_info" />
63+
64+ </PreferenceCategory>
65+</PreferenceScreen>
Afficher sur ancien navigateur de dépôt.