Merge remote-tracking branch 'origin/chiyanzhen_branch' into chiyanzhen_branch

pull/2/head
qiuwb 2 years ago
commit 2177cada56

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,31 +1,31 @@
C
java:S1604;"(Make this anonymous inner class a lambda(ƒø…Òÿÿÿÿÿ
java:S1604Z"(Make this anonymous inner class a lambda(ƒø…Òÿÿÿÿÿ
>
java:S1604D"(Make this anonymous inner class a lambda(›³äª
o java:S115!"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(××ðè
t java:S115""ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(Ó<EFBFBD><EFBFBD>ïùÿÿÿÿ
t java:S1160"ZRename this field "Trans_to_Detect" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¾¥Âöûÿÿÿÿ
java:S1604c"(Make this anonymous inner class a lambda(›³äª
t java:S115!"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(­“ïÍøÿÿÿÿ
o java:S115""ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(šŸåå
t java:S116O"ZRename this field "Trans_to_Detect" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¾¥Âöûÿÿÿÿ
y
java:S14500"^Remove the "Trans_to_Detect" field and declare it as a local variable in the relevant methods.(¾¥Âöûÿÿÿÿ
java:S1450O"^Remove the "Trans_to_Detect" field and declare it as a local variable in the relevant methods.(¾¥Âöûÿÿÿÿ
m
java:S14502"RRemove the "btn" field and declare it as a local variable in the relevant methods.(ãȧ<C388>üÿÿÿÿ
[
java:S1124!"EReorder the modifiers to comply with the Java Language Specification.(××ðè
java:S1450Q"RRemove the "btn" field and declare it as a local variable in the relevant methods.(ãȧ<C388>üÿÿÿÿ
`
java:S1124""EReorder the modifiers to comply with the Java Language Specification.(Ó<><C393>ïùÿÿÿÿ
java:S1124!"EReorder the modifiers to comply with the Java Language Specification.(­“ïÍøÿÿÿÿ
[
java:S1124""EReorder the modifiers to comply with the Java Language Specification.(šŸåå
[
java:S1124#"EReorder the modifiers to comply with the Java Language Specification.(ß×á
[
java:S1124$"EReorder the modifiers to comply with the Java Language Specification.(Ó¾þá
V java:S125>"<This block of commented-out lines of code should be removed.(è·¿¯ùÿÿÿÿ
V java:S125]"<This block of commented-out lines of code should be removed.(è·¿¯ùÿÿÿÿ
C
java:S1185_"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ
V java:S125r"<This block of commented-out lines of code should be removed.(<28>­éäøÿÿÿÿ
V java:S125w"<This block of commented-out lines of code should be removed.(çéŸþÿÿÿÿ
E
java:S2093n"*Change this "try" to a try-with-resources.(ç£ê<C2A3>úÿÿÿÿ
W java:S125®"<This block of commented-out lines of code should be removed.(òœô˜úÿÿÿÿ
java:S1185~"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ
W java:S125"<This block of commented-out lines of code should be removed.(<28>­éäøÿÿÿÿ
W java:S125"<This block of commented-out lines of code should be removed.(çéŸþÿÿÿÿ
F
java:S2093<EFBFBD>"*Change this "try" to a try-with-resources.(ç£ê<C2A3>úÿÿÿÿ
W java:S125Í"<This block of commented-out lines of code should be removed.(òœô˜úÿÿÿÿ
9
java:S1128"Remove this duplicated import.(°þÊóøÿÿÿÿ
L

@ -1,51 +1,54 @@
p
java:S11047"[Make mLocationClient a static final constant or non-public and provide accessors if needed.(òó•L
java:S11049"[Make mLocationClient a static final constant or non-public and provide accessors if needed.(òó•L
q
java:S11049"[Make mLocationOption a static final constant or non-public and provide accessors if needed.(ÈÀ‚§
java:S1104;"[Make mLocationOption a static final constant or non-public and provide accessors if needed.(ÈÀ‚§
k
java:S2259ã"MA "NullPointerException" could be thrown; "mLocationClient" is nullable here.(Ô¹¤<C2B9>8˜¡ØÑö0
o java:S116M"ZRename this field "ClearMarker_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëþ¥È
y java:S116O"XRename this field "ChangeAct_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÂîœÃúÿÿÿÿ8…ÚÑö0
java:S2259ê"MA "NullPointerException" could be thrown; "mLocationClient" is nullable here.(Ô¹¤<C2B9>8üÀ±•‡1
z java:S116>"YRename this field "Current_latlng" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(æàÁÆÿÿÿÿÿ8ýÀ±•‡1
v java:S116P"ZRename this field "ClearMarker_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëþ¥È8ýÀ±•‡1
y java:S116R"XRename this field "ChangeAct_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÂîœÃúÿÿÿÿ8ýÀ±•‡1
Ÿ
java:S1186"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(±€¿ë8 ¡ØÑö0
java:S1186Å"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(±€¿ë8Á±•‡1
~
java:S1450O"\Remove the "ChangeAct_btn" field and declare it as a local variable in the relevant methods.(ÂîœÃúÿÿÿÿ8ÏýÚÑö0
java:S1450R"\Remove the "ChangeAct_btn" field and declare it as a local variable in the relevant methods.(ÂîœÃúÿÿÿÿ8ƒÁ±•‡1
i
java:S1450;"SRemove the "city" field and declare it as a local variable in the relevant methods.(“øÌà
m
java:S1450I"WRemove the "cityCode" field and declare it as a local variable in the relevant methods.(êýð†
G
java:S1874E"1Remove this use of "PoiSearch"; it is deprecated.(–ƒëÖ
L
java:S1874G"1Remove this use of "PoiSearch"; it is deprecated.(²¹·‘ÿÿÿÿÿ
] java:S125b"<This block of commented-out lines of code should be removed.(¤¯¿Îúÿÿÿÿ8°¡ØÑö0
java:S1450="SRemove the "city" field and declare it as a local variable in the relevant methods.(“øÌà
t
java:S1450L"WRemove the "cityCode" field and declare it as a local variable in the relevant methods.(êýð†8ƒÁ±•‡1
N
java:S1874H"1Remove this use of "PoiSearch"; it is deprecated.(–ƒëÖ8ŒÁ±•‡1
S
java:S1874J"1Remove this use of "PoiSearch"; it is deprecated.(²¹·‘ÿÿÿÿÿ8<EFBFBD>Á±•‡1
] java:S125e"<This block of commented-out lines of code should be removed.(¤¯¿Îúÿÿÿÿ8˜Á±•‡1
m
java:S1874<EFBFBD>"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(Ó»×¶þÿÿÿÿ8¸¡ØÑö0
Y java:S125Ï"<This block of commented-out lines of code should be removed.(©áèè8À¡ØÑö0
java:S1874 "JDon't override a deprecated method or explicitly mark it as "@Deprecated".(Ó»×¶þÿÿÿÿ8œÁ±•‡1
Y java:S125Ö"<This block of commented-out lines of code should be removed.(©áèè8¤Á±•‡1
`
java:S1854"=Remove this useless assignment to local variable "longitude".(ËàÅ€ûÿÿÿÿ8È¡ØÑö0
java:S1854"=Remove this useless assignment to local variable "longitude".(ËàÅ€ûÿÿÿÿ8¨Á±•‡1
_
java:S1854þ"<Remove this useless assignment to local variable "latitude".(û‘áäùÿÿÿÿ8È¡ØÑö0
java:S1854"<Remove this useless assignment to local variable "latitude".(û‘áäùÿÿÿÿ8©Á±•‡1
P
java:S1481þ"-Remove this unused "latitude" local variable.(û‘áäùÿÿÿÿ8È¡ØÑö0
java:S1481"-Remove this unused "latitude" local variable.(û‘áäùÿÿÿÿ8«Á±•‡1
Q
java:S1481".Remove this unused "longitude" local variable.(ËàÅ€ûÿÿÿÿ8È¡ØÑö0
java:S1481".Remove this unused "longitude" local variable.(ËàÅ€ûÿÿÿÿ8«Á±•‡1
Y java:S125Ä"<This block of commented-out lines of code should be removed.(É–Ö­8ÔŸÈ•‡1
N
java:S1172Ù"+Remove this unused method parameter "view".(çÑ¢‰ýÿÿÿÿ8СØÑö0
java:S1172ç"+Remove this unused method parameter "view".(çÑ¢‰ýÿÿÿÿ8²Á±•‡1
\
java:S1155Ú">Use isEmpty() to check whether the collection is empty or not.(”ó±’8СØÑö0
java:S1155è">Use isEmpty() to check whether the collection is empty or not.(”ó±’8²Á±•‡1
N
java:S1172â"+Remove this unused method parameter "view".(•É‘ÎûÿÿÿÿèÑö0
java:S1172ð"+Remove this unused method parameter "view".(•É‘Îûÿÿÿÿ8³Á±•‡1
X java:S125"<This block of commented-out lines of code should be removed.(Ÿ…¦Q8¸Á±•‡1
\
java:S1117ñ"9Rename "query" which hides the field declared at line 69.(˜Ž“áûÿÿÿÿ8Ø¡ØÑö0
^ java:S125Š"<This block of commented-out lines of code should be removed.(±<>öîýÿÿÿÿ8Ø¡ØÑö0
Y java:S125"<This block of commented-out lines of code should be removed.(ÎÞ<C38E>û8Ø¡ØÑö0
java:S1117±"9Rename "query" which hides the field declared at line 72.(˜Ž“áûÿÿÿÿ8»Á±•‡1
^ java:S125Ê"<This block of commented-out lines of code should be removed.(±<>öîýÿÿÿÿ8½Á±•‡1
Y java:S125Õ"<This block of commented-out lines of code should be removed.(ÎÞ<C38E>û8½Á±•‡1
>
java:S1068;"(Remove this unused "city" private field.(“øÌà
?
java:S1068E")Remove this unused "query" private field.(–ƒëÖ
H
java:S1068G"-Remove this unused "poiSearch" private field.(²¹·‘ÿÿÿÿÿ
B
java:S1068I",Remove this unused "cityCode" private field.(êýð†
java:S1068="(Remove this unused "city" private field.(“øÌà
F
java:S1068H")Remove this unused "query" private field.(–ƒëÖ8¾Á±•‡1
O
java:S1068J"-Remove this unused "poiSearch" private field.(²¹·‘ÿÿÿÿÿ8¾Á±•‡1
I
java:S1068L",Remove this unused "cityCode" private field.(êýð†8¾Á±•‡1

@ -10,9 +10,9 @@ java:S1604
i
java:S1104%"SMake TV_show a static final constant or non-public and provide accessors if needed.(úÀŸõ
>
java:S2189""Add an end condition to this loop.(˜ïˆžÿÿÿÿÿ
>
java:S2189±""Add an end condition to this loop.(˜ïˆžÿÿÿÿÿ
>
java:S2189""Add an end condition to this loop.(˜ïˆžÿÿÿÿÿ
k java:S116!"VRename this field "receive_Msg" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ŒßÙú
g java:S116%"RRename this field "TV_show" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(úÀŸõ
^

@ -15,13 +15,15 @@ j
:app/src/main/java/com/example/sixaunyi/SecondFragment.java,1\2\12963d86ac5c2888cc2a9ae459de5665bc06b01f
?
settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
@
app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164
h
8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c
i
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
j
:app/src/main/java/com/example/sixaunyi/DetectActivity.java,9\6\9668392b13e33166876f2a7d3f10eb5405e757ad
i
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
h
8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
k
;app/src/main/java/com/example/sixaunyi/ControlActivity.java,c\9\c99a584c2117ed2df42496451bb97ac1147f5ea0

@ -3,25 +3,16 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.example.sixaunyi">
<!-- 用于访问网络,网络定位需要上网 -->
<uses-permission android:name="android.permission.INTERNET" />
<!--用于读取手机当前的状态-->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!--用于写入缓存数据到扩展存储卡-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--用于申请调用A-GPS模块-->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<!--用于进行网络定位-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!--用于访问GPS定位-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!--用于获取运营商信息,用于支持提供运营商信息相关的接口-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--用于访问wifi网络信息wifi信息会用于进行网络定位-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!--用于获取wifi的获取权限wifi信息会用来进行网络定位-->
<uses-permission android:name="android.permission.INTERNET" /> <!-- 用于读取手机当前的状态 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 用于写入缓存数据到扩展存储卡 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 用于申请调用A-GPS模块 -->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 用于访问GPS定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 用于访问wifi网络信息wifi信息会用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 用于获取wifi的获取权限wifi信息会用来进行网络定位 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<application
android:name=".MapApplication"
android:allowBackup="true"
@ -33,13 +24,15 @@
android:supportsRtl="true"
android:theme="@style/Theme.Sixaunyi"
tools:targetApi="31">
<activity
android:name=".ControlActivity"
android:screenOrientation="landscape"
android:exported="false" />
<!-- 定位service -->
<service
android:name="com.amap.api.location.APSService"/>
<!--设置高德Key-->
<service android:name="com.amap.api.location.APSService" /> <!-- 设置高德Key -->
<meta-data
android:name="com.amap.api.v2.apikey" android:value="530a964ff05e45d9efb905abc9480690"/>
android:name="com.amap.api.v2.apikey"
android:value="530a964ff05e45d9efb905abc9480690" />
<activity
android:name=".VideoActivity"

@ -0,0 +1,14 @@
package com.example.sixaunyi;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class ControlActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_control);
}
}

@ -22,6 +22,7 @@ import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.amap.api.maps.AMap;
import com.amap.api.maps.AMapUtils;
import com.amap.api.maps.LocationSource;
import com.amap.api.maps.MapView;
import com.amap.api.maps.model.BitmapDescriptorFactory;
@ -47,7 +48,8 @@ import pub.devrel.easypermissions.AfterPermissionGranted;
import pub.devrel.easypermissions.EasyPermissions;
public class MainActivity extends AppCompatActivity implements AMapLocationListener, LocationSource,
AMap.OnMapLongClickListener, GeocodeSearch.OnGeocodeSearchListener {
AMap.OnMapLongClickListener, GeocodeSearch.OnGeocodeSearchListener, AMap.OnMarkerDragListener,
AMap.OnMarkerClickListener{
//请求权限码
private static final int REQUEST_PERMISSIONS = 9527;
@ -57,6 +59,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
public AMapLocationClientOption mLocationOption = null;
private MapView mapView = null;
private String city;
private LatLng Current_latlng;
//地图控制器*********非常重要!!!!!!
private AMap aMap = null;
//位置更改监听
@ -203,6 +206,10 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
aMap.setLocationSource(this);
// 设置为true表示显示定位层并可触发定位false表示隐藏定位层并不可触发定位默认是false
aMap.setMyLocationEnabled(true);
//设置地图标志点击事件
aMap.setOnMarkerClickListener(this);
//设置地图标志拖拽事件
aMap.setOnMarkerDragListener(this);
//开启室内地图
//aMap.showIndoorMap(true);
//设置地图长按事件
@ -250,6 +257,8 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
String address = aMapLocation.getAddress();
//城市赋值
city = aMapLocation.getCity();
//当前位置经纬度坐标
Current_latlng = new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude());
//获取纬度
double latitude = aMapLocation.getLatitude();
//获取经度
@ -311,7 +320,9 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
//LatLng 为高德地图包自带的存储坐标对象
@Override
public void onMapLongClick(LatLng latLng) {
showMsg("长按了地图,经度:"+latLng.longitude+",纬度:"+latLng.latitude);
float distance = AMapUtils.calculateLineDistance(Current_latlng,latLng);
//showMsg("长按了地图,经度:"+latLng.longitude+",纬度:"+latLng.latitude);
showMsg("直线距离:"+distance+"米");
//坐标转地址
latlonToAddress(latLng);
//添加标点
@ -329,13 +340,16 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
//添加标点
Marker marker = aMap.addMarker(markerOption
.position(latLng)
.draggable(true)
//标点图标
.icon(BitmapDescriptorFactory.
fromBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.img)))
//备注
.snippet("路径点")
.title("路径点")
.snippet("距离:")
);
marker.showInfoWindow();
markerList.add(marker);
}
/**
@ -358,6 +372,56 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
}
/**
* Marker
*
* @param marker
* @return
*/
@Override
public boolean onMarkerClick(Marker marker) {
Log.d(TAG,"点击了标点");
//显示InfoWindow
/*
if (!marker.isInfoWindowShown()) {
//显示
marker.showInfoWindow();
} else {
//隐藏
marker.hideInfoWindow();
}
*/
return true;
}
/**
*
* @param marker
*/
@Override
public void onMarkerDragStart(Marker marker) {
Log.d(TAG,"开始拖动");
}
/**
*
* @param marker
*/
@Override
public void onMarkerDrag(Marker marker) {
Log.d(TAG,"拖动中");
}
/**
*
* @param marker
*/
@Override
public void onMarkerDragEnd(Marker marker) {
Log.d(TAG,"拖动完成");
}
/* * * * * *
*
* @param latLng

@ -30,8 +30,8 @@ import android.os.Bundle;
public class VideoActivity extends AppCompatActivity {
private final static String SEND_to_IP = "192.168.10.2"; //填写接收方IP
private final static String Recieve_IP = "192.168.10.2";//填服务器IP
private final static String SEND_to_IP = "192.168.43.165"; //填写接收方IP
private final static String Recieve_IP = "192.168.43.165";//填服务器IP
private final static int SEND_PORT = 8888; //发送端口号
private final static int RECEIVE_PORT = 9999; //接收端口号
@ -44,6 +44,37 @@ public class VideoActivity extends AppCompatActivity {
private DatagramSocket reveSocket;
private InetAddress serverAddr;
private SendHandler sendHandler = new SendHandler();
private ReceiveHandler receiveHandler = new ReceiveHandler();
private Button Trans_to_Detect;
private ImageView imgShow;

@ -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>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:adjustViewBounds="true" >
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#ff000000"
android:textSize="14dp"
android:textStyle="bold" />
<TextView
android:id="@+id/snippet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#ff7f7f7f"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/img"
android:orientation="horizontal" >
<ImageView
android:id="@+id/badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp" >
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#ff000000"
android:textSize="14dp"
android:textStyle="bold" />
<TextView
android:id="@+id/snippet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#ff7f7f7f"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>

@ -6,7 +6,14 @@
<string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="down_button">下降按钮</string>
<string name="up_button">上升旋转</string>
<string name="move_left_button">向左按钮</string>
<string name="move_right_button">向右按钮</string>
<string name="move_forward_button">向前按钮</string>
<string name="move_back_button">向后按钮</string>
<string name="turn_left_button">向左旋转</string>
<string name="turn_right_button">向右旋转</string>
<string name="hello_first_fragment">Hello first fragment</string>
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
</resources>
Loading…
Cancel
Save