|
|
|
@ -0,0 +1,155 @@
|
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
|
android:layout_height="match_parent">
|
|
|
|
|
|
|
|
|
|
<!-- 显示无人机回传图像的控件 -->
|
|
|
|
|
<ImageView
|
|
|
|
|
android:id="@+id/imageView"
|
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
|
android:layout_height="200dp"
|
|
|
|
|
android:scaleType="centerCrop"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 左侧竖直轴按钮 -->
|
|
|
|
|
<RelativeLayout
|
|
|
|
|
android:id="@+id/left_vertical_button_layout"
|
|
|
|
|
android:layout_width="150dp"
|
|
|
|
|
android:layout_height="150dp"
|
|
|
|
|
android:layout_marginLeft="20dp"
|
|
|
|
|
android:layout_marginTop="20dp"
|
|
|
|
|
android:layout_below="@+id/imageView">
|
|
|
|
|
|
|
|
|
|
<!-- 上升按钮 -->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/up_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_centerHorizontal="true"
|
|
|
|
|
android:layout_alignParentTop="true"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:contentDescription="@string/up_button"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
<!-- 下降按钮 -->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/down_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_centerHorizontal="true"
|
|
|
|
|
android:layout_alignParentBottom="true"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:contentDescription="@string/down_button"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
<!-- 左旋转按钮 -->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/rotate_left_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_centerVertical="true"
|
|
|
|
|
android:layout_alignParentStart="true"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:contentDescription="@string/turn_left_button"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
<!-- 右旋转按钮 -->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/rotate_right_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_centerVertical="true"
|
|
|
|
|
android:layout_alignParentEnd="true"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:contentDescription="@string/turn_right_button"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
</RelativeLayout>
|
|
|
|
|
|
|
|
|
|
<RelativeLayout
|
|
|
|
|
android:id="@+id/top_horizontal_button_layout"
|
|
|
|
|
android:layout_width="150dp"
|
|
|
|
|
android:layout_height="150dp"
|
|
|
|
|
android:layout_below="@+id/imageView"
|
|
|
|
|
android:layout_marginTop="20dp"
|
|
|
|
|
android:layout_marginRight="20dp"
|
|
|
|
|
android:layout_alignParentEnd="true">
|
|
|
|
|
|
|
|
|
|
<!-- 向左按钮 -->
|
|
|
|
|
<!-- 每一个与image相关,都需要设置contentDescription,对其进行描述-->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/left_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_alignParentStart="true"
|
|
|
|
|
android:layout_centerVertical="true"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:contentDescription="@string/move_left_button"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
<!-- 向右按钮 -->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/right_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_alignParentEnd="true"
|
|
|
|
|
android:layout_centerVertical="true"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:contentDescription="@string/move_right_button"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
<!-- 向前移动按钮 -->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/forward_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_centerHorizontal="true"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:contentDescription="@string/move_forward_button"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
<!-- 向后移动按钮 -->
|
|
|
|
|
<ImageButton
|
|
|
|
|
android:id="@+id/backward_button"
|
|
|
|
|
android:layout_width="50dp"
|
|
|
|
|
android:layout_height="50dp"
|
|
|
|
|
android:layout_alignParentBottom="true"
|
|
|
|
|
android:layout_alignParentEnd="true"
|
|
|
|
|
android:contentDescription="@string/move_back_button"
|
|
|
|
|
android:layout_marginEnd="50dp"
|
|
|
|
|
android:background="@null"
|
|
|
|
|
android:src="@drawable/img" />
|
|
|
|
|
|
|
|
|
|
</RelativeLayout>
|
|
|
|
|
|
|
|
|
|
<LinearLayout
|
|
|
|
|
android:id="@+id/takeoff_landing_buttons_layout"
|
|
|
|
|
android:layout_width="200dp"
|
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
|
android:layout_alignParentBottom="true"
|
|
|
|
|
android:layout_centerHorizontal="true"
|
|
|
|
|
android:layout_marginBottom="20dp"
|
|
|
|
|
android:gravity="center_horizontal"
|
|
|
|
|
android:orientation="horizontal">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 降落按钮 -->
|
|
|
|
|
<Button
|
|
|
|
|
android:id="@+id/landing_button"
|
|
|
|
|
android:layout_width="80dp"
|
|
|
|
|
android:layout_height="61dp"
|
|
|
|
|
android:layout_gravity="left"
|
|
|
|
|
android:layout_marginRight="10dp"
|
|
|
|
|
android:layout_weight="1"
|
|
|
|
|
android:text="降落" />
|
|
|
|
|
<!-- 起飞按钮 -->
|
|
|
|
|
<Button
|
|
|
|
|
android:id="@+id/takeoff_button"
|
|
|
|
|
android:layout_width="80dp"
|
|
|
|
|
android:layout_height="match_parent"
|
|
|
|
|
android:layout_gravity="right"
|
|
|
|
|
android:layout_weight="1"
|
|
|
|
|
android:text="起飞" />
|
|
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
|
</RelativeLayout>
|