优化地图界面UI
@ -100,6 +100,17 @@ class MainActivity : BaseActivity() {
|
||||
//处理页面跳转
|
||||
viewModel.navigation(this, it)
|
||||
}
|
||||
|
||||
viewModel.liveDataMenuState.observe(this) {
|
||||
binding.mainActivityMenu.isSelected = it
|
||||
if(it==true){
|
||||
binding.mainActivityMenuLayout.visibility = View.VISIBLE
|
||||
}else{
|
||||
binding.mainActivityMenuLayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
binding.mainActivitySignRecyclerview.layoutManager = LinearLayoutManager(this)
|
||||
binding.mainActivitySignRecyclerview.adapter = signAdapter
|
||||
//增加4dp的间隔
|
||||
@ -157,6 +168,43 @@ class MainActivity : BaseActivity() {
|
||||
viewModel.onClickCameraButton(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关菜单
|
||||
*/
|
||||
fun onClickMenu() {
|
||||
//显示菜单图层
|
||||
viewModel.onClickMenu()
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击计算
|
||||
*/
|
||||
fun onClickCalcDisance() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击轨迹
|
||||
*/
|
||||
fun onClickTrace() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击搜索
|
||||
*/
|
||||
fun onClickSerach() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击2\3D
|
||||
*/
|
||||
fun onClick2DOr3D() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 点击录音按钮
|
||||
*/
|
||||
|
@ -77,6 +77,10 @@ class MainViewModel @Inject constructor(
|
||||
var volume: ImageView? = null
|
||||
var mSoundMeter: SoundMeter? = null
|
||||
|
||||
var menuState :Boolean = false
|
||||
|
||||
val liveDataMenuState = MutableLiveData<Boolean>()
|
||||
|
||||
init {
|
||||
mapController.markerHandle.setOnQsRecordItemClickListener(object :
|
||||
OnQsRecordItemClickListener {
|
||||
@ -185,6 +189,14 @@ class MainViewModel @Inject constructor(
|
||||
mapController.locationLayerHandler.animateToCurrentPosition()
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击菜单
|
||||
*/
|
||||
fun onClickMenu() {
|
||||
menuState = !menuState
|
||||
liveDataMenuState.postValue(menuState)
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/icon_2d_3d.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_calc_disance.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_close.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_open.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_serach.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_trace.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_2d_3d.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_calc_disance.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_close.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_open.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 6.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_serach.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_trace.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:drawable="@drawable/icon_open">
|
||||
</item>
|
||||
<item android:state_selected="true" android:drawable="@drawable/icon_open">
|
||||
</item>
|
||||
<item android:drawable="@drawable/icon_close">
|
||||
</item>
|
||||
</selector>
|
@ -56,6 +56,73 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/main_activity_person_center"
|
||||
app:layout_constraintTop_toBottomOf="@id/main_activity_person_center" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_activity_menu_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_serach"
|
||||
android:onClick="@{()->mainActivity.onClickSerach()}"
|
||||
android:background="@drawable/icon_serach"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_2d_3d"
|
||||
android:background="@drawable/icon_2d_3d"
|
||||
android:onClick="@{()->mainActivity.onClick2DOr3D()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_camera"
|
||||
android:background="@drawable/icon_page_video_a1"
|
||||
android:onClick="@{()->mainActivity.openCamera()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_trace"
|
||||
android:onClick="@{()->mainActivity.onClickTrace()}"
|
||||
android:background="@drawable/icon_trace"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_calc_disance"
|
||||
android:background="@drawable/icon_calc_disance"
|
||||
android:onClick="@{()->mainActivity.onClickCalcDisance()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:layout_marginTop="5dp"
|
||||
android:id="@+id/main_activity_menu"
|
||||
android:background="@drawable/chk_icon_menu_open_close_xml"
|
||||
android:onClick="@{()->mainActivity.onClickMenu()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
@ -111,23 +178,12 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="4"
|
||||
app:layout_constraintHorizontal_weight="2.5"
|
||||
app:layout_constraintLeft_toRightOf="@id/main_activity_middle_fragment"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/right_fragment_nav_graph" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_camera"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginLeft="160dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:onClick="@{()->mainActivity.openCamera()}"
|
||||
android:src="@drawable/icon_page_video_a1"
|
||||
android:background="@null"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_camera2"
|
||||
|
37
app/src/main/res/layout/cv_map_top_right_menu.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:padding="20dp">
|
||||
|
||||
<ImageButton
|
||||
android:background="@drawable/icon_serach"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:background="@drawable/icon_2d_3d"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_camera"
|
||||
android:background="@drawable/icon_page_video_a1"
|
||||
android:onClick="@{()->mainActivity.openCamera()}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:background="@drawable/icon_trace"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<ImageButton
|
||||
android:background="@drawable/icon_calc_disance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -53,12 +53,11 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:padding="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/card_content_font_default"
|
||||
android:layout_width="wrap_content"
|
||||
@ -76,7 +75,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
@ -98,7 +97,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
@ -120,12 +119,11 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/card_content_font_default"
|
||||
android:layout_width="wrap_content"
|
||||
@ -144,12 +142,11 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:padding="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/card_content_font_default"
|
||||
android:layout_width="wrap_content"
|
||||
@ -168,12 +165,11 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/card_content_font_default"
|
||||
android:layout_width="wrap_content"
|
||||
|