• R/O
  • HTTP
  • SSH
  • HTTPS

BLEControl: コミット

BLE通信を行うためのアプリ。


コミットメタ情報

リビジョン08a3cedfaad883ae58c31c7c43c28863990109bc (tree)
日時2020-03-29 22:25:20
作者MRSa <mrsa@myad...>
コミッターMRSa

ログメッセージ

EEGの接続ロジックを入れる準備。

変更サマリ

差分

--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/BleConnectionApi18.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/BleConnectionApi18.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 import android.bluetooth.BluetoothGatt;
44 import android.bluetooth.BluetoothGattCallback;
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/CameraBleEntryListDialog.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/CameraBleEntryListDialog.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 import android.app.Dialog;
44 import android.content.SharedPreferences;
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/CameraBleEntryListFragment.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/CameraBleEntryListFragment.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 import android.content.SharedPreferences;
44 import android.os.Bundle;
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/CameraBleSetArrayAdapter.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/CameraBleSetArrayAdapter.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 import android.content.Context;
44 import android.util.Log;
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/CameraBleSetArrayItem.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/CameraBleSetArrayItem.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 class CameraBleSetArrayItem
44 {
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/ICameraBleProperty.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/ICameraBleProperty.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 /**
44 * Bluetooth のプロパティにアクセスするインタフェース
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/ICameraPowerOn.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/ICameraPowerOn.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 public interface ICameraPowerOn
44 {
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/ICameraSetDialogDismiss.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/ICameraSetDialogDismiss.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33
44 public interface ICameraSetDialogDismiss
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/ITextDataUpdater.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/ITextDataUpdater.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 public interface ITextDataUpdater
44 {
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/OlyCameraPowerOnSelector.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/OlyCameraPowerOnSelector.java
@@ -1,16 +1,8 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 import android.app.Activity;
4-import android.content.ActivityNotFoundException;
5-import android.content.SharedPreferences;
6-import android.preference.Preference;
7-import android.preference.PreferenceManager;
8-import android.util.Log;
94
105 import androidx.annotation.NonNull;
11-import androidx.fragment.app.FragmentActivity;
12-
13-import net.osdn.gokigen.blecontrol.lib.ble.R;
146
157 /**
168 * Olympus AIR の Bluetooth設定を記録する
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/PowerOnCamera.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/PowerOnCamera.java
@@ -1,10 +1,8 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect;
22
33 import android.app.Activity;
44 import android.bluetooth.BluetoothAdapter;
55 import android.bluetooth.BluetoothDevice;
6-import android.bluetooth.BluetoothGatt;
7-import android.bluetooth.BluetoothGattCallback;
86 import android.bluetooth.BluetoothManager;
97 import android.content.Context;
108 import android.content.SharedPreferences;
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/eeg/MindWaveCommunication.java
@@ -0,0 +1,42 @@
1+package net.osdn.gokigen.blecontrol.lib.ble.connect.eeg;
2+
3+import android.util.Log;
4+
5+import androidx.annotation.NonNull;
6+import androidx.fragment.app.FragmentActivity;
7+
8+import net.osdn.gokigen.blecontrol.lib.ble.R;
9+import net.osdn.gokigen.blecontrol.lib.ble.connect.ITextDataUpdater;
10+
11+public class MindWaveCommunication
12+{
13+ private final String TAG = toString();
14+ private final FragmentActivity context;
15+ private final ITextDataUpdater dataUpdater;
16+
17+ public MindWaveCommunication(@NonNull FragmentActivity context, @NonNull ITextDataUpdater dataUpdater)
18+ {
19+ this.context = context;
20+ this.dataUpdater = dataUpdater;
21+ }
22+
23+ public void connect(@NonNull String deviceName)
24+ {
25+ Log.v(TAG, " BrainWaveMobileCommunicator::connect() : " + deviceName);
26+ setText(context.getString(R.string.start_query) + " '" + deviceName + "' ");
27+
28+ }
29+
30+
31+
32+ private void setText(@NonNull final String message)
33+ {
34+ dataUpdater.setText(message);
35+ }
36+
37+ private void addText(@NonNull final String message)
38+ {
39+ dataUpdater.addText(message);
40+ }
41+
42+}
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/fv100/FV100BleDeviceConnector.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/fv100/FV100BleDeviceConnector.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection.fv100;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect.fv100;
22
33 import android.bluetooth.BluetoothAdapter;
44 import android.bluetooth.BluetoothDevice;
@@ -12,7 +12,7 @@ import androidx.annotation.RequiresApi;
1212 import androidx.fragment.app.FragmentActivity;
1313
1414 import net.osdn.gokigen.blecontrol.lib.ble.R;
15-import net.osdn.gokigen.blecontrol.lib.ble.connection.ITextDataUpdater;
15+import net.osdn.gokigen.blecontrol.lib.ble.connect.ITextDataUpdater;
1616 import net.osdn.gokigen.blecontrol.lib.ui.SnackBarMessage;
1717
1818 public class FV100BleDeviceConnector implements FV100Finder.BleScanResult
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/fv100/FV100Communicator.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/fv100/FV100Communicator.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection.fv100;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect.fv100;
22
33 import android.bluetooth.BluetoothDevice;
44 import android.bluetooth.BluetoothGatt;
@@ -16,7 +16,7 @@ import androidx.annotation.RequiresApi;
1616 import androidx.fragment.app.FragmentActivity;
1717
1818 import net.osdn.gokigen.blecontrol.lib.ble.R;
19-import net.osdn.gokigen.blecontrol.lib.ble.connection.ITextDataUpdater;
19+import net.osdn.gokigen.blecontrol.lib.ble.connect.ITextDataUpdater;
2020 import net.osdn.gokigen.blecontrol.lib.ui.SnackBarMessage;
2121 import net.osdn.gokigen.blecontrol.lib.wifi.WifiConnector;
2222
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/fv100/FV100Finder.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/fv100/FV100Finder.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection.fv100;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect.fv100;
22
33 import android.bluetooth.BluetoothAdapter;
44 import android.bluetooth.BluetoothDevice;
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/fv100/FV100ObjectPaser.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/fv100/FV100ObjectPaser.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection.fv100;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect.fv100;
22
33 import android.util.Log;
44
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connection/fv100/FV100SendMessageProvider.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ble/connect/fv100/FV100SendMessageProvider.java
@@ -1,4 +1,4 @@
1-package net.osdn.gokigen.blecontrol.lib.ble.connection.fv100;
1+package net.osdn.gokigen.blecontrol.lib.ble.connect.fv100;
22
33 import android.util.Log;
44
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ui/brainwave/BrainwaveConnection.java
@@ -0,0 +1,121 @@
1+package net.osdn.gokigen.blecontrol.lib.ui.brainwave;
2+
3+import android.util.Log;
4+import android.view.View;
5+import android.widget.ImageButton;
6+
7+import androidx.annotation.NonNull;
8+import androidx.annotation.Nullable;
9+import androidx.fragment.app.FragmentActivity;
10+
11+import net.osdn.gokigen.blecontrol.lib.ble.R;
12+import net.osdn.gokigen.blecontrol.lib.ble.connect.ITextDataUpdater;
13+import net.osdn.gokigen.blecontrol.lib.ble.connect.eeg.MindWaveCommunication;
14+
15+public class BrainwaveConnection implements View.OnClickListener, ITextDataUpdater
16+{
17+ private final String TAG = toString();
18+ private final FragmentActivity context;
19+ private final SelectDevice deviceSelection;
20+ private final BrainwaveMobileViewModel viewModel;
21+ private final MindWaveCommunication communicator;
22+
23+ BrainwaveConnection(@NonNull FragmentActivity context, @NonNull SelectDevice deviceSelection, @NonNull BrainwaveMobileViewModel viewModel)
24+ {
25+ this.context = context;
26+ this.deviceSelection = deviceSelection;
27+ this.viewModel = viewModel;
28+ this.communicator = new MindWaveCommunication(context, this);
29+ }
30+
31+ @Override
32+ public void onClick(View v)
33+ {
34+ int id = v.getId();
35+ switch (id)
36+ {
37+ case R.id.connect_to_eeg:
38+ connectToEEG(deviceSelection.getSelectedDeviceName());
39+ break;
40+
41+ default:
42+ Log.v(TAG, " onClick : " + id);
43+ break;
44+ }
45+ }
46+
47+ private void connectToEEG(@Nullable final String selectedDevice)
48+ {
49+ if (selectedDevice == null)
50+ {
51+ Log.v(TAG, " DEVICE is NULL.");
52+ return;
53+ }
54+ try
55+ {
56+ Log.v(TAG, " CONNECT TO EEG. : " + selectedDevice);
57+ Thread thread = new Thread(new Runnable() {
58+ @Override
59+ public void run() {
60+ communicator.connect(selectedDevice);
61+ }
62+ });
63+ thread.start();
64+ }
65+ catch (Exception e)
66+ {
67+ e.printStackTrace();
68+ }
69+ }
70+
71+ @Override
72+ public void setText(final String data)
73+ {
74+ context.runOnUiThread(new Runnable() {
75+ @Override
76+ public void run() {
77+ viewModel.setText(data);
78+ }
79+ });
80+ }
81+
82+ @Override
83+ public void addText(final String data)
84+ {
85+ context.runOnUiThread(new Runnable() {
86+ @Override
87+ public void run() {
88+ viewModel.addText(data);
89+ }
90+ });
91+ }
92+
93+ @Override
94+ public void enableOperation(final boolean isEnable)
95+ {
96+ try
97+ {
98+ context.runOnUiThread(new Runnable() {
99+ @Override
100+ public void run() {
101+ final ImageButton dummyButton = context.findViewById(R.id.dummy_button1);
102+ if (dummyButton != null)
103+ {
104+ dummyButton.setEnabled(isEnable);
105+ dummyButton.setVisibility((isEnable? View.INVISIBLE : View.INVISIBLE));
106+ }
107+ //Log.v(TAG, " >> ITextDataUpdater::enableOperation() : " + isEnable);
108+ }
109+ });
110+ }
111+ catch (Exception e)
112+ {
113+ e.printStackTrace();
114+ }
115+ }
116+
117+ interface SelectDevice
118+ {
119+ String getSelectedDeviceName();
120+ }
121+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ui/brainwave/BrainwaveMobileFragment.java
@@ -0,0 +1,127 @@
1+package net.osdn.gokigen.blecontrol.lib.ui.brainwave;
2+
3+import android.content.Context;
4+import android.os.Bundle;
5+import android.util.Log;
6+import android.view.LayoutInflater;
7+import android.view.View;
8+import android.view.ViewGroup;
9+import android.widget.AdapterView;
10+import android.widget.ArrayAdapter;
11+import android.widget.Button;
12+import android.widget.Spinner;
13+import android.widget.TextView;
14+
15+import androidx.annotation.Nullable;
16+import androidx.annotation.NonNull;
17+import androidx.fragment.app.Fragment;
18+import androidx.fragment.app.FragmentActivity;
19+import androidx.lifecycle.Observer;
20+import androidx.lifecycle.ViewModelProviders;
21+
22+import net.osdn.gokigen.blecontrol.lib.ble.MyBleAdapter;
23+import net.osdn.gokigen.blecontrol.lib.ble.R;
24+
25+import java.util.List;
26+
27+public class BrainwaveMobileFragment extends Fragment implements BrainwaveConnection.SelectDevice
28+{
29+ private final String TAG = toString();
30+ private List<String> bondedDeviceList = null;
31+ private int selectedDevicePosition = 0;
32+
33+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
34+ {
35+ final BrainwaveMobileViewModel brainwaveViewModel = ViewModelProviders.of(this).get(BrainwaveMobileViewModel.class);
36+ View root = inflater.inflate(R.layout.fragment_brainwave, container, false);
37+ final TextView textView = root.findViewById(R.id.text_brainwave);
38+ brainwaveViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
39+ @Override
40+ public void onChanged(@Nullable String s) {
41+ textView.setText(s);
42+ }
43+ });
44+ try
45+ {
46+ FragmentActivity context = getActivity();
47+ if (context != null)
48+ {
49+ // Bonded Device List
50+ prepareDeviceSelection(context, root);
51+
52+ // Connect Button
53+ final BrainwaveConnection eegConnection = new BrainwaveConnection(context, this, brainwaveViewModel);
54+ final Button queryButton = root.findViewById(R.id.connect_to_eeg);
55+ if (queryButton != null)
56+ {
57+ queryButton.setOnClickListener(eegConnection);
58+ }
59+ }
60+ }
61+ catch (Exception e)
62+ {
63+ e.printStackTrace();
64+ }
65+ return root;
66+ }
67+
68+ /**
69+ * 通信先デバイスの設定 (選択できるようにする)
70+ *
71+ * @param context context
72+ * @param root view root
73+ */
74+ private void prepareDeviceSelection(@NonNull Context context, @NonNull View root)
75+ {
76+ try
77+ {
78+ final Spinner selection_device = root.findViewById(R.id.spinner_selection_eeg_device);
79+ ArrayAdapter<String> adapter = new ArrayAdapter<>(context,android.R.layout.simple_spinner_item);
80+ bondedDeviceList = MyBleAdapter.getBondedDevices();
81+ adapter.addAll(bondedDeviceList);
82+ selection_device.setAdapter(adapter);
83+ selection_device.setSelection(selectedDevicePosition);
84+ selection_device.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
85+ {
86+ @Override
87+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
88+ {
89+ Log.v(TAG, "onItemSelected : " + position + " (" + id + ")");
90+ try
91+ {
92+ selectedDevicePosition = position;
93+ }
94+ catch (Exception e)
95+ {
96+ e.printStackTrace();
97+ }
98+ }
99+
100+ @Override
101+ public void onNothingSelected(AdapterView<?> parent)
102+ {
103+ Log.v(TAG, "onNothingSelected");
104+ }
105+ });
106+ }
107+ catch (Exception e)
108+ {
109+ e.printStackTrace();
110+ }
111+ }
112+
113+ @Override
114+ public String getSelectedDeviceName()
115+ {
116+ String deviceName = "";
117+ try
118+ {
119+ deviceName = bondedDeviceList.get(selectedDevicePosition);
120+ }
121+ catch (Exception e)
122+ {
123+ e.printStackTrace();
124+ }
125+ return (deviceName);
126+ }
127+}
--- /dev/null
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ui/brainwave/BrainwaveMobileViewModel.java
@@ -0,0 +1,32 @@
1+package net.osdn.gokigen.blecontrol.lib.ui.brainwave;
2+
3+import androidx.annotation.NonNull;
4+import androidx.lifecycle.LiveData;
5+import androidx.lifecycle.MutableLiveData;
6+import androidx.lifecycle.ViewModel;
7+
8+public class BrainwaveMobileViewModel extends ViewModel
9+{
10+
11+ private MutableLiveData<String> mText;
12+
13+ public BrainwaveMobileViewModel()
14+ {
15+ mText = new MutableLiveData<>();
16+ mText.setValue(" ");
17+ }
18+
19+ void setText(@NonNull String data)
20+ {
21+ mText.setValue(data);
22+ }
23+
24+ void addText(@NonNull String data)
25+ {
26+ mText.setValue(mText.getValue() + data);
27+ }
28+
29+ public LiveData<String> getText() {
30+ return mText;
31+ }
32+}
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ui/fv100/FV100DeviceQuery.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ui/fv100/FV100DeviceQuery.java
@@ -8,8 +8,8 @@ import androidx.annotation.NonNull;
88 import androidx.fragment.app.FragmentActivity;
99
1010 import net.osdn.gokigen.blecontrol.lib.ble.R;
11-import net.osdn.gokigen.blecontrol.lib.ble.connection.ITextDataUpdater;
12-import net.osdn.gokigen.blecontrol.lib.ble.connection.fv100.FV100BleDeviceConnector;
11+import net.osdn.gokigen.blecontrol.lib.ble.connect.ITextDataUpdater;
12+import net.osdn.gokigen.blecontrol.lib.ble.connect.fv100.FV100BleDeviceConnector;
1313
1414 public class FV100DeviceQuery implements View.OnClickListener, ITextDataUpdater, FV100PropertySetting.PropertySetter
1515 {
--- a/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ui/settings/bluetooth/ConnectViaBluetooth.java
+++ b/app/src/main/java/net/osdn/gokigen/blecontrol/lib/ui/settings/bluetooth/ConnectViaBluetooth.java
@@ -11,9 +11,9 @@ import androidx.annotation.NonNull;
1111 import androidx.fragment.app.Fragment;
1212
1313 import net.osdn.gokigen.blecontrol.lib.ble.R;
14-import net.osdn.gokigen.blecontrol.lib.ble.connection.ICameraBleProperty;
15-import net.osdn.gokigen.blecontrol.lib.ble.connection.ICameraPowerOn;
16-import net.osdn.gokigen.blecontrol.lib.ble.connection.PowerOnCamera;
14+import net.osdn.gokigen.blecontrol.lib.ble.connect.ICameraBleProperty;
15+import net.osdn.gokigen.blecontrol.lib.ble.connect.ICameraPowerOn;
16+import net.osdn.gokigen.blecontrol.lib.ble.connect.PowerOnCamera;
1717
1818 import java.text.DateFormat;
1919 import java.util.Date;
--- /dev/null
+++ b/app/src/main/res/drawable/ic_headset_mic_black_24dp.xml
@@ -0,0 +1,9 @@
1+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+ android:width="24dp"
3+ android:height="24dp"
4+ android:viewportWidth="24.0"
5+ android:viewportHeight="24.0">
6+ <path
7+ android:fillColor="#FF000000"
8+ android:pathData="M12,1c-4.97,0 -9,4.03 -9,9v7c0,1.66 1.34,3 3,3h3v-8H5v-2c0,-3.87 3.13,-7 7,-7s7,3.13 7,7v2h-4v8h4v1h-7v2h6c1.66,0 3,-1.34 3,-3V10c0,-4.97 -4.03,-9 -9,-9z"/>
9+</vector>
--- /dev/null
+++ b/app/src/main/res/layout/fragment_brainwave.xml
@@ -0,0 +1,99 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+ xmlns:app="http://schemas.android.com/apk/res-auto"
4+ android:orientation="vertical"
5+ android:layout_width="match_parent"
6+ android:layout_height="match_parent">
7+
8+ <TextView
9+ android:id="@+id/label_device"
10+ android:layout_width="match_parent"
11+ android:layout_height="wrap_content"
12+ android:layout_marginStart="8dp"
13+ android:layout_marginTop="8dp"
14+ android:layout_marginEnd="8dp"
15+ android:layout_gravity="start"
16+ android:textAlignment="textStart"
17+ android:text="@string/label_device"
18+ android:textSize="12sp" />
19+
20+ <Spinner
21+ android:id="@+id/spinner_selection_eeg_device"
22+ android:layout_width="fill_parent"
23+ android:layout_height="wrap_content"
24+ android:text="@string/blank"
25+ android:textSize="8pt"
26+ android:visibility="visible" />
27+
28+ <View
29+ android:layout_width="match_parent"
30+ android:layout_height="1dp"
31+ android:background="@android:color/darker_gray"/>
32+
33+ <View
34+ android:layout_width="match_parent"
35+ android:layout_height="6dp" />
36+
37+ <LinearLayout
38+ android:layout_width="fill_parent"
39+ android:layout_height="wrap_content"
40+ android:padding="6dp">
41+
42+ <Button
43+ android:layout_width="wrap_content"
44+ android:layout_height="wrap_content"
45+ android:tag="button"
46+ android:id="@+id/connect_to_eeg"
47+ android:text="@string/connect_device"
48+ android:layout_gravity="center"
49+ android:textSize="8pt" />
50+
51+ <ImageButton
52+ android:id="@+id/dummy_button0"
53+ android:layout_width="wrap_content"
54+ android:layout_height="match_parent"
55+ android:clickable="true"
56+ android:focusable="true"
57+ android:gravity="center"
58+ android:scaleType="fitCenter"
59+ android:contentDescription="@string/blank"
60+ app:srcCompat="@drawable/ic_replay_black_24dp"
61+ android:visibility="invisible" />
62+
63+ <ImageButton
64+ android:id="@+id/dummy_button1"
65+ android:layout_width="wrap_content"
66+ android:layout_height="match_parent"
67+ android:clickable="true"
68+ android:focusable="true"
69+ android:gravity="center"
70+ android:scaleType="fitCenter"
71+ android:contentDescription="@string/blank"
72+ app:srcCompat="@drawable/ic_texture_black_24dp"
73+ android:visibility="invisible" />
74+
75+ </LinearLayout>
76+
77+ <View
78+ android:layout_width="match_parent"
79+ android:layout_height="1dp"
80+ android:background="@android:color/darker_gray"/>
81+
82+ <View
83+ android:layout_width="match_parent"
84+ android:layout_height="6dp" />
85+
86+ <TextView
87+ android:id="@+id/text_brainwave"
88+ android:layout_width="match_parent"
89+ android:layout_height="wrap_content"
90+ android:layout_marginStart="8dp"
91+ android:layout_marginTop="8dp"
92+ android:layout_marginEnd="8dp"
93+ android:layout_gravity="start"
94+ android:textAlignment="textStart"
95+ android:textIsSelectable="true"
96+ android:scrollbars="vertical"
97+ android:textSize="20sp"
98+ />
99+</LinearLayout>
\ No newline at end of file
--- a/app/src/main/res/menu/activity_main_drawer.xml
+++ b/app/src/main/res/menu/activity_main_drawer.xml
@@ -24,6 +24,12 @@
2424 android:icon="@drawable/ic_menu_slideshow"
2525 android:title="@string/menu_slideshow"
2626 android:visible="false" />
27+
28+ <item
29+ android:id="@+id/nav_brainwave"
30+ android:icon="@drawable/ic_headset_mic_black_24dp"
31+ android:title="@string/menu_eeg"
32+ android:visible="true" />
2733 </group>
2834
2935 <item android:title="@string/navigation_group_settings"
--- a/app/src/main/res/navigation/mobile_navigation.xml
+++ b/app/src/main/res/navigation/mobile_navigation.xml
@@ -18,10 +18,10 @@
1818 tools:layout="@layout/fragment_home" />
1919
2020 <fragment
21- android:id="@+id/nav_gallery"
22- android:name="net.osdn.gokigen.blecontrol.lib.ui.gallery.GalleryFragment"
23- android:label="@string/menu_gallery"
24- tools:layout="@layout/fragment_gallery" />
21+ android:id="@+id/nav_brainwave"
22+ android:name="net.osdn.gokigen.blecontrol.lib.ui.brainwave.BrainwaveMobileFragment"
23+ android:label="@string/menu_eeg"
24+ tools:layout="@layout/fragment_brainwave" />
2525
2626 <fragment
2727 android:id="@+id/nav_slideshow"
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -18,6 +18,7 @@
1818 <string name="menu_slideshow">Slideshow</string>
1919 <string name="menu_tool_settings">Tools</string>
2020 <string name="menu_settings_bluetooth">Bluetooth Settings</string>
21+ <string name="menu_eeg">Brainwave Mobile</string>
2122
2223 <string name="dialog_positive_execute">Execute</string>
2324 <string name="dialog_negative_cancel">Cancel</string>
@@ -57,4 +58,6 @@
5758 <string name="btn_ok">Set</string>
5859 <string name="btn_cancel">Cancel</string>
5960
61+ <string name="connect_device">Connect</string>
62+
6063 </resources>
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -18,6 +18,7 @@
1818 <string name="menu_slideshow">Slideshow</string>
1919 <string name="menu_tool_settings">Tools</string>
2020 <string name="menu_settings_bluetooth">Bluetooth Settings</string>
21+ <string name="menu_eeg">Brainwave Mobile</string>
2122
2223 <string name="dialog_positive_execute">Execute</string>
2324 <string name="dialog_negative_cancel">Cancel</string>
@@ -56,4 +57,6 @@
5657 <string name="btn_ok">Set</string>
5758 <string name="btn_cancel">Cancel</string>
5859
60+ <string name="connect_device">Connect</string>
61+
5962 </resources>
旧リポジトリブラウザで表示