Compare commits
41 Commits
master
...
dongweiche
After Width: | Height: | Size: 803 KiB |
After Width: | Height: | Size: 360 KiB |
After Width: | Height: | Size: 556 KiB |
After Width: | Height: | Size: 432 KiB |
After Width: | Height: | Size: 349 KiB |
After Width: | Height: | Size: 329 KiB |
After Width: | Height: | Size: 275 KiB |
After Width: | Height: | Size: 348 KiB |
After Width: | Height: | Size: 282 KiB |
After Width: | Height: | Size: 329 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 394 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.example.sixaunyi;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.fragment.NavHostFragment;
|
||||
import com.example.sixaunyi.databinding.FragmentFirstBinding;
|
||||
|
||||
public class FirstFragment extends Fragment {
|
||||
|
||||
private FragmentFirstBinding binding;
|
||||
|
||||
@Override
|
||||
public View onCreateView(
|
||||
LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState
|
||||
) {
|
||||
|
||||
binding = FragmentFirstBinding.inflate(inflater, container, false);
|
||||
return binding.getRoot();
|
||||
|
||||
}
|
||||
|
||||
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
binding.buttonFirst.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
NavHostFragment.findNavController(FirstFragment.this)
|
||||
.navigate(R.id.action_FirstFragment_to_SecondFragment);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.example.sixaunyi;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
private EditText mUsername;
|
||||
private EditText mPassword;
|
||||
private Button mLoginButton;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
// 获取输入框和按钮的实例
|
||||
mUsername = findViewById(R.id.username);
|
||||
mPassword = findViewById(R.id.password);
|
||||
mLoginButton = findViewById(R.id.login);
|
||||
|
||||
// 设置登录按钮的点击事件
|
||||
mLoginButton.setOnClickListener(v -> {
|
||||
// 获取用户输入的用户名和密码
|
||||
String username = mUsername.getText().toString();
|
||||
String password = mPassword.getText().toString();
|
||||
// 验证用户名和密码是否正确
|
||||
if (username.equals("admin") && password.equals("123456") || username.equals("tiequan") && password.equals("8731")) {
|
||||
// 如果验证成功,跳转到主界面
|
||||
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish(); // 关闭登录界面
|
||||
} else {
|
||||
// 如果验证失败,在输入框下方提示错误信息
|
||||
Toast.makeText(LoginActivity.this, "用户名或密码错误", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<!--地图-->
|
||||
<com.amap.api.maps.MapView
|
||||
android:id="@+id/map_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--浮动按钮-->
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_poi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="20dp"
|
||||
android:clickable="true"
|
||||
|
||||
android:src="@drawable/icon_favorite_red"
|
||||
android:visibility="gone"
|
||||
app:backgroundTint="#FFF"
|
||||
app:backgroundTintMode="screen"
|
||||
app:hoveredFocusedTranslationZ="18dp"
|
||||
app:pressedTranslationZ="18dp" />
|
||||
|
||||
<!--浮动按钮 清空marker-->
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/clearMarker_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_above="@+id/fab_poi"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:clickable="true"
|
||||
android:onClick="clearAllMarker"
|
||||
app:fabSize="normal"
|
||||
android:src="@drawable/icon_clear"
|
||||
app:backgroundTint="#FFF"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTintMode="screen"
|
||||
app:hoveredFocusedTranslationZ="18dp"
|
||||
app:pressedTranslationZ="18dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/change_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:clickable="true"
|
||||
android:onClick="changeAct"
|
||||
app:fabSize="normal"
|
||||
android:src="@drawable/wurenji"
|
||||
app:backgroundTint="#FFF"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTintMode="screen"
|
||||
app:hoveredFocusedTranslationZ="18dp"
|
||||
app:pressedTranslationZ="18dp" />
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch1"
|
||||
android:layout_width="290dp"
|
||||
android:layout_height="51dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:clickable="false"
|
||||
android:fontFamily="sans-serif"
|
||||
android:scrollbarAlwaysDrawHorizontalTrack="false"
|
||||
android:showText="true"
|
||||
android:switchTextAppearance="@style/TextAppearance.AppCompat.Display1"
|
||||
android:text="飞行速度"
|
||||
android:textAlignment="textStart"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="#2196F3"
|
||||
android:textIsSelectable="false"
|
||||
android:textOff="慢"
|
||||
android:textOn="快"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:thumbTint="#AFBAC3"
|
||||
android:typeface="normal"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:checked="true"
|
||||
tools:ignore="MissingConstraints,UseSwitchCompatOrMaterialXml,VisualLintBounds,VisualLintButtonSize"
|
||||
tools:layout_editor_absoluteX="440dp" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch2"
|
||||
android:layout_width="290dp"
|
||||
android:layout_height="51dp"
|
||||
android:checked="false"
|
||||
android:showText="true"
|
||||
android:splitTrack="false"
|
||||
android:switchTextAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:text="图片质量"
|
||||
android:textAlignment="textStart"
|
||||
android:textColor="#0091EA"
|
||||
android:textOff="普通"
|
||||
android:textOn="高质量"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
tools:layout_editor_absoluteX="440dp"
|
||||
tools:layout_editor_absoluteY="78dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".VideoActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/img_show"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="#000000"
|
||||
android:layout_height="300dp">
|
||||
</ImageView>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:id="@+id/btn_send"
|
||||
android:text="链接到服务器"
|
||||
android:textSize="30sp"
|
||||
android:layout_height="wrap_content">
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
android:id="@+id/transfer_to_detect"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="切换" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older that API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_host_fragment_content_detect"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:defaultNavHost="true"
|
||||
app:navGraph="@navigation/nav_graph" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".FirstFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview_first"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hello_first_fragment"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/button_first"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_first"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/next"
|
||||
app:layout_constraintTop_toBottomOf="@id/textview_first"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".SecondFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview_second"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/button_second"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_second"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/previous"
|
||||
app:layout_constraintTop_toBottomOf="@id/textview_second"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
|
||||
</adaptive-icon>
|
@ -0,0 +1,27 @@
|
||||
package com.example.sixaunyi;
|
||||
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.maps.MapsInitializer;
|
||||
import com.amap.api.services.core.ServiceSettings;
|
||||
|
||||
public class MapApplication extends Application {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Context context = this;
|
||||
//定位隐私政策同意
|
||||
AMapLocationClient.updatePrivacyShow(context,true,true);
|
||||
AMapLocationClient.updatePrivacyAgree(context,true);
|
||||
//地图隐私政策同意
|
||||
MapsInitializer.updatePrivacyShow(context,true,true);
|
||||
MapsInitializer.updatePrivacyAgree(context,true);
|
||||
//搜索隐私政策同意
|
||||
ServiceSettings.updatePrivacyShow(context,true,true);
|
||||
ServiceSettings.updatePrivacyAgree(context,true);
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.6 KiB |