• R/O
  • HTTP
  • SSH
  • HTTPS

A01d: Commit

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


Commit MetaInfo

Révision054b15a3d66276581277b6ea2df81505bb22e1c4 (tree)
l'heure2018-06-16 00:18:04
AuteurMRSa <mrsa@myad...>
CommiterMRSa

Message de Log

SONYのコマンド一覧を入れる準備まで。

Change Summary

Modification

--- a/app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
@@ -22,6 +22,7 @@ import net.osdn.gokigen.a01d.camera.olympus.cameraproperty.OlyCameraPropertyList
2222 import net.osdn.gokigen.a01d.camera.ICameraStatusReceiver;
2323 import net.osdn.gokigen.a01d.camera.ICameraConnection;
2424 import net.osdn.gokigen.a01d.camera.olympus.wrapper.connection.ble.ICameraPowerOn;
25+import net.osdn.gokigen.a01d.camera.sony.cameraproperty.SonyCameraPropertyListFragment;
2526 import net.osdn.gokigen.a01d.liveview.IStatusViewDrawer;
2627 import net.osdn.gokigen.a01d.liveview.LiveViewFragment;
2728 import net.osdn.gokigen.a01d.logcat.LogCatFragment;
@@ -41,6 +42,7 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
4142
4243 private PreferenceFragmentCompat preferenceFragment = null;
4344 private OlyCameraPropertyListFragment propertyListFragment = null;
45+ private SonyCameraPropertyListFragment propertyListFragmentSony = null;
4446 private LogCatFragment logCatFragment = null;
4547
4648 @Override
@@ -209,6 +211,25 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
209211 {
210212 // OPCカメラでない場合には、「OPCカメラのみ有効です」表示をして画面遷移させない
211213 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 = SonyCameraPropertyListFragment.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+ */
212233 }
213234 else
214235 {
@@ -220,9 +241,8 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
220241 {
221242 if (propertyListFragment == null)
222243 {
223- propertyListFragment = new OlyCameraPropertyListFragment();
244+ propertyListFragment = OlyCameraPropertyListFragment.newInstance(this, interfaceProvider.getOlympusInterface().getCameraPropertyProvider());
224245 }
225- propertyListFragment.setInterface(this, interfaceProvider.getOlympusInterface().getCameraPropertyProvider());
226246 FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
227247 transaction.replace(R.id.fragment1, propertyListFragment);
228248 // backstackに追加
--- a/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/cameraproperty/OlyCameraPropertyListFragment.java
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/olympus/cameraproperty/OlyCameraPropertyListFragment.java
@@ -4,6 +4,7 @@ import android.app.Activity;
44 import android.app.ProgressDialog;
55 import android.content.Context;
66 import android.os.Bundle;
7+import android.support.annotation.NonNull;
78 import android.support.v4.app.Fragment;
89 import android.support.v7.app.ActionBar;
910 import android.support.v7.app.AppCompatActivity;
@@ -36,9 +37,24 @@ public class OlyCameraPropertyListFragment extends Fragment implements CameraPro
3637 * カメラプロパティをやり取りするインタフェースを生成する
3738 *
3839 */
39- public void setInterface(Context context, IOlyCameraPropertyProvider propertyInterface)
40+ public static OlyCameraPropertyListFragment newInstance(@NonNull Context context, @NonNull IOlyCameraPropertyProvider propertyInterface)
4041 {
41- Log.v(TAG, "setInterface()");
42+ OlyCameraPropertyListFragment instance = new OlyCameraPropertyListFragment();
43+ instance.prepare(context, propertyInterface);
44+
45+ // パラメータはBundleにまとめておく
46+ Bundle arguments = new Bundle();
47+ //arguments.putString("title", title);
48+ //arguments.putString("message", message);
49+ instance.setArguments(arguments);
50+
51+ return (instance);
52+ }
53+
54+ private void prepare(@NonNull Context context, @NonNull IOlyCameraPropertyProvider propertyInterface)
55+ {
56+ Log.v(TAG, "prepare()");
57+
4258 this.propertyInterface = propertyInterface;
4359 if (propertyLoader == null)
4460 {
@@ -77,7 +93,7 @@ public class OlyCameraPropertyListFragment extends Fragment implements CameraPro
7793 *
7894 */
7995 @Override
80- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
96+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
8197 {
8298 Log.v(TAG, "onCreateView()");
8399
@@ -99,10 +115,12 @@ public class OlyCameraPropertyListFragment extends Fragment implements CameraPro
99115 public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
100116 {
101117 AppCompatActivity activity = (AppCompatActivity)getActivity();
102- ActionBar bar = activity.getSupportActionBar();
103- if (bar != null)
118+ if (activity != null)
104119 {
105- bar.setTitle(getString(R.string.app_name));
120+ ActionBar bar = activity.getSupportActionBar();
121+ if (bar != null) {
122+ bar.setTitle(getString(R.string.app_name));
123+ }
106124 }
107125 }
108126
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/a01d/camera/sony/cameraproperty/SonyCameraPropertyListFragment.java
@@ -0,0 +1,68 @@
1+package net.osdn.gokigen.a01d.camera.sony.cameraproperty;
2+
3+import android.content.Context;
4+import android.os.Bundle;
5+import android.support.annotation.NonNull;
6+import android.support.v4.app.Fragment;
7+import android.util.Log;
8+
9+import net.osdn.gokigen.a01d.camera.IInterfaceProvider;
10+
11+
12+public class SonyCameraPropertyListFragment extends Fragment
13+{
14+ private final String TAG = toString();
15+
16+
17+ /**
18+ * カメラプロパティをやり取りするインタフェースを生成する
19+ *
20+ */
21+ public static SonyCameraPropertyListFragment newInstance(@NonNull Context context, @NonNull IInterfaceProvider propertyInterface)
22+ {
23+ SonyCameraPropertyListFragment instance = new SonyCameraPropertyListFragment();
24+ instance.prepare(context, propertyInterface);
25+
26+ // パラメータはBundleにまとめておく
27+ Bundle arguments = new Bundle();
28+ //arguments.putString("title", title);
29+ //arguments.putString("message", message);
30+ instance.setArguments(arguments);
31+
32+ return (instance);
33+ }
34+
35+ /**
36+ *
37+ *
38+ */
39+ private void prepare(Context context, IInterfaceProvider propertyInterface)
40+ {
41+ Log.v(TAG, "prepare()");
42+ }
43+
44+ /**
45+ *
46+ *
47+ */
48+ @Override
49+ public void onCreate(Bundle savedInstanceState)
50+ {
51+ super.onCreate(savedInstanceState);
52+ Log.v(TAG, "onCreate()");
53+
54+ }
55+
56+ /**
57+ *
58+ *
59+ */
60+ @Override
61+ public void onAttach(Context context)
62+ {
63+ super.onAttach(context);
64+ Log.v(TAG, "onAttach()");
65+ }
66+
67+
68+}
Afficher sur ancien navigateur de dépôt.