删除多余的控制按钮

chenghonghao_branch
MikkoAyaka 1 year ago
parent c5bc14afc4
commit fd848f13e6

@ -38,7 +38,6 @@ public class MyVideo extends Activity {
OutputStream socketWriter; OutputStream socketWriter;
private Button TakePhotos; private Button TakePhotos;
private Button ViewPhotos; private Button ViewPhotos;
private Button BtnForward, BtnBackward, BtnLeft, BtnRight, BtnStop;
private Socket socket; private Socket socket;
private RockerView rockerView; private RockerView rockerView;
private long exitTime = 0; private long exitTime = 0;
@ -57,12 +56,6 @@ public class MyVideo extends Activity {
TakePhotos = findViewById(R.id.TakePhoto); TakePhotos = findViewById(R.id.TakePhoto);
ViewPhotos = findViewById(R.id.ViewPhoto); ViewPhotos = findViewById(R.id.ViewPhoto);
BtnForward = findViewById(R.id.button_forward);
BtnBackward = findViewById(R.id.button_backward);
BtnLeft = findViewById(R.id.button_left);
BtnRight = findViewById(R.id.button_right);
BtnStop = findViewById(R.id.button_stop);
Intent intent = getIntent(); Intent intent = getIntent();
//´ÓIntentµ±Öиù¾ÝkeyÈ¡µÃvalue //´ÓIntentµ±Öиù¾ÝkeyÈ¡µÃvalue
CameraIp = intent.getStringExtra("CameraIp"); CameraIp = intent.getStringExtra("CameraIp");
@ -74,57 +67,6 @@ public class MyVideo extends Activity {
rockerView = new RockerView(this,socketWriter,this.getApplicationContext(),null); rockerView = new RockerView(this,socketWriter,this.getApplicationContext(),null);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1000,1000); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1000,1000);
addContentView(rockerView,params); addContentView(rockerView,params);
BtnForward.setOnClickListener(arg0 -> {
// TODO Auto-generated method stub
try {
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0xff});
socketWriter.flush();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
});
BtnBackward.setOnClickListener(arg0 -> {
// TODO Auto-generated method stub
try {
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0xff});
socketWriter.flush();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
});
BtnRight.setOnClickListener(arg0 -> {
// TODO Auto-generated method stub
try {
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x03, (byte) 0x00, (byte) 0xff});
socketWriter.flush();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
});
BtnLeft.setOnClickListener(arg0 -> {
// TODO Auto-generated method stub
try {
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x04, (byte) 0x00, (byte) 0xff});
socketWriter.flush();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
});
BtnStop.setOnClickListener(arg0 -> {
// TODO Auto-generated method stub
try {
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff});
socketWriter.flush();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
});
TakePhotos.setOnClickListener(arg0 -> { TakePhotos.setOnClickListener(arg0 -> {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (null != Constant.handler) { if (null != Constant.handler) {

@ -36,51 +36,6 @@
android:layout_height="55dp" android:layout_height="55dp"
android:layout_x="90dp" android:layout_x="90dp"
android:text="查看" /> android:text="查看" />
<Button
android:layout_below="@+id/TakePhoto"
android:id="@+id/button_forward"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/button_left"
android:layout_width="100dip"
android:text="前"
/>
<Button
android:id="@+id/button_backward"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_below="@+id/button_forward"
android:layout_centerInParent="true"
android:layout_toRightOf="@+id/button_left"
android:text="后" />
<Button
android:layout_below="@+id/button_forward"
android:id="@+id/button_left"
android:layout_height="wrap_content"
android:layout_width="100dip"
android:text="左"
/>
<Button
android:id="@+id/button_right"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/button_backward"
android:layout_below="@+id/button_forward"
android:layout_width="100dip"
android:text="右"
/>
<Button
android:id="@+id/button_stop"
android:layout_height="wrap_content"
android:layout_width="100dip"
android:layout_toRightOf="@+id/button_right"
android:text="停" />
<!-- <ImageView--> <!-- <ImageView-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->

Loading…
Cancel
Save