Browse Source

新功能

chenzubin 2 months ago
parent
commit
51ee65b8ec

+ 2 - 0
app/build.gradle

@@ -60,4 +60,6 @@ dependencies {
60 60
     implementation 'androidx.appcompat:appcompat:1.4.1'
61 61
     implementation 'org.apache.commons:commons-lang3:3.12.0'
62 62
     implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
63
+    implementation 'androidx.appcompat:appcompat:1.4.0'
64
+    implementation 'com.github.sahooz:ImageMapView:1.0.1'
63 65
 }

+ 8 - 5
app/src/main/AndroidManifest.xml

@@ -24,18 +24,21 @@
24 24
         android:theme="@style/Theme.MainTheme"
25 25
         tools:targetApi="31">
26 26
         <activity
27
+            android:name=".VideoViewActivity"
28
+            android:exported="false" />
29
+        <activity
30
+            android:name=".QuestionActivity"
31
+            android:exported="false" />
32
+        <activity
27 33
             android:name=".GatherActivity"
28 34
             android:configChanges="orientation|keyboardHidden|screenSize"
29 35
             android:exported="true"
30 36
             android:label="@string/title_activity_gather"
31
-            android:theme="@style/Theme.MainTheme.Fullscreen" >
32
-
33
-        </activity>
37
+            android:theme="@style/Theme.MainTheme.Fullscreen"></activity>
34 38
         <activity
35 39
             android:name=".Video"
36 40
             android:exported="true"
37
-            android:screenOrientation="landscape">
38
-        </activity>
41
+            android:screenOrientation="landscape"></activity>
39 42
         <activity
40 43
             android:name=".MainActivity"
41 44
             android:exported="true">

+ 29 - 0
app/src/main/java/com/cfmlg/mlg/QuestionActivity.java

@@ -0,0 +1,29 @@
1
+package com.cfmlg.mlg;
2
+
3
+import androidx.appcompat.app.AppCompatActivity;
4
+import androidx.appcompat.widget.Toolbar;
5
+
6
+import android.graphics.Color;
7
+import android.os.Bundle;
8
+import android.view.View;
9
+
10
+public class QuestionActivity extends AppCompatActivity {
11
+
12
+    @Override
13
+    protected void onCreate(Bundle savedInstanceState) {
14
+        super.onCreate(savedInstanceState);
15
+        setContentView(R.layout.activity_question);
16
+
17
+        Toolbar toolbar = findViewById(R.id.toolbar);
18
+        toolbar.setNavigationIcon(R.drawable.back);
19
+        toolbar.setTitleTextColor(Color.WHITE);
20
+        toolbar.setTitleMargin(0, 0, 0, 0);
21
+
22
+        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
23
+            @Override
24
+            public void onClick(View v) {
25
+                onBackPressed();
26
+            }
27
+        });
28
+    }
29
+}

+ 96 - 53
app/src/main/java/com/cfmlg/mlg/Video.java

@@ -66,6 +66,7 @@ public class Video extends AppCompatActivity {
66 66
     final int countDownInterval = 3 * 1000; // 1分钟
67 67
     final Handler handler = new Handler();
68 68
     LinearLayout l1, l2;
69
+    RelativeLayout layoutMsg;
69 70
     Button bt1, bt2, bt3, bt4, bt5;
70 71
     String[] permissions = new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE, android.Manifest.permission.WRITE_EXTERNAL_STORAGE};
71 72
     List<String> mPermissionList = new ArrayList<>();
@@ -78,7 +79,7 @@ public class Video extends AppCompatActivity {
78 79
     private TextView countdownTextView;
79 80
     private int totalTime = 4;
80 81
     private RelativeLayout mainPage;
81
-    private TextView tvHistory;
82
+    private TextView tvHistory, tvQuestion;
82 83
     private TextView tvConnect;
83 84
     private ImageView imgConnect;
84 85
 
@@ -123,11 +124,13 @@ public class Video extends AppCompatActivity {
123 124
         setContentView(binding.getRoot());
124 125
         countdownTextView = findViewById(R.id.countdownTextView);
125 126
         tvConnect = findViewById(R.id.tvConnect);
127
+        tvQuestion = findViewById(R.id.tvQuestion);
126 128
         imgConnect = findViewById(R.id.imgConnect);
127 129
         mainPage = findViewById(R.id.mainPage);
128 130
         bt1 = findViewById(R.id.bt1);
129 131
         l1 = findViewById(R.id.l1);
130 132
         l2 = findViewById(R.id.l2);
133
+        layoutMsg = findViewById(R.id.layoutMsg);
131 134
         bt1  = findViewById(R.id.bt1);
132 135
         bt2  = findViewById(R.id.bt2);
133 136
         bt3  = findViewById(R.id.bt3);
@@ -139,18 +142,7 @@ public class Video extends AppCompatActivity {
139 142
         long initialDelay1 = 1;
140 143
         long period1 = 1;
141 144
         service.scheduleAtFixedRate(new Task1(), initialDelay1, period1, TimeUnit.SECONDS);
142
-        handler.postDelayed(new Runnable() {
143
-            @Override
144
-            public void run() {
145
-                totalTime--;
146
-                countdownTextView.setText(String.valueOf(totalTime));
147
-                if (totalTime > 0) {
148
-                    handler.postDelayed(this, 1000);
149
-                } else {
150
-                    // 倒计时结束,执行相应操作
151
-                }
152
-            }
153
-        }, 1000);
145
+
154 146
         new Thread(new Runnable() {
155 147
             @Override
156 148
             public void run() {
@@ -160,29 +152,44 @@ public class Video extends AppCompatActivity {
160 152
         binding.handleCap.setOnClickListener(new View.OnClickListener() {
161 153
             @Override
162 154
             public void onClick(View v) {
163
-                SoundPool soundPool = new SoundPool.Builder().setMaxStreams(1).build();
164
-                int soundId = soundPool.load(Video.this, R.raw.kuaimen, 1); // 加载音频资源
165
-                soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
155
+                handler.postDelayed(new Runnable() {
166 156
                     @Override
167
-                    public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
168
-                        soundPool.play(soundId, 1, 1, 1, 0, 1); // 播放音频
157
+                    public void run() {
158
+                        totalTime--;
159
+                        countdownTextView.setText(String.valueOf(totalTime));
160
+                        countdownTextView.setVisibility(View.VISIBLE);
161
+                        if (totalTime > 0) {
162
+                            handler.postDelayed(this, 1000);
163
+                        } else {
164
+                            totalTime = 4;
165
+                            countdownTextView.setVisibility(View.GONE);
166
+                            SoundPool soundPool = new SoundPool.Builder().setMaxStreams(1).build();
167
+                            int soundId = soundPool.load(Video.this, R.raw.kuaimen, 1); // 加载音频资源
168
+                            soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
169
+                                @Override
170
+                                public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
171
+                                    soundPool.play(soundId, 1, 1, 1, 0, 1); // 播放音频
172
+                                }
173
+                            });
174
+                            Bitmap bitmap = binding.mSurfaceview.getBitmap(1920, 1080);
175
+                            saveImageToGallery(getApplicationContext(), bitmap);
176
+                            try {
177
+                                File file = new File(getSdPath(), System.currentTimeMillis() + ".jpg");
178
+                                OutputStream outputStream = new FileOutputStream(file);
179
+
180
+                                bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
181
+
182
+                                outputStream.close();
183
+                                Toast.makeText(Video.this, "图片已保存到" + getSdPath() + "目录", Toast.LENGTH_SHORT).show();
184
+                            } catch (FileNotFoundException e) {
185
+                                throw new RuntimeException(e);
186
+                            } catch (IOException e) {
187
+                                throw new RuntimeException(e);
188
+                            }
189
+                        }
169 190
                     }
170
-                });
171
-                Bitmap bitmap = binding.mSurfaceview.getBitmap(1920, 1080);
172
-                saveImageToGallery(getApplicationContext(), bitmap);
173
-                try {
174
-                    File file = new File(getSdPath(), System.currentTimeMillis() + ".jpg");
175
-                    OutputStream outputStream = new FileOutputStream(file);
176
-
177
-                    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
178
-
179
-                    outputStream.close();
180
-                    Toast.makeText(Video.this, "图片已保存到" + getSdPath() + "目录", Toast.LENGTH_SHORT).show();
181
-                } catch (FileNotFoundException e) {
182
-                    throw new RuntimeException(e);
183
-                } catch (IOException e) {
184
-                    throw new RuntimeException(e);
185
-                }
191
+                }, 1000);
192
+
186 193
             }
187 194
         });
188 195
 
@@ -190,22 +197,27 @@ public class Video extends AppCompatActivity {
190 197
         binding.handlerecord.setOnClickListener(new View.OnClickListener() {
191 198
             @Override
192 199
             public void onClick(View v) {
193
-                //录像按钮
200
+                String path = getSdPath() + System.currentTimeMillis() + ".avi";
194 201
                 if (!recordFlag) {
195
-                    int i = JPGStartRecord(getSdPath() + System.currentTimeMillis() + ".avi");
202
+                    int i = JPGStartRecord(path);
196 203
                     if (i == 0) {
197 204
                         recordFlag = true;
198
-                        binding.handlerecord.setImageResource(R.drawable.ic_app_video_recording);
205
+//                        binding.handlerecord.setImageResource(R.drawable.ic_app_video_recording);
206
+                        binding.openDir.setImageResource(R.drawable.ic_app_compare_an);
199 207
                     }
200 208
 
201 209
                 } else {
202 210
                     recordFlag = false;
203 211
                     JPGStopRecord();
204 212
                     binding.handlerecord.setImageResource(R.drawable.ic_app_video);
213
+                    binding.openDir.setImageResource(R.drawable.ic_app_compare);
205 214
                     Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
206 215
                     Uri uri = Uri.fromFile(new File(getSdPath()));
207 216
                     intent.setData(uri);
208 217
                     getApplicationContext().sendBroadcast(intent);
218
+                    Intent intent2 = new Intent(Video.this, VideoViewActivity.class);
219
+                    intent2.putExtra("extra_data", path);
220
+                    startActivity(intent2);
209 221
                 }
210 222
             }
211 223
         });
@@ -217,6 +229,14 @@ public class Video extends AppCompatActivity {
217 229
             }
218 230
         });
219 231
 
232
+        binding.tvQuestion.setOnClickListener(new View.OnClickListener() {
233
+            @Override
234
+            public void onClick(View v) {
235
+                Intent intent = new Intent(Video.this, QuestionActivity.class);
236
+                startActivity(intent);
237
+            }
238
+        });
239
+
220 240
         bt1.setOnClickListener(new View.OnClickListener() {
221 241
             @Override
222 242
             public void onClick(View view) {
@@ -302,26 +322,44 @@ public class Video extends AppCompatActivity {
302 322
                 length = inputStream.read(bytes);
303 323
                 Log.e(TAG, "serverSocketInit: length = " + length + Arrays.toString(bytes));
304 324
                 //抓取一张图片
305
-                runOnUiThread(new Runnable() {
325
+
326
+                handler.postDelayed(new Runnable() {
306 327
                     @Override
307 328
                     public void run() {
308
-                        Bitmap bitmap = binding.mSurfaceview.getBitmap(1920, 1080);
309
-                        saveImageToGallery(getApplicationContext(), bitmap);
310
-                        try {
311
-                            File file = new File(getSdPath(), System.currentTimeMillis() + ".jpg");
312
-                            OutputStream outputStream = new FileOutputStream(file);
313
-
314
-                            bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
315
-
316
-                            outputStream.close();
317
-                            Toast.makeText(Video.this, "图片已保存到" + getSdPath() + "目录", Toast.LENGTH_SHORT).show();
318
-                        } catch (FileNotFoundException e) {
319
-                            throw new RuntimeException(e);
320
-                        } catch (IOException e) {
321
-                            throw new RuntimeException(e);
329
+                        totalTime--;
330
+                        countdownTextView.setText(String.valueOf(totalTime));
331
+                        countdownTextView.setVisibility(View.VISIBLE);
332
+                        if (totalTime > 0) {
333
+                            handler.postDelayed(this, 1000);
334
+                        } else {
335
+                            totalTime = 4;
336
+                            countdownTextView.setVisibility(View.GONE);
337
+                            SoundPool soundPool = new SoundPool.Builder().setMaxStreams(1).build();
338
+                            int soundId = soundPool.load(Video.this, R.raw.kuaimen, 1); // 加载音频资源
339
+                            soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
340
+                                @Override
341
+                                public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
342
+                                    soundPool.play(soundId, 1, 1, 1, 0, 1); // 播放音频
343
+                                }
344
+                            });
345
+                            Bitmap bitmap = binding.mSurfaceview.getBitmap(1920, 1080);
346
+                            saveImageToGallery(getApplicationContext(), bitmap);
347
+                            try {
348
+                                File file = new File(getSdPath(), System.currentTimeMillis() + ".jpg");
349
+                                OutputStream outputStream = new FileOutputStream(file);
350
+
351
+                                bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
352
+
353
+                                outputStream.close();
354
+                                Toast.makeText(Video.this, "图片已保存到" + getSdPath() + "目录", Toast.LENGTH_SHORT).show();
355
+                            } catch (FileNotFoundException e) {
356
+                                throw new RuntimeException(e);
357
+                            } catch (IOException e) {
358
+                                throw new RuntimeException(e);
359
+                            }
322 360
                         }
323 361
                     }
324
-                });
362
+                }, 1000);
325 363
 
326 364
 
327 365
                 inputStream.close();
@@ -495,7 +533,9 @@ public class Video extends AppCompatActivity {
495 533
                     @Override
496 534
                     public void run() {
497 535
                         tvConnect.setText("暂未与设备链接");
536
+                        tvConnect.setVisibility(View.GONE);
498 537
                         imgConnect.setImageResource(R.drawable.disconnect);
538
+                        imgConnect.setVisibility(View.GONE);
499 539
                         l2.setVisibility(View.VISIBLE);
500 540
                         l1.setVisibility(View.GONE);
501 541
                     }
@@ -508,6 +548,7 @@ public class Video extends AppCompatActivity {
508 548
                         imgConnect.setImageResource(R.drawable.right);
509 549
                         l1.setVisibility(View.VISIBLE);
510 550
                         l2.setVisibility(View.GONE);
551
+                        layoutMsg.setVisibility(View.GONE);
511 552
                     }
512 553
                 });
513 554
             } else {
@@ -515,7 +556,9 @@ public class Video extends AppCompatActivity {
515 556
                     @Override
516 557
                     public void run() {
517 558
                         tvConnect.setText("暂未与设备链接");
559
+                        tvConnect.setVisibility(View.GONE);
518 560
                         imgConnect.setImageResource(R.drawable.disconnect);
561
+                        imgConnect.setVisibility(View.GONE);
519 562
                         l2.setVisibility(View.VISIBLE);
520 563
                         l1.setVisibility(View.GONE);
521 564
                     }

+ 149 - 0
app/src/main/java/com/cfmlg/mlg/VideoViewActivity.java

@@ -0,0 +1,149 @@
1
+package com.cfmlg.mlg;
2
+
3
+import androidx.appcompat.app.AppCompatActivity;
4
+
5
+import android.app.Activity;
6
+import android.media.AudioManager;
7
+import android.media.MediaPlayer;
8
+import android.os.Bundle;
9
+import android.os.Environment;
10
+import android.util.Log;
11
+import android.view.SurfaceHolder;
12
+import android.view.SurfaceView;
13
+import android.view.View;
14
+import android.widget.Button;
15
+import android.widget.MediaController;
16
+import android.widget.SeekBar;
17
+import android.widget.Toast;
18
+import android.widget.VideoView;
19
+
20
+import java.io.File;
21
+import java.io.IOException;
22
+import java.util.Timer;
23
+import java.util.TimerTask;
24
+
25
+public class VideoViewActivity extends Activity {
26
+    private Button btn_start_video = null;
27
+    private Button btn_stop_video = null;
28
+    private SurfaceView surfaceView;
29
+    private SurfaceHolder surfaceHolder;
30
+
31
+    private MediaPlayer m = null;
32
+    private Timer mTimer;
33
+    private TimerTask mTimerTask;
34
+
35
+    private boolean isChanging=false;//互斥变量,防止定时器与SeekBar拖动时进度冲突
36
+    @Override
37
+    public void onCreate(Bundle savedInstanceState) {
38
+        super.onCreate(savedInstanceState);
39
+        setContentView(R.layout.activity_video_view);
40
+
41
+        //----------Media控件设置---------//
42
+        m=new MediaPlayer();
43
+
44
+        //播放结束之后弹出提示
45
+        m.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){
46
+            @Override
47
+            public void onCompletion(MediaPlayer arg0) {
48
+                Toast.makeText(VideoViewActivity.this, "结束", 1000).show();
49
+                m.release();
50
+            }
51
+        });
52
+
53
+        //----------定时器记录播放进度---------//
54
+        mTimer = new Timer();
55
+        mTimerTask = new TimerTask() {
56
+            @Override
57
+            public void run() {
58
+                if(isChanging==true)
59
+                    return;
60
+
61
+            }
62
+        };
63
+
64
+        mTimer.schedule(mTimerTask, 0, 10);
65
+
66
+
67
+        btn_start_video = (Button) this.findViewById(R.id.Button03);
68
+        btn_stop_video = (Button) this.findViewById(R.id.Button04);
69
+        btn_start_video.setOnClickListener(new ClickEvent());
70
+        btn_stop_video.setOnClickListener(new ClickEvent());
71
+        surfaceView = (SurfaceView) findViewById(R.id.SurfaceView01);
72
+        surfaceHolder = surfaceView.getHolder();
73
+        surfaceHolder.setFixedSize(100, 100);
74
+        surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
75
+    }
76
+    /*
77
+     * 按键事件处理
78
+     */
79
+    class ClickEvent implements View.OnClickListener{
80
+        @Override
81
+        public void onClick(View v) {
82
+            if(v==btn_start_video)
83
+            {
84
+                m.reset();//恢复到未初始化的状态
85
+                File file=new File(getSdPath());
86
+                File[] files = file.listFiles();
87
+
88
+                File lFile = null;
89
+                for (File f : files) {
90
+                    lFile = new File(f.getPath());
91
+                    Log.e("czb", f.getPath());
92
+                }
93
+                try {
94
+                    m.setDataSource(lFile.getPath());
95
+
96
+                } catch (IOException e) {
97
+                    throw new RuntimeException(e);
98
+                }
99
+                m.setAudioStreamType(AudioManager.STREAM_MUSIC);
100
+                m.setDisplay(surfaceHolder);
101
+
102
+                try {
103
+                    m.prepare();
104
+
105
+                } catch (IllegalArgumentException e) {
106
+                    // TODO Auto-generated catch block
107
+                    e.printStackTrace();
108
+                } catch (IllegalStateException e) {
109
+                    // TODO Auto-generated catch block
110
+                    e.printStackTrace();
111
+                } catch (IOException e) {
112
+                    // TODO Auto-generated catch block
113
+                    e.printStackTrace();
114
+                }
115
+                m.start();
116
+            }
117
+        }
118
+    }
119
+
120
+    private String getSdPath() {
121
+        boolean sdCardExist = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
122
+        if (sdCardExist) {
123
+            File externalStorageDirectory = Environment.getExternalStorageDirectory();
124
+            String sdpath = externalStorageDirectory + File.separator + Environment.DIRECTORY_PICTURES + File.separator + "dental" + File.separator;
125
+            return sdpath;
126
+        }
127
+        return null;
128
+    }
129
+    /*
130
+     * SeekBar进度改变事件
131
+     */
132
+    class SeekBarChangeEvent implements SeekBar.OnSeekBarChangeListener{
133
+        @Override
134
+        public void onProgressChanged(SeekBar seekBar, int progress,
135
+                                      boolean fromUser) {
136
+            // TODO Auto-generated method stub
137
+        }
138
+        @Override
139
+        public void onStartTrackingTouch(SeekBar seekBar) {
140
+            isChanging=true;
141
+        }
142
+
143
+        @Override
144
+        public void onStopTrackingTouch(SeekBar seekBar) {
145
+            m.seekTo(seekBar.getProgress());
146
+            isChanging=false;
147
+        }
148
+    }
149
+}

BIN
app/src/main/res/drawable/back.png


BIN
app/src/main/res/drawable/bt.png


BIN
app/src/main/res/drawable/fan.png


BIN
app/src/main/res/drawable/home1.png


BIN
app/src/main/res/drawable/home2.png


BIN
app/src/main/res/drawable/p1.png


BIN
app/src/main/res/drawable/p2.png


BIN
app/src/main/res/drawable/ya.png


+ 47 - 0
app/src/main/res/layout/activity_question.xml

@@ -0,0 +1,47 @@
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
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    tools:context=".QuestionActivity"
8
+    android:orientation="vertical">
9
+    <androidx.appcompat.widget.Toolbar
10
+        android:id="@+id/toolbar"
11
+        android:layout_width="match_parent"
12
+        android:layout_height="?android:attr/actionBarSize"
13
+        android:background="#455456"
14
+        android:gravity="center"
15
+        android:titleTextColor="@android:color/white" >
16
+        <TextView
17
+            android:layout_width="wrap_content"
18
+            android:layout_height="wrap_content"
19
+            android:layout_gravity="center"
20
+            android:textSize="20sp"
21
+            android:textColor="@color/white"
22
+            android:text="常见问题"/>
23
+    </androidx.appcompat.widget.Toolbar>
24
+
25
+    <TextView
26
+        android:layout_width="wrap_content"
27
+        android:layout_height="wrap_content"
28
+        app:layout_constraintTop_toBottomOf="@+id/toolbar"
29
+        android:layout_margin="5dp"
30
+        android:text="按照操作指引仍无法链接观察仪?"
31
+        android:textColor="@color/black"
32
+        android:textSize="20sp"
33
+        tools:layout_editor_absoluteX="16dp"
34
+        tools:layout_editor_absoluteY="91dp" />
35
+
36
+    <TextView
37
+        android:layout_width="wrap_content"
38
+        android:layout_height="wrap_content"
39
+        android:layout_margin="5dp"
40
+        android:layout_gravity="center"
41
+        android:text="1、检查观察仪器是否正常使用。\n结合《口腔观察仪使用说明书》检查观察仪是否开机状态,是否低电量。\n2、检查手机是否正常打开WiFi开关\n3、点击首页的“重新链接”。\n4、重启观察仪和手机设备。"
42
+        android:textColor="@color/black"
43
+        android:textSize="17sp"
44
+        tools:layout_editor_absoluteX="16dp"
45
+        tools:layout_editor_absoluteY="131dp" />
46
+
47
+</LinearLayout>

+ 166 - 5
app/src/main/res/layout/activity_video.xml

@@ -11,9 +11,28 @@
11 11
     <TextureView
12 12
         android:id="@+id/mSurfaceview"
13 13
         android:layout_width="match_parent"
14
-        android:layout_height="match_parent" />
15
-
14
+        android:layout_height="match_parent"
15
+        tools:layout_editor_absoluteX="16dp"
16
+        tools:layout_editor_absoluteY="0dp" />
16 17
 
18
+    <ImageButton
19
+        android:id="@+id/imageConnect"
20
+        android:layout_width="wrap_content"
21
+        android:layout_height="wrap_content"
22
+        android:layout_marginLeft="40dp"
23
+        android:layout_marginTop="20dp"
24
+        android:visibility="gone"
25
+        app:layout_constraintLeft_toLeftOf="parent"
26
+        app:layout_constraintTop_toTopOf="parent"
27
+        app:srcCompat="@drawable/fan" />
28
+    <com.xinyanruanjian.imagemapview.ImageMapView
29
+        android:id="@+id/imv"
30
+        android:layout_width="match_parent"
31
+        android:layout_height="match_parent"
32
+        android:src="@drawable/ya"
33
+        android:scaleType="fitCenter"
34
+        android:visibility="gone"
35
+        app:imageMap="@xml/map"/>
17 36
     <LinearLayout
18 37
         android:id="@+id/blakgrond"
19 38
         android:layout_width="wrap_content"
@@ -55,8 +74,8 @@
55 74
         android:layout_width="wrap_content"
56 75
         android:layout_height="wrap_content"
57 76
         android:text=""
58
-        android:textColor="@color/light_blue_600"
59
-        android:textSize="30sp"
77
+        android:textColor="#ff0000"
78
+        android:textSize="50sp"
60 79
         android:visibility="gone"
61 80
         app:layout_constraintBottom_toBottomOf="parent"
62 81
         app:layout_constraintEnd_toEndOf="parent"
@@ -77,13 +96,25 @@
77 96
             android:layout_width="wrap_content"
78 97
             android:layout_height="wrap_content"
79 98
             android:layout_alignParentLeft="true"
80
-            android:layout_marginTop="30dp"
99
+            android:layout_alignParentBottom="true"
100
+            android:layout_marginBottom="30dp"
81 101
             android:padding="10dp"
82 102
             android:rotation="270"
83 103
             android:text="历史记录"
84 104
             android:textColor="@color/light_blue_900" />
85 105
 
86 106
         <TextView
107
+            android:id="@+id/tvQuestion"
108
+            android:layout_width="wrap_content"
109
+            android:layout_height="wrap_content"
110
+            android:layout_alignParentLeft="true"
111
+            android:layout_marginTop="30dp"
112
+            android:padding="10dp"
113
+            android:rotation="270"
114
+            android:text="常见问题"
115
+            android:textColor="@color/light_blue_900" />
116
+
117
+        <TextView
87 118
             android:id="@+id/tvConnect"
88 119
             android:layout_width="wrap_content"
89 120
             android:layout_height="wrap_content"
@@ -104,6 +135,60 @@
104 135
 
105 136
         </ImageView>
106 137
 
138
+        <RelativeLayout
139
+            android:id="@+id/layoutMsg"
140
+            android:layout_width="wrap_content"
141
+            android:layout_height="match_parent"
142
+            android:layout_centerInParent="true"
143
+            android:gravity="center"
144
+            android:orientation="vertical"
145
+            android:padding="10dp"
146
+            tools:visibility="visible">
147
+
148
+            <TextView
149
+                android:id="@+id/t1"
150
+                android:layout_width="wrap_content"
151
+                android:layout_height="wrap_content"
152
+                android:layout_centerVertical="true"
153
+                android:layout_marginTop="10dp"
154
+                android:rotation="270"
155
+                android:text="未链接"
156
+                android:textColor="@color/material_dynamic_primary30"
157
+                 />
158
+
159
+            <ImageView
160
+                android:id="@+id/t2"
161
+                android:layout_width="wrap_content"
162
+                android:layout_height="match_parent"
163
+                android:layout_centerVertical="true"
164
+                android:layout_toRightOf="@+id/t1"
165
+                android:src="@drawable/p1" />
166
+
167
+            <ImageView
168
+                android:id="@+id/t3"
169
+                android:layout_width="wrap_content"
170
+                android:layout_height="match_parent"
171
+                android:layout_centerVertical="true"
172
+                android:layout_toRightOf="@+id/t2"
173
+                android:src="@drawable/home1" />
174
+
175
+            <ImageView
176
+                android:id="@+id/t4"
177
+                android:layout_width="wrap_content"
178
+                android:layout_height="match_parent"
179
+                android:layout_centerVertical="true"
180
+                android:layout_toRightOf="@+id/t3"
181
+                android:src="@drawable/p2" />
182
+
183
+            <ImageView
184
+                android:id="@+id/t5"
185
+                android:layout_width="wrap_content"
186
+                android:layout_height="match_parent"
187
+                android:layout_centerVertical="true"
188
+                android:layout_toRightOf="@+id/t4"
189
+                android:src="@drawable/home2" />
190
+        </RelativeLayout>
191
+
107 192
         <LinearLayout
108 193
             android:id="@+id/l1"
109 194
             android:layout_width="wrap_content"
@@ -180,6 +265,81 @@
180 265
 
181 266
         </LinearLayout>
182 267
 
268
+        <!--<LinearLayout
269
+            android:id="@+id/l3"
270
+            android:layout_width="match_parent"
271
+            android:layout_height="80dp"
272
+            android:layout_alignParentBottom="true"
273
+            android:orientation="horizontal"
274
+            >
275
+
276
+            <Button
277
+                android:id="@+id/bt6"
278
+                android:layout_width="match_parent"
279
+                android:layout_height="wrap_content"
280
+                android:layout_weight="1"
281
+                android:background="@drawable/bt"
282
+                tools:visibility="gone"
283
+                android:text="重启仪器">
284
+
285
+            </Button>
286
+
287
+            <Button
288
+                android:id="@+id/bt7"
289
+                android:layout_width="match_parent"
290
+                android:layout_height="wrap_content"
291
+                android:layout_weight="1"
292
+                android:background="@drawable/bt"
293
+                tools:visibility="gone"
294
+                android:text="断开">
295
+
296
+            </Button>
297
+
298
+            <Button
299
+                android:id="@+id/bt8"
300
+                android:layout_width="match_parent"
301
+                android:layout_height="wrap_content"
302
+                android:layout_weight="1"
303
+                android:background="@drawable/bt"
304
+                tools:visibility="gone"
305
+                android:text="开始拍摄">
306
+
307
+            </Button>
308
+        </LinearLayout>-->
309
+
310
+        <LinearLayout
311
+            android:id="@+id/l4"
312
+            android:layout_width="match_parent"
313
+            android:layout_height="wrap_content"
314
+            android:layout_alignParentBottom="true"
315
+            android:layout_marginRight="20dp"
316
+            android:orientation="vertical"
317
+            android:visibility="gone">
318
+
319
+            <Button
320
+                android:id="@+id/bt9"
321
+                android:layout_width="match_parent"
322
+                android:layout_height="wrap_content"
323
+                android:layout_weight="1"
324
+                android:background="@drawable/bt"
325
+                android:rotation="270"
326
+                android:text="帮助">
327
+
328
+            </Button>
329
+
330
+            <Button
331
+                android:id="@+id/bt10"
332
+                android:layout_width="match_parent"
333
+                android:layout_height="wrap_content"
334
+                android:layout_weight="1"
335
+                android:background="@drawable/bt"
336
+                android:rotation="270"
337
+                android:text="重新连接">
338
+
339
+            </Button>
340
+
341
+        </LinearLayout>
342
+
183 343
         <com.cfmlg.mlg.CirclePercentView
184 344
             android:id="@+id/circleView"
185 345
             app:stripeWidth="15dp"
@@ -190,5 +350,6 @@
190 350
             android:layout_width="wrap_content"
191 351
             android:layout_height="wrap_content"
192 352
             android:layout_centerInParent="true"/>
353
+
193 354
     </RelativeLayout>
194 355
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 18 - 0
app/src/main/res/layout/activity_video_view.xml

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout android:id="@+id/LinearLayout01"
3
+    android:layout_width="fill_parent" android:layout_height="fill_parent"
4
+    xmlns:android="http://schemas.android.com/apk/res/android"
5
+    android:orientation="vertical">
6
+
7
+    <SurfaceView android:id="@+id/SurfaceView01"
8
+        android:layout_width="fill_parent" android:layout_height="250px"></SurfaceView>
9
+    <LinearLayout android:id="@+id/LinearLayout02"
10
+        android:layout_width="wrap_content" android:layout_height="wrap_content">
11
+        <Button android:layout_width="wrap_content"
12
+            android:layout_height="wrap_content" android:id="@+id/Button03"
13
+            android:text="播放视频"></Button>
14
+        <Button android:layout_width="wrap_content"
15
+            android:layout_height="wrap_content" android:text="停止播放" android:id="@+id/Button04"></Button>
16
+    </LinearLayout>
17
+</LinearLayout>
18
+

+ 11 - 0
app/src/main/res/xml/map.xml

@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<map xmlns:android="http://schemas.android.com/apk/res/android"
3
+    width="500"
4
+    height="500">
5
+    <!--left, top, right, bottom-->
6
+    <area name="Rect" shape="rect" coords="62,49,193,123" id="@+id/shape_rect"/>
7
+    <!--x, y, radius-->
8
+    <area name="Circle" shape="circle" coords="211,262,50" id="@+id/shape_circle"/>
9
+    <!--x,y,x,y,x,y...-->
10
+    <area name="Poly" shape="poly" coords="300,332,360,288,421,332,399,404,322,404" id="@+id/shape_poly"/>
11
+</map>

+ 2 - 0
settings.gradle

@@ -1,6 +1,7 @@
1 1
 pluginManagement {
2 2
     repositories {
3 3
         maven { url 'https://maven.aliyun.com/repository/public/' }
4
+        maven { url 'https://jitpack.io' }
4 5
         google()
5 6
         mavenCentral()
6 7
         gradlePluginPortal()
@@ -9,6 +10,7 @@ pluginManagement {
9 10
 dependencyResolutionManagement {
10 11
     repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
11 12
     repositories {
13
+        maven { url 'https://jitpack.io' }
12 14
         google()
13 15
         mavenCentral()
14 16
         gradlePluginPortal()