Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
HTAnticollision
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马乐
HTAnticollision
Commits
1d65e955
Commit
1d65e955
authored
Jul 13, 2023
by
马乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.用Activity替换Fragment
parent
fdbd57de
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
941 additions
and
715 deletions
+941
-715
build.gradle
app/build.gradle
+5
-9
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+30
-19
AntiCollisionApp.kt
...c/main/java/com/waytous/anticollision/AntiCollisionApp.kt
+2
-0
ActivityViewModule.kt
...n/java/com/waytous/anticollision/di/ActivityViewModule.kt
+0
-78
FragmentModule.kt
.../main/java/com/waytous/anticollision/di/FragmentModule.kt
+16
-6
NetworkModule.kt
...c/main/java/com/waytous/anticollision/di/NetworkModule.kt
+7
-0
MainActivity.kt
...rc/main/java/com/waytous/anticollision/ui/MainActivity.kt
+0
-0
MainViewModel.kt
...c/main/java/com/waytous/anticollision/ui/MainViewModel.kt
+90
-22
SplashActivity.kt
.../main/java/com/waytous/anticollision/ui/SplashActivity.kt
+4
-3
CollectActivity.kt
...a/com/waytous/anticollision/ui/collect/CollectActivity.kt
+25
-31
HealthManagerActivity.kt
.../waytous/anticollision/ui/health/HealthManagerActivity.kt
+13
-0
HealthMangerFragment.kt
...m/waytous/anticollision/ui/health/HealthMangerFragment.kt
+0
-26
HomeActivity.kt
...in/java/com/waytous/anticollision/ui/home/HomeActivity.kt
+173
-0
HomeNoVideoFragment.kt
.../com/waytous/anticollision/ui/home/HomeNoVideoFragment.kt
+0
-78
UserSettingsActivity.kt
...waytous/anticollision/ui/settings/UserSettingsActivity.kt
+21
-0
UserSettingsFragment.kt
...waytous/anticollision/ui/settings/UserSettingsFragment.kt
+0
-33
DataStatisticsActivity.kt
...ous/anticollision/ui/statistics/DataStatisticsActivity.kt
+13
-0
DataStatisticsFragment.kt
...ous/anticollision/ui/statistics/DataStatisticsFragment.kt
+0
-23
HomeVideoActivity.kt
...a/com/waytous/anticollision/ui/video/HomeVideoActivity.kt
+107
-0
HomeVideoFragment.kt
...a/com/waytous/anticollision/ui/video/HomeVideoFragment.kt
+0
-91
ButtonMorePopup.kt
...java/com/waytous/anticollision/ui/view/ButtonMorePopup.kt
+38
-8
ButtonReportStatusPopup.kt
.../waytous/anticollision/ui/view/ButtonReportStatusPopup.kt
+21
-22
ButtonWorkStatusPopup.kt
...om/waytous/anticollision/ui/view/ButtonWorkStatusPopup.kt
+2
-4
MapExtensions.kt
...ain/java/com/waytous/anticollision/utils/MapExtensions.kt
+163
-0
VehicleAnnotation.kt
...in/java/com/waytous/anticollision/vo/VehicleAnnotation.kt
+0
-6
VehicleLocationInfo.kt
.../java/com/waytous/anticollision/vo/VehicleLocationInfo.kt
+23
-0
activity_collect.xml
app/src/main/res/layout/activity_collect.xml
+54
-43
activity_data_statistics.xml
app/src/main/res/layout/activity_data_statistics.xml
+29
-20
activity_health_manager.xml
app/src/main/res/layout/activity_health_manager.xml
+35
-25
activity_home.xml
app/src/main/res/layout/activity_home.xml
+0
-0
activity_home_video.xml
app/src/main/res/layout/activity_home_video.xml
+0
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+0
-31
activity_splash.xml
app/src/main/res/layout/activity_splash.xml
+1
-1
activity_user_settings.xml
app/src/main/res/layout/activity_user_settings.xml
+32
-23
current_annotation_layout.xml
app/src/main/res/layout/current_annotation_layout.xml
+0
-0
dialog_delay_cause_select.xml
app/src/main/res/layout/dialog_delay_cause_select.xml
+1
-1
dialog_fault_cause_select.xml
app/src/main/res/layout/dialog_fault_cause_select.xml
+1
-1
dialog_standby_select.xml
app/src/main/res/layout/dialog_standby_select.xml
+1
-1
fragment_base.xml
app/src/main/res/layout/fragment_base.xml
+0
-15
layout_map_box.xml
app/src/main/res/layout/layout_map_box.xml
+7
-11
other_annotation_layout.xml
app/src/main/res/layout/other_annotation_layout.xml
+0
-0
popup_more_features.xml
app/src/main/res/layout/popup_more_features.xml
+27
-26
status_bar_layout.xml
app/src/main/res/layout/status_bar_layout.xml
+0
-0
activity_navigation.xml
app/src/main/res/navigation/activity_navigation.xml
+0
-19
mobile_navigation.xml
app/src/main/res/navigation/mobile_navigation.xml
+0
-39
No files found.
app/build.gradle
View file @
1d65e955
...
...
@@ -56,15 +56,13 @@ dependencies {
implementation
'androidx.core:core-ktx:1.10.1'
implementation
'androidx.appcompat:appcompat:1.6.1'
implementation
'androidx.activity:activity-ktx:1.
6.1
'
implementation
'androidx.activity:activity-ktx:1.
7.2
'
implementation
'com.google.android.material:material:1.9.0'
implementation
'androidx.constraintlayout:constraintlayout:2.1.4'
implementation
'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
implementation
'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
implementation
'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation
'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation
"androidx.room:room-runtime:2.5.0"
implementation
"androidx.room:room-ktx:2.5.0"
implementation
"androidx.room:room-runtime:2.5.2"
implementation
"androidx.room:room-ktx:2.5.2"
implementation
'com.squareup.okhttp3:okhttp:4.10.0'
implementation
'com.squareup.okhttp3:logging-interceptor:4.10.0'
...
...
@@ -78,20 +76,18 @@ dependencies {
implementation
'io.github.toggery:jt808-codec:2.0.3'
implementation
'com.blankj:utilcodex:1.31.1'
implementation
'org.jetbrains.kotlin:kotlin-reflect:1.7.22'
implementation
'com.geyifeng.immersionbar:immersionbar:3.2.2'
implementation
'com.github.mik3y:usb-serial-for-android:3.5.1'
implementation
'androidx.legacy:legacy-support-v4:1.0.0'
implementation
'io.github.razerdp:BasePopup:3.2.1'
// implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1'
implementation
'com.google.android.exoplayer:exoplayer:2.17.1'
implementation
'com.afollestad.material-dialogs:core:3.2.1'
implementation
'com.google.android.exoplayer:exoplayer:2.18.7'
implementation
'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
implementation
'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
implementation
'com.squareup.retrofit2:converter-moshi:2.9.0'
implementation
"com.google.dagger:hilt-android:2.46.1"
kapt
"com.google.dagger:hilt-compiler:2.44"
kapt
"androidx.room:room-compiler:2.5.
0
"
kapt
"androidx.room:room-compiler:2.5.
1
"
testImplementation
'junit:junit:4.13.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.5'
...
...
app/src/main/AndroidManifest.xml
View file @
1d65e955
...
...
@@ -2,34 +2,52 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<!-- 文件权限 -->
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<!-- 文件权限 -->
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore=
"ScopedStorage"
/>
<uses-permission
android:name=
"android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
tools:ignore=
"ProtectedPermissions"
/>
<!-- 定位权限 -->
tools:ignore=
"ProtectedPermissions"
/>
<!-- 定位权限 -->
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<application
android:name=
".AntiCollisionApp"
android:allowBackup=
"true"
android:requestLegacyExternalStorage=
"true"
android:dataExtractionRules=
"@xml/data_extraction_rules"
android:fullBackupContent=
"@xml/backup_rules"
android:icon=
"@mipmap/waytous_logo"
android:networkSecurityConfig=
"@xml/network_security_config"
android:label=
"@string/app_name"
android:networkSecurityConfig=
"@xml/network_security_config"
android:requestLegacyExternalStorage=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.HTAnticollision"
android:usesCleartextTraffic=
"true"
tools:targetApi=
"31"
>
<activity
android:name=
".SplashActivity"
android:name=
".ui.health.HealthManagerActivity"
android:exported=
"true"
android:screenOrientation=
"landscape"
/>
<activity
android:name=
".ui.statistics.DataStatisticsActivity"
android:exported=
"true"
android:screenOrientation=
"landscape"
/>
<activity
android:name=
".ui.settings.UserSettingsActivity"
android:exported=
"true"
android:screenOrientation=
"landscape"
/>
<activity
android:name=
".ui.video.HomeVideoActivity"
android:exported=
"true"
android:screenOrientation=
"landscape"
/>
<activity
android:name=
".ui.collect.CollectActivity"
android:exported=
"true"
android:screenOrientation=
"landscape"
/>
<activity
android:name=
".ui.SplashActivity"
android:exported=
"true"
android:screenOrientation=
"landscape"
android:theme=
"@style/SplashTheme"
>
...
...
@@ -40,17 +58,9 @@
</intent-filter>
</activity>
<activity
android:name=
".ui.
Main
Activity"
android:name=
".ui.
home.Home
Activity"
android:exported=
"true"
android:screenOrientation=
"landscape"
>
<intent-filter>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
<meta-data
android:name=
"android.app.lib_name"
android:value=
""
/>
</activity>
android:screenOrientation=
"landscape"
/>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/AntiCollisionApp.kt
View file @
1d65e955
package
com.waytous.anticollision
import
android.app.Application
import
com.blankj.utilcode.util.CrashUtils
import
com.blankj.utilcode.util.LogUtils
import
com.blankj.utilcode.util.SPStaticUtils
import
com.blankj.utilcode.util.SPUtils
...
...
@@ -13,6 +14,7 @@ class AntiCollisionApp: Application(){
super
.
onCreate
()
Utils
.
init
(
this
)
LogUtils
.
getConfig
().
globalTag
=
"male"
CrashUtils
.
init
()
SPStaticUtils
.
setDefaultSPUtils
(
SPUtils
.
getInstance
(
"settings"
))
}
...
...
app/src/main/java/com/waytous/anticollision/di/ActivityViewModule.kt
deleted
100644 → 0
View file @
fdbd57de
package
com.waytous.anticollision.di
import
android.content.Context
import
android.view.LayoutInflater
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.LayoutMapBoxBinding
import
com.waytous.anticollision.databinding.PopupMoreFeaturesBinding
import
com.waytous.anticollision.databinding.PopupReportStatusBinding
import
com.waytous.anticollision.databinding.PopupWorkStatusEditBinding
import
com.waytous.anticollision.ui.view.ButtonMorePopup
import
com.waytous.anticollision.ui.view.ButtonReportStatusPopup
import
com.waytous.anticollision.ui.view.ButtonWorkStatusPopup
import
dagger.Module
import
dagger.Provides
import
dagger.hilt.InstallIn
import
dagger.hilt.android.components.ActivityComponent
import
dagger.hilt.android.qualifiers.ActivityContext
import
dagger.hilt.android.scopes.ActivityScoped
@InstallIn
(
ActivityComponent
::
class
)
@Module
object
ActivityViewModule
{
@ActivityScoped
@Provides
fun
provideMapBoxInflater
(
@ActivityContext
context
:
Context
):
LayoutMapBoxBinding
{
val
layoutInflater
=
LayoutInflater
.
from
(
context
).
also
{
it
.
inflate
(
R
.
layout
.
layout_map_box
,
null
)
}
return
LayoutMapBoxBinding
.
inflate
(
layoutInflater
,
null
,
false
)
}
@ActivityScoped
@Provides
fun
provideButtonMorePopupWindowInflater
(
@ActivityContext
context
:
Context
):
PopupMoreFeaturesBinding
{
val
layoutInflater
=
LayoutInflater
.
from
(
context
).
also
{
it
.
inflate
(
R
.
layout
.
popup_more_features
,
null
)
}
return
PopupMoreFeaturesBinding
.
inflate
(
layoutInflater
,
null
,
false
)
}
@ActivityScoped
@Provides
fun
provideReportStatusPopupWindowInflater
(
@ActivityContext
context
:
Context
):
PopupReportStatusBinding
{
val
layoutInflater
=
LayoutInflater
.
from
(
context
).
also
{
it
.
inflate
(
R
.
layout
.
popup_report_status
,
null
)
}
return
PopupReportStatusBinding
.
inflate
(
layoutInflater
,
null
,
false
)
}
@ActivityScoped
@Provides
fun
provideWorkStatusEditPopupWindowInflater
(
@ActivityContext
context
:
Context
):
PopupWorkStatusEditBinding
{
val
layoutInflater
=
LayoutInflater
.
from
(
context
).
also
{
it
.
inflate
(
R
.
layout
.
popup_work_status_edit
,
null
)
}
return
PopupWorkStatusEditBinding
.
inflate
(
layoutInflater
,
null
,
false
)
}
@ActivityScoped
@Provides
fun
provideButtonMorePopupWindow
(
@ActivityContext
context
:
Context
,
binding
:
PopupMoreFeaturesBinding
):
ButtonMorePopup
{
return
ButtonMorePopup
(
context
,
binding
)
}
@ActivityScoped
@Provides
fun
provideButtonReportStatusPopupWindow
(
@ActivityContext
context
:
Context
,
binding
:
PopupReportStatusBinding
):
ButtonReportStatusPopup
{
return
ButtonReportStatusPopup
(
context
,
binding
)
}
@ActivityScoped
@Provides
fun
provideButtonWorkStatusEditPopupWindow
(
@ActivityContext
context
:
Context
,
binding
:
PopupWorkStatusEditBinding
):
ButtonWorkStatusPopup
{
return
ButtonWorkStatusPopup
(
context
,
binding
)
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/di/Fragment
View
Module.kt
→
app/src/main/java/com/waytous/anticollision/di/FragmentModule.kt
View file @
1d65e955
...
...
@@ -3,20 +3,30 @@ package com.waytous.anticollision.di
import
android.content.Context
import
android.view.LayoutInflater
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.LayoutMapBoxBinding
import
com.waytous.anticollision.databinding.RadioTabCollectBinding
import
com.waytous.anticollision.databinding.RadioTabSettingsBinding
import
dagger.Module
import
dagger.Provides
import
dagger.hilt.InstallIn
import
dagger.hilt.android.components.
Fragment
Component
import
dagger.hilt.android.components.
Activity
Component
import
dagger.hilt.android.qualifiers.ActivityContext
import
dagger.hilt.android.scopes.
Fragment
Scoped
import
dagger.hilt.android.scopes.
Activity
Scoped
@InstallIn
(
Fragment
Component
::
class
)
@InstallIn
(
Activity
Component
::
class
)
@Module
object
Fragment
View
Module
{
object
FragmentModule
{
@FragmentScoped
@ActivityScoped
@Provides
fun
provideMapBoxInflater
(
@ActivityContext
context
:
Context
):
LayoutMapBoxBinding
{
val
layoutInflater
=
LayoutInflater
.
from
(
context
).
also
{
it
.
inflate
(
R
.
layout
.
layout_map_box
,
null
)
}
return
LayoutMapBoxBinding
.
inflate
(
layoutInflater
,
null
,
false
)
}
@ActivityScoped
@Provides
fun
provideRadioTabCollect
(
@ActivityContext
context
:
Context
):
RadioTabCollectBinding
{
val
layoutInflater
=
LayoutInflater
.
from
(
context
).
also
{
...
...
@@ -25,7 +35,7 @@ object FragmentViewModule {
return
RadioTabCollectBinding
.
inflate
(
layoutInflater
,
null
,
false
)
}
@
Fragment
Scoped
@
Activity
Scoped
@Provides
fun
provideRadioTabSettings
(
@ActivityContext
context
:
Context
):
RadioTabSettingsBinding
{
val
layoutInflater
=
LayoutInflater
.
from
(
context
).
also
{
...
...
app/src/main/java/com/waytous/anticollision/di/NetworkModule.kt
View file @
1d65e955
...
...
@@ -4,6 +4,8 @@ import com.squareup.moshi.Moshi
import
com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import
com.waytous.anticollision.data.api.ApiConstants
import
com.waytous.anticollision.data.api.MapApiService
import
com.waytous.anticollision.repository.MainRepository
import
com.waytous.anticollision.ui.MainViewModel
import
dagger.Module
import
dagger.Provides
import
dagger.hilt.InstallIn
...
...
@@ -46,4 +48,8 @@ object NetworkModule {
@Provides
fun
provideMapApiService
(
retrofit
:
Retrofit
):
MapApiService
=
retrofit
.
create
(
MapApiService
::
class
.
java
)
@Provides
fun
provideMainRepository
(
mapApiService
:
MapApiService
):
MainRepository
=
MainRepository
(
mapApiService
)
@Provides
fun
provideMainViewModel
(
repository
:
MainRepository
)
=
MainViewModel
(
repository
)
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/MainActivity.kt
deleted
100644 → 0
View file @
fdbd57de
This diff is collapsed.
Click to expand it.
app/src/main/java/com/waytous/anticollision/ui/MainModel.kt
→
app/src/main/java/com/waytous/anticollision/ui/Main
View
Model.kt
View file @
1d65e955
package
com.waytous.anticollision.ui
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
com.mapbox.geojson.Point
import
com.mapbox.maps.CameraOptions
import
com.waytous.anticollision.BuildConfig
import
com.waytous.anticollision.bean.MapDataSource
import
com.waytous.anticollision.repository.MainRepository
import
com.waytous.anticollision.utils.
LATITUD
E
import
com.waytous.anticollision.
utils.LONGITUDE
import
com.waytous.anticollision.utils.
TRUCK_PATH_SOURC
E
import
com.waytous.anticollision.
vo.VehicleLocationInfo
import
dagger.hilt.android.lifecycle.HiltViewModel
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.ExperimentalCoroutinesApi
import
kotlinx.coroutines.flow.MutableStateFlow
import
kotlinx.coroutines.flow.StateFlow
import
kotlinx.coroutines.flow.flattenMerge
import
kotlinx.coroutines.flow.flow
import
kotlinx.coroutines.flow.flowOf
import
kotlinx.coroutines.flow.flowOn
import
kotlinx.coroutines.flow.stateIn
import
kotlinx.coroutines.launch
import
java.math.BigDecimal
import
javax.inject.Inject
@HiltViewModel
class
MainModel
@Inject
constructor
(
private
val
mainRepository
:
MainRepository
)
:
ViewModel
()
{
class
Main
View
Model
@Inject
constructor
(
private
val
mainRepository
:
MainRepository
)
:
ViewModel
()
{
val
zoom
:
MutableLiveData
<
BigDecimal
>
by
lazy
{
MutableLiveData
(
BigDecimal
(
16.0
))
}
private
val
_cameraOptions
=
MutableStateFlow
(
CameraOptions
.
Builder
()
.
center
(
Point
.
fromLngLat
(
BuildConfig
.
DEFAULT_LONGITUDE
,
BuildConfig
.
DEFAULT_LATITUDE
))
.
zoom
(
DEFAULT_ZOOM_VALUE
.
toDouble
())
.
build
()
)
val
center
:
MutableLiveData
<
Point
>
by
lazy
{
MutableLiveData
(
Point
.
fromLngLat
(
LONGITUDE
,
LATITUDE
))
}
val
cameraOptions
:
StateFlow
<
CameraOptions
>
=
_cameraOptions
private
val
_obstaclesSource
=
MutableStateFlow
(
MapDataSource
())
val
obstaclesSource
:
StateFlow
<
MapDataSource
>
=
_obstaclesSource
private
val
_electronicFence
=
MutableStateFlow
(
MapDataSource
())
val
electronicFence
:
StateFlow
<
MapDataSource
>
=
_electronicFence
private
val
_wetArea
=
MutableStateFlow
(
MapDataSource
())
val
wetArea
:
StateFlow
<
MapDataSource
>
=
_wetArea
private
val
_laneNode
=
MutableStateFlow
(
MapDataSource
())
val
laneNode
:
StateFlow
<
MapDataSource
>
=
_laneNode
private
val
_lane
=
MutableStateFlow
(
MapDataSource
())
val
lane
:
StateFlow
<
MapDataSource
>
=
_lane
private
val
_runnableArea
=
MutableStateFlow
(
MapDataSource
())
val
runnableArea
:
StateFlow
<
MapDataSource
>
=
_runnableArea
private
val
_dumpArea
=
MutableStateFlow
(
MapDataSource
())
val
dumpArea
:
StateFlow
<
MapDataSource
>
=
_dumpArea
private
val
_diggingWorkArea
=
MutableStateFlow
(
MapDataSource
())
val
diggingWorkArea
:
StateFlow
<
MapDataSource
>
=
_diggingWorkArea
private
val
_barricade
=
MutableStateFlow
(
MapDataSource
())
val
barricade
:
StateFlow
<
MapDataSource
>
=
_barricade
private
val
_stationArea
=
MutableStateFlow
(
MapDataSource
())
val
stationArea
:
StateFlow
<
MapDataSource
>
=
_stationArea
private
val
_parkSpot
=
MutableStateFlow
(
MapDataSource
())
val
parkSpot
:
StateFlow
<
MapDataSource
>
=
_parkSpot
private
val
_staticObjects
=
MutableStateFlow
(
MapDataSource
())
val
staticObjects
:
StateFlow
<
MapDataSource
>
=
_staticObjects
private
val
_truckPathSource
=
MutableStateFlow
(
MapDataSource
(
TRUCK_PATH_SOURCE
))
val
truckPathSource
:
StateFlow
<
MapDataSource
>
=
_truckPathSource
init
{
viewModelScope
.
launch
{
mainRepository
.
remoteObstaclesVersion
().
collect
{
...
...
@@ -138,21 +171,55 @@ class MainModel @Inject constructor(private val mainRepository: MainRepository)
}
}
}
viewModelScope
.
launch
{
flow
{
emit
(
_cameraOptions
.
value
)
}
}
}
@OptIn
(
ExperimentalCoroutinesApi
::
class
)
suspend
fun
loadMapDataSource
()
=
flowOf
(
_obstaclesSource
,
_electronicFence
,
_wetArea
,
_laneNode
,
_lane
,
_runnableArea
,
_dumpArea
,
_diggingWorkArea
,
_barricade
,
_stationArea
,
_parkSpot
,
_staticObjects
mainRepository
.
remoteObstaclesVersion
(),
mainRepository
.
remoteElectronicFenceVersion
(),
mainRepository
.
remoteWetAreaVersion
(),
mainRepository
.
remoteLaneNodeVersion
(),
mainRepository
.
remoteLaneVersion
(),
mainRepository
.
remoteRunnableAreaVersion
(),
mainRepository
.
remoteDumpAreaVersion
(),
mainRepository
.
remoteDiggingWorkAreaVersion
(),
mainRepository
.
remoteBarricadeVersion
(),
mainRepository
.
remoteStationAreaVersion
(),
mainRepository
.
remoteParkSpotVersion
(),
mainRepository
.
remoteStaticObjectsVersion
(),
flowOf
(
MapDataSource
(
TRUCK_PATH_SOURCE
)),
).
flattenMerge
().
stateIn
(
viewModelScope
)
suspend
fun
updateAroundVehicles
(
vehicleInfo
:
List
<
VehicleLocationInfo
>)
=
flow
{
emit
(
vehicleInfo
)
}.
flowOn
(
Dispatchers
.
IO
).
stateIn
(
viewModelScope
)
fun
updateZoom
(
zoom
:
BigDecimal
){
when
{
zoom
.
compareTo
(
MIN_ZOOM_VALUE
)
==
-
1
->{
_cameraOptions
.
value
=
_cameraOptions
.
value
.
toBuilder
().
zoom
(
MIN_ZOOM_VALUE
.
toDouble
()).
build
()
}
zoom
.
compareTo
(
MAX_ZOOM_VALUE
)
==
1
->{
_cameraOptions
.
value
=
_cameraOptions
.
value
.
toBuilder
().
zoom
(
MAX_ZOOM_VALUE
.
toDouble
()).
build
()
}
else
->{
_cameraOptions
.
value
=
_cameraOptions
.
value
.
toBuilder
().
zoom
(
zoom
.
toDouble
()).
build
()
}
}
}
companion
object
{
val
DEFAULT_ZOOM_VALUE
=
BigDecimal
(
"14.0"
)
val
MAX_ZOOM_VALUE
=
BigDecimal
(
"22.0"
)
val
MIN_ZOOM_VALUE
=
BigDecimal
(
"8.0"
)
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/SplashActivity.kt
→
app/src/main/java/com/waytous/anticollision/
ui/
SplashActivity.kt
View file @
1d65e955
package
com.waytous.anticollision
package
com.waytous.anticollision
.ui
import
android.content.Intent
import
android.os.Bundle
import
androidx.appcompat.app.AppCompatActivity
import
com.blankj.utilcode.util.BarUtils
import
com.blankj.utilcode.util.ColorUtils
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.ActivitySplashBinding
import
com.waytous.anticollision.ui.
Main
Activity
import
com.waytous.anticollision.ui.
home.Home
Activity
class
SplashActivity
:
AppCompatActivity
()
{
...
...
@@ -25,7 +26,7 @@ class SplashActivity : AppCompatActivity() {
binding
.
loadingProgressBar
.
progress
=
57
binding
.
loadingProgressBar
.
show
()
binding
.
loadingProgressBar
.
postDelayed
({
startActivity
(
Intent
(
this
,
Main
Activity
::
class
.
java
))
startActivity
(
Intent
(
this
,
Home
Activity
::
class
.
java
))
},
2000
)
}
...
...
app/src/main/java/com/waytous/anticollision/ui/collect/Collect
Fragment
.kt
→
app/src/main/java/com/waytous/anticollision/ui/collect/Collect
Activity
.kt
View file @
1d65e955
package
com.waytous.anticollision.ui.collect
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.AdapterView
import
android.widget.AdapterView.OnItemSelectedListener
import
androidx.fragment.app.Fragment
import
androidx.navigation.fragment.findNavController
import
androidx.appcompat.app.AppCompatActivity
import
com.blankj.utilcode.util.BarUtils
import
com.blankj.utilcode.util.LogUtils
import
com.blankj.utilcode.util.ScreenUtils
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.FragmentCollectBinding
import
com.waytous.anticollision.databinding.LayoutMapBoxBinding
import
com.waytous.anticollision.databinding.ActivityCollectBinding
import
com.waytous.anticollision.databinding.RadioTabCollectBinding
import
com.waytous.anticollision.databinding.RadioTabSettingsBinding
import
com.waytous.anticollision.ui.MainViewModel
import
com.waytous.anticollision.utils.setupMapBox
import
dagger.hilt.android.AndroidEntryPoint
import
javax.inject.Inject
@AndroidEntryPoint
class
Collect
Fragment
:
Fragment
()
{
class
Collect
Activity
:
AppCompatActivity
()
{
private
var
_binding
:
FragmentCollectBinding
?
=
null
lateinit
var
binding
:
ActivityCollectBinding
@Inject
lateinit
var
mapBoxBinding
:
LayoutMapBoxBinding
lateinit
var
mainViewModel
:
MainViewModel
@Inject
lateinit
var
tabCollectBinding
:
RadioTabCollectBinding
@Inject
lateinit
var
tabSettingsBinding
:
RadioTabSettingsBinding
private
val
itemSelectedListener
by
lazy
{
object
:
OnItemSelectedListener
{
object
:
AdapterView
.
OnItemSelectedListener
{
override
fun
onItemSelected
(
parent
:
AdapterView
<*>?,
view
:
View
?,
...
...
@@ -53,7 +53,6 @@ class CollectFragment : Fragment() {
}
}
private
val
binding
get
()
=
_binding
!!
private
val
iconCalibrates
by
lazy
{
listOf
(
tabCollectBinding
.
vehicleLeftFrontWheel
,
...
...
@@ -65,31 +64,27 @@ class CollectFragment : Fragment() {
tabCollectBinding
.
vehicleBackAxleCenter
)
}
override
fun
onCreate
View
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
{
_binding
=
FragmentCollectBinding
.
inflate
(
inflater
,
container
,
false
)
context
?:
return
binding
.
root
binding
.
collectMapWrapper
.
addView
(
mapBoxBinding
.
root
)
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
ScreenUtils
.
setFullScreen
(
this
)
BarUtils
.
setNavBarVisibility
(
this
,
false
)
binding
=
ActivityCollectBinding
.
inflate
(
layoutInflater
)
setContentView
(
binding
.
root
)
binding
.
titleBar
.
statusBarDriverInfo
.
visibility
=
View
.
VISIBLE
initTabLayout
()
binding
.
collectTabBtnToHome
.
setOnClickListener
{
findNavController
().
navigate
(
R
.
id
.
navigation_home
)
}
return
binding
.
root
setupMapBox
(
binding
.
mapContainer
,
mainViewModel
)
}
private
fun
initTabLayout
(){
binding
.
collectT
abContent
.
addView
(
tabCollectBinding
.
root
)
binding
.
t
abContent
.
addView
(
tabCollectBinding
.
root
)
tabCollectBinding
.
collectSpinnerVehicleParts
.
onItemSelectedListener
=
itemSelectedListener
binding
.
collectRadioGroup
.
setOnCheckedChangeListener
{
_
,
checkedId
->
binding
.
collectT
abContent
.
removeAllViews
()
if
(
checkedId
==
R
.
id
.
collectT
abCollect
)
{
binding
.
collectT
abContent
.
addView
(
tabCollectBinding
.
root
)
binding
.
tabContainer
.
setOnCheckedChangeListener
{
_
,
checkedId
->
binding
.
t
abContent
.
removeAllViews
()
if
(
checkedId
==
R
.
id
.
t
abCollect
)
{
binding
.
t
abContent
.
addView
(
tabCollectBinding
.
root
)
}
else
{
binding
.
collectT
abContent
.
addView
(
tabSettingsBinding
.
root
)
binding
.
t
abContent
.
addView
(
tabSettingsBinding
.
root
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/health/HealthManagerActivity.kt
0 → 100644
View file @
1d65e955
package
com.waytous.anticollision.ui.health
import
android.os.Bundle
import
androidx.appcompat.app.AppCompatActivity
import
com.waytous.anticollision.R
class
HealthManagerActivity
:
AppCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_health_manager
)
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/health/HealthMangerFragment.kt
deleted
100644 → 0
View file @
fdbd57de
package
com.waytous.anticollision.ui.health
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
com.waytous.anticollision.R
class
HealthMangerFragment
:
Fragment
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
// Inflate the layout for this fragment
return
inflater
.
inflate
(
R
.
layout
.
fragment_health_manger
,
container
,
false
)
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/home/HomeActivity.kt
0 → 100644
View file @
1d65e955
package
com.waytous.anticollision.ui.home
import
android.os.Bundle
import
android.view.View
import
android.view.View.OnClickListener
import
androidx.appcompat.app.AppCompatActivity
import
com.blankj.utilcode.util.BarUtils
import
com.blankj.utilcode.util.ScreenUtils
import
com.waytous.anticollision.databinding.ActivityHomeBinding
import
com.waytous.anticollision.ui.MainViewModel
import
com.waytous.anticollision.ui.view.ButtonMorePopup
import
com.waytous.anticollision.ui.view.ButtonReportStatusPopup
import
com.waytous.anticollision.ui.view.ButtonWorkStatusPopup
import
com.waytous.anticollision.utils.setupMapBox
import
dagger.hilt.android.AndroidEntryPoint
import
javax.inject.Inject
@AndroidEntryPoint
class
HomeActivity
:
AppCompatActivity
(),
OnClickListener
{
private
lateinit
var
binding
:
ActivityHomeBinding
@Inject
lateinit
var
mainViewModel
:
MainViewModel
lateinit
var
popupMoreFeatures
:
ButtonMorePopup
lateinit
var
popupWorkStatusEdit
:
ButtonWorkStatusPopup
lateinit
var
popupReportStatus
:
ButtonReportStatusPopup
companion
object
{
private
val
scaleLengths
=
listOf
(
5
,
10
,
20
,
50
,
100
,
200
,
500
,
1000
,
2000
,
5000
,
10000
,
20000
,
50000
,
100000
,
200000
,
500000
,
1000000
,
2000000
)
const
val
MINIMUM_ZOOM_LEVEL
=
11.0
const
val
MAXIMUM_ZOOM_LEVEL
=
26.0
const
val
DEFAULT_ZOOM_LEVEL
=
14.0
}
// fun addTempAnnotations() {
// val otherAnnotation = VehicleLocationInfo(
// "KK-01", 36, 25,
// Point.fromLngLat(LONGITUDE, LATITUDE), true
// )
// updateCurrentVehicleAnnotation(otherAnnotation)
// val otherAnnotation1 =
// VehicleLocationInfo("KK-02", 24, 25, Point.fromLngLat(119.76739, 49.37722), true)
// val otherAnnotation2 =
// VehicleLocationInfo("KK-03", 36, 20, Point.fromLngLat(119.75694, 49.38632), true)
// val others = listOf(otherAnnotation1, otherAnnotation2)
// addOtherVehicleAnnotations(others)
// }
// private fun initAnnotationManager() {
// viewAnnotationManager = mapBinding.mapView.viewAnnotationManager
// pointAnnotationManager =
// mapBinding.mapView.annotations.createPointAnnotationManager(
// AnnotationConfig(TRUCK_PATH_LAYER)
// )
// }
// fun updateCurrentVehicleAnnotation(otherAnnotation: VehicleLocationInfo) {
// val pointAnnotationOptions: PointAnnotationOptions = PointAnnotationOptions()
// .withPoint(otherAnnotation.point)
// .withIconImage(iconCurrentNormalVehicleBitmap!!)
// .withIconSize(0.25)
// .withIconAnchor(IconAnchor.BOTTOM)
// .withDraggable(false)
// val pointAnnotation = pointAnnotationManager.create(pointAnnotationOptions)
// pointAnnotation.symbolSortKey = Double.MAX_VALUE
// val viewAnnotation = viewAnnotationManager.addViewAnnotation(
// resId = R.layout.current_annotation_layout,
// options = viewAnnotationOptions {
// geometry(otherAnnotation.point)
// associatedFeatureId(pointAnnotation.featureIdentifier)
// anchor(ViewAnnotationAnchor.BOTTOM)
// offsetY((pointAnnotation.iconImageBitmap?.height!! * 0.25).toInt())
// allowOverlap(true)
// }
// )
// val binding = CurrentAnnotationLayoutBinding.bind(viewAnnotation)
// binding.annotationCurrentVehicleNo.text =
// getString(R.string.annotation_vehicle_no, "KK-001")
// binding.annotationCurrentVehicleSpeed.text =
// getString(R.string.annotation_vehicle_speed, 36)
// }
//
// fun addOtherVehicleAnnotations(others: List<VehicleLocationInfo>) {
// others.forEach { vehicle ->
// val pointAnnotationOptions: PointAnnotationOptions = PointAnnotationOptions()
// .withPoint(vehicle.point)
// .withIconImage(iconOtherAlarmVehicleBitmap!!)
// .withIconSize(0.25)
// .withIconAnchor(IconAnchor.BOTTOM)
// .withDraggable(false)
// val pointAnnotation = pointAnnotationManager.create(pointAnnotationOptions)
// pointAnnotation.symbolSortKey = Double.MAX_VALUE
// val viewAnnotation = viewAnnotationManager.addViewAnnotation(
// resId = R.layout.other_annotation_layout,
// options = viewAnnotationOptions {
// geometry(vehicle.point)
// associatedFeatureId(pointAnnotation.featureIdentifier)
// anchor(ViewAnnotationAnchor.BOTTOM)
// offsetY((pointAnnotation.iconImageBitmap?.height!! * 0.25).toInt())
// allowOverlap(true)
// }
// )
// val binding = OtherAnnotationLayoutBinding.bind(viewAnnotation)
// binding.annotationOtherVehicleNo.text = getString(R.string.annotation_vehicle_no, vehicle.vehicleNo)
// binding.annotationOtherVehicleSpeed.text = vehicle.speed.toString()
// binding.annotationOtherVehicleDistance.text = vehicle.distance.toString()
// }
// }
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
ScreenUtils
.
setFullScreen
(
this
)
BarUtils
.
setNavBarVisibility
(
this
,
false
)
binding
=
ActivityHomeBinding
.
inflate
(
layoutInflater
)
setContentView
(
binding
.
root
)
binding
.
titleBar
.
statusBarDriverInfo
.
visibility
=
View
.
GONE
initPopupWindow
()
binding
.
more
.
setOnClickListener
(
this
)
binding
.
workStatusEdit
.
setOnClickListener
(
this
)
binding
.
statusReport
.
setOnClickListener
(
this
)
setupMapBox
(
binding
.
mapContainer
,
mainViewModel
)
}
private
fun
initPopupWindow
(){
popupMoreFeatures
=
ButtonMorePopup
(
this
).
also
{
it
.
bindLifecycleOwner
(
this
)
}
popupWorkStatusEdit
=
ButtonWorkStatusPopup
(
this
).
also
{
it
.
bindLifecycleOwner
(
this
)
}
popupReportStatus
=
ButtonReportStatusPopup
(
this
).
also
{
it
.
bindLifecycleOwner
(
this
)
}
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
)
{
binding
.
more
->{
popupMoreFeatures
.
showPopupWindow
(
binding
.
more
)
}
binding
.
workStatusEdit
->{
popupWorkStatusEdit
.
showPopupWindow
(
binding
.
workStatusLayout
)
}
binding
.
statusReport
->{
popupReportStatus
.
showPopupWindow
(
binding
.
statusReport
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/home/HomeNoVideoFragment.kt
deleted
100644 → 0
View file @
fdbd57de
package
com.waytous.anticollision.ui.home
import
android.os.Bundle
import
android.text.SpannableString
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.ViewModelProvider
import
com.blankj.utilcode.util.BarUtils
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.FragmentNoVideoHomeBinding
import
com.waytous.anticollision.databinding.LayoutMapBoxBinding
import
com.waytous.anticollision.ui.view.ButtonMorePopup
import
com.waytous.anticollision.ui.view.ButtonReportStatusPopup
import
com.waytous.anticollision.ui.view.ButtonWorkStatusPopup
import
com.waytous.anticollision.utils.setTextSize
import
dagger.hilt.android.AndroidEntryPoint
import
javax.inject.Inject
@AndroidEntryPoint
class
HomeNoVideoFragment
:
Fragment
()
{
private
var
_binding
:
FragmentNoVideoHomeBinding
?
=
null
private
val
binding
get
()
=
_binding
!!
@Inject
lateinit
var
mapBoxBinding
:
LayoutMapBoxBinding
@Inject
lateinit
var
popupMoreFeatures
:
ButtonMorePopup
@Inject
lateinit
var
popupWorkStatusEdit
:
ButtonWorkStatusPopup
@Inject
lateinit
var
popupReportStatus
:
ButtonReportStatusPopup
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
{
BarUtils
.
setNavBarVisibility
(
requireActivity
(),
false
)
val
homeViewModel
=
ViewModelProvider
(
this
)[
HomeViewModel
::
class
.
java
]
_binding
=
FragmentNoVideoHomeBinding
.
inflate
(
inflater
,
container
,
false
)
context
?:
return
binding
.
root
binding
.
noVideoMapWrapper
.
addView
(
mapBoxBinding
.
root
)
setTodayCarriedNum
(
18
)
setTodayIllegallyNum
(
1
)
binding
.
workStatusEdit
.
setOnClickListener
{
popupWorkStatusEdit
.
showPopupWindow
(
binding
.
defaultCurrentWorkStatusLayout
)
}
binding
.
defaultToggleMore
.
setOnClickListener
{
popupMoreFeatures
.
showPopupWindow
(
binding
.
defaultToggleMore
)
}
binding
.
defaultReportStatus
.
setOnClickListener
{
popupReportStatus
.
showPopupWindow
(
binding
.
defaultReportStatus
)
}
return
binding
.
root
}
private
fun
setTodayCarriedNum
(
num
:
Int
)
{
val
templateString
=
getString
(
R
.
string
.
today_carried_text
,
num
)
val
spannableString
=
SpannableString
(
templateString
)
binding
.
todayCarried
.
setTextSize
(
spannableString
,
templateString
,
"今日运载(车)"
)
}
private
fun
setTodayIllegallyNum
(
num
:
Int
)
{
val
templateString
=
getString
(
R
.
string
.
today_illegally_text
,
num
)
val
spannableString
=
SpannableString
(
templateString
)
binding
.
illegallyNum
.
setTextSize
(
spannableString
,
templateString
,
"违章/警告(次)"
)
}
override
fun
onDestroyView
()
{
super
.
onDestroyView
()
_binding
=
null
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/settings/UserSettingsActivity.kt
0 → 100644
View file @
1d65e955
package
com.waytous.anticollision.ui.settings
import
android.os.Bundle
import
androidx.appcompat.app.AppCompatActivity
import
com.blankj.utilcode.util.BarUtils
import
com.blankj.utilcode.util.ScreenUtils
import
com.waytous.anticollision.databinding.ActivityUserSettingsBinding
class
UserSettingsActivity
:
AppCompatActivity
()
{
lateinit
var
binding
:
ActivityUserSettingsBinding
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
ScreenUtils
.
setFullScreen
(
this
)
BarUtils
.
setNavBarVisibility
(
this
,
false
)
binding
=
ActivityUserSettingsBinding
.
inflate
(
layoutInflater
)
setContentView
(
binding
.
root
)
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/settings/UserSettingsFragment.kt
deleted
100644 → 0
View file @
fdbd57de
package
com.waytous.anticollision.ui.settings
import
androidx.lifecycle.ViewModelProvider
import
android.os.Bundle
import
androidx.fragment.app.Fragment
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
com.waytous.anticollision.R
class
UserSettingsFragment
:
Fragment
()
{
companion
object
{
fun
newInstance
()
=
UserSettingsFragment
()
}
private
lateinit
var
viewModel
:
UserSettingsViewModel
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
return
inflater
.
inflate
(
R
.
layout
.
fragment_user_settings
,
container
,
false
)
}
override
fun
onActivityCreated
(
savedInstanceState
:
Bundle
?)
{
super
.
onActivityCreated
(
savedInstanceState
)
viewModel
=
ViewModelProvider
(
this
)[
UserSettingsViewModel
::
class
.
java
]
// TODO: Use the ViewModel
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/statistics/DataStatisticsActivity.kt
0 → 100644
View file @
1d65e955
package
com.waytous.anticollision.ui.statistics
import
android.os.Bundle
import
androidx.appcompat.app.AppCompatActivity
import
com.waytous.anticollision.R
class
DataStatisticsActivity
:
AppCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_data_statistics
)
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/statistics/DataStatisticsFragment.kt
deleted
100644 → 0
View file @
fdbd57de
package
com.waytous.anticollision.ui.statistics
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
com.waytous.anticollision.databinding.FragmentDataStatisticsBinding
class
DataStatisticsFragment
:
Fragment
()
{
private
lateinit
var
binding
:
FragmentDataStatisticsBinding
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
binding
=
FragmentDataStatisticsBinding
.
inflate
(
inflater
)
return
binding
.
root
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/video/HomeVideoActivity.kt
0 → 100644
View file @
1d65e955
package
com.waytous.anticollision.ui.video
import
android.net.Uri
import
android.os.Bundle
import
android.text.SpannableString
import
android.view.View
import
androidx.appcompat.app.AppCompatActivity
import
com.blankj.utilcode.util.BarUtils
import
com.blankj.utilcode.util.ScreenUtils
import
com.google.android.exoplayer2.ExoPlayer
import
com.google.android.exoplayer2.MediaItem
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.ActivityHomeVideoBinding
import
com.waytous.anticollision.ui.MainViewModel
import
com.waytous.anticollision.ui.view.ButtonMorePopup
import
com.waytous.anticollision.ui.view.ButtonReportStatusPopup
import
com.waytous.anticollision.ui.view.ButtonWorkStatusPopup
import
com.waytous.anticollision.utils.setTextSize
import
com.waytous.anticollision.utils.setupMapBox
import
java.io.File
import
javax.inject.Inject
class
HomeVideoActivity
:
AppCompatActivity
(),
View
.
OnClickListener
{
private
lateinit
var
binding
:
ActivityHomeVideoBinding
@Inject
lateinit
var
mainViewModel
:
MainViewModel
lateinit
var
popupMoreFeatures
:
ButtonMorePopup
lateinit
var
popupWorkStatusEdit
:
ButtonWorkStatusPopup
lateinit
var
popupReportStatus
:
ButtonReportStatusPopup
private
var
player1
:
ExoPlayer
?
=
null
private
var
player2
:
ExoPlayer
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
ScreenUtils
.
setFullScreen
(
this
)
BarUtils
.
setNavBarVisibility
(
this
,
false
)
binding
=
ActivityHomeVideoBinding
.
inflate
(
layoutInflater
)
setContentView
(
binding
.
root
)
binding
.
titleBar
.
statusBarDriverInfo
.
visibility
=
View
.
VISIBLE
val
templateString
=
getString
(
R
.
string
.
current_speed
,
36
)
val
spannableString
=
SpannableString
(
templateString
)
binding
.
speedText
.
setTextSize
(
spannableString
,
templateString
)
initPlayer
()
initPopupWindow
()
binding
.
more
.
setOnClickListener
(
this
)
binding
.
workStatusEdit
.
setOnClickListener
(
this
)
binding
.
reportStatus
.
setOnClickListener
(
this
)
setupMapBox
(
binding
.
mapContainer
,
mainViewModel
)
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
)
{
binding
.
more
->{
popupMoreFeatures
.
showPopupWindow
(
binding
.
more
)
}
binding
.
workStatusEdit
->{
popupWorkStatusEdit
.
showPopupWindow
(
binding
.
workStatusLayout
)
}
binding
.
reportStatus
->{
popupReportStatus
.
showPopupWindow
(
binding
.
reportStatus
)
}
}
}
private
fun
initPopupWindow
(){
popupMoreFeatures
=
ButtonMorePopup
(
this
).
also
{
it
.
bindLifecycleOwner
(
this
)
}
popupWorkStatusEdit
=
ButtonWorkStatusPopup
(
this
).
also
{
it
.
bindLifecycleOwner
(
this
)
}
popupReportStatus
=
ButtonReportStatusPopup
(
this
).
also
{
it
.
bindLifecycleOwner
(
this
)
}
}
private
fun
initPlayer
()
{
val
uri1
=
Uri
.
fromFile
(
File
(
filesDir
,
"飞书20230420-181456.mp4"
))
player1
=
ExoPlayer
.
Builder
(
this
).
build
().
apply
{
setMediaItem
(
MediaItem
.
Builder
().
setUri
(
uri1
).
build
())
}
binding
.
videoView1
.
player
=
player1
player1
?.
prepare
()
val
uri2
=
Uri
.
fromFile
(
File
(
filesDir
,
"飞书20230420-181512.mp4"
))
player2
=
ExoPlayer
.
Builder
(
this
).
build
().
apply
{
setMediaItem
(
MediaItem
.
Builder
().
setUri
(
uri2
).
build
())
}
binding
.
videoView2
.
player
=
player2
player2
?.
prepare
()
player1
?.
play
()
player2
?.
play
()
}
override
fun
onDestroy
()
{
player1
?.
release
()
player2
?.
release
()
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/video/HomeVideoFragment.kt
deleted
100644 → 0
View file @
fdbd57de
package
com.waytous.anticollision.ui.video
import
android.net.Uri
import
android.os.Bundle
import
android.text.SpannableString
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.viewModels
import
com.google.android.exoplayer2.ExoPlayer
import
com.google.android.exoplayer2.MediaItem
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.FragmentVideoHomeBinding
import
com.waytous.anticollision.databinding.LayoutMapBoxBinding
import
com.waytous.anticollision.ui.view.ButtonMorePopup
import
com.waytous.anticollision.ui.view.ButtonReportStatusPopup
import
com.waytous.anticollision.ui.view.ButtonWorkStatusPopup
import
com.waytous.anticollision.utils.setTextSize
import
dagger.hilt.android.AndroidEntryPoint
import
java.io.File
import
javax.inject.Inject
@AndroidEntryPoint
class
HomeVideoFragment
:
Fragment
()
{
private
lateinit
var
binding
:
FragmentVideoHomeBinding
@Inject
lateinit
var
mapBoxBinding
:
LayoutMapBoxBinding
@Inject
lateinit
var
popupMoreFeatures
:
ButtonMorePopup
@Inject
lateinit
var
popupWorkStatusEdit
:
ButtonWorkStatusPopup
@Inject
lateinit
var
popupReportStatus
:
ButtonReportStatusPopup
private
var
player1
:
ExoPlayer
?
=
null
private
var
player2
:
ExoPlayer
?
=
null
private
val
viewModel
:
VideoHomeViewModel
by
viewModels
()
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
binding
=
FragmentVideoHomeBinding
.
inflate
(
inflater
,
container
,
false
)
context
?:
return
binding
.
root
val
templateString
=
getString
(
R
.
string
.
current_speed
,
36
)
val
spannableString
=
SpannableString
(
templateString
)
binding
.
workStatusEdit
.
setOnClickListener
{
popupWorkStatusEdit
.
showPopupWindow
(
binding
.
currentWorkStatusLayout
)
}
binding
.
speedText
.
setTextSize
(
spannableString
,
templateString
)
binding
.
videoMapWrapper
.
addView
(
mapBoxBinding
.
root
)
initPlayer
()
binding
.
toggleMore
.
setOnClickListener
{
popupMoreFeatures
.
showPopupWindow
(
it
)
}
return
binding
.
root
}
private
fun
initPlayer
()
{
val
uri1
=
Uri
.
fromFile
(
File
(
requireActivity
().
filesDir
,
"飞书20230420-181456.mp4"
))
player1
=
activity
?.
let
{
ExoPlayer
.
Builder
(
it
).
build
().
apply
{
setMediaItem
(
MediaItem
.
Builder
().
setUri
(
uri1
).
build
())
}
}
binding
.
videoView1
.
player
=
player1
player1
?.
prepare
()
val
uri2
=
Uri
.
fromFile
(
File
(
requireActivity
().
filesDir
,
"飞书20230420-181512.mp4"
))
player2
=
activity
?.
let
{
ExoPlayer
.
Builder
(
it
).
build
().
apply
{
setMediaItem
(
MediaItem
.
Builder
().
setUri
(
uri2
).
build
())
}
}
binding
.
videoView2
.
player
=
player2
player2
?.
prepare
()
player1
?.
play
()
player2
?.
play
()
}
override
fun
onDestroyView
()
{
player1
?.
release
()
player2
?.
release
()
super
.
onDestroyView
()
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/view/ButtonMorePopup.kt
View file @
1d65e955
package
com.waytous.anticollision.ui.view
import
android.content.Context
import
android.content.Intent
import
android.view.Gravity
import
androidx.navigation.NavController
import
android.view.View
import
android.view.View.OnClickListener
import
androidx.appcompat.widget.AppCompatTextView
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.PopupMoreFeaturesBinding
import
com.waytous.anticollision.ui.collect.CollectActivity
import
com.waytous.anticollision.ui.health.HealthManagerActivity
import
com.waytous.anticollision.ui.settings.UserSettingsActivity
import
com.waytous.anticollision.ui.statistics.DataStatisticsActivity
import
razerdp.basepopup.BasePopupWindow
import
javax.inject.Inject
class
ButtonMorePopup
@Inject
constructor
(
context
:
Context
?,
val
binding
:
PopupMoreFeaturesBinding
)
:
BasePopupWindow
(
context
)
{
class
ButtonMorePopup
@Inject
constructor
(
context
:
Context
)
:
BasePopupWindow
(
context
),
OnClickListener
{
init
{
contentView
=
binding
.
root
contentView
=
createPopupById
(
R
.
layout
.
popup_more_features
)
setOutSideDismiss
(
true
)
popupGravity
=
Gravity
.
TOP
or
Gravity
.
CENTER
maskOffsetY
=
20
setBackgroundColor
(
R
.
color
.
color_99000000
)
contentView
.
findViewById
<
AppCompatTextView
>(
R
.
id
.
featureCollect
).
setOnClickListener
(
this
)
contentView
.
findViewById
<
AppCompatTextView
>(
R
.
id
.
featureHealth
).
setOnClickListener
(
this
)
contentView
.
findViewById
<
AppCompatTextView
>(
R
.
id
.
featureData
).
setOnClickListener
(
this
)
contentView
.
findViewById
<
AppCompatTextView
>(
R
.
id
.
featureSettings
).
setOnClickListener
(
this
)
contentView
.
findViewById
<
AppCompatTextView
>(
R
.
id
.
featureReboot
).
setOnClickListener
(
this
)
contentView
.
findViewById
<
AppCompatTextView
>(
R
.
id
.
featurePowerOff
).
setOnClickListener
(
this
)
}
fun
navigationTo
(
navController
:
NavController
){
binding
.
moreFeatureCollect
.
setOnClickListener
{
override
fun
onClick
(
v
:
View
?)
{
dismiss
()
navController
.
navigate
(
R
.
id
.
collectFragment
)
when
(
v
?.
id
){
R
.
id
.
featureCollect
->{
context
.
startActivity
(
Intent
(
context
,
CollectActivity
::
class
.
java
))
}
R
.
id
.
featureHealth
->{
context
.
startActivity
(
Intent
(
context
,
HealthManagerActivity
::
class
.
java
))
}
R
.
id
.
featureData
->{
context
.
startActivity
(
Intent
(
context
,
DataStatisticsActivity
::
class
.
java
))
}
R
.
id
.
featureSettings
->{
context
.
startActivity
(
Intent
(
context
,
UserSettingsActivity
::
class
.
java
))
}
R
.
id
.
featureReboot
->{
}
R
.
id
.
featurePowerOff
->{
}
}
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/view/ButtonReportStatusPopup.kt
View file @
1d65e955
package
com.waytous.anticollision.ui.view
import
android.app.Dialog
import
android.content.Context
import
android.view.Gravity
import
android.view.View
import
android.view.View.OnClickListener
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.PopupReportStatusBinding
import
razerdp.basepopup.BasePopupWindow
import
javax.inject.Inject
class
ButtonReportStatusPopup
@Inject
constructor
(
context
:
Context
?,
val
binding
:
PopupReportStatusBinding
)
:
BasePopupWindow
(
context
)
{
class
ButtonReportStatusPopup
(
val
context
:
Context
?)
:
BasePopupWindow
(
context
),
OnClickListener
{
private
var
delayCauseDialog
:
DelayCauseDialog
private
var
faultCauseDialog
:
FaultCauseDialog
private
var
standbyDialog
:
StandbyDialog
init
{
contentView
=
binding
.
root
contentView
=
createPopupById
(
R
.
layout
.
popup_report_status
)
setOutSideDismiss
(
true
)
popupGravity
=
Gravity
.
TOP
or
Gravity
.
CENTER
setBackgroundColor
(
R
.
color
.
color_99000000
)
delayCauseDialog
=
DelayCauseDialog
(
context
!!
,
R
.
style
.
DialogStyle
)
faultCauseDialog
=
FaultCauseDialog
(
context
,
R
.
style
.
DialogStyle
)
standbyDialog
=
StandbyDialog
(
context
,
R
.
style
.
DialogStyle
)
}
fun
itemDumping
(){
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
reportDialogDelay
->{
delayCauseDialog
.
show
()
}
fun
itemDelay
(
dialog
:
Dialog
){
binding
.
reportDialogDelay
.
setOnClickListener
{
dialog
.
show
()
R
.
id
.
reportDialogFault
->{
faultCauseDialog
.
show
()
}
R
.
id
.
reportDialogStandby
->{
standbyDialog
.
show
()
}
fun
itemFault
(
dialog
:
Dialog
){
binding
.
reportDialogFault
.
setOnClickListener
{
dialog
.
show
()
}
}
fun
itemStandby
(
dialog
:
Dialog
){
binding
.
reportDialogStandby
.
setOnClickListener
{
dialog
.
show
()
}
}
}
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/ui/view/ButtonWorkStatusPopup.kt
View file @
1d65e955
...
...
@@ -3,13 +3,11 @@ package com.waytous.anticollision.ui.view
import
android.content.Context
import
android.view.Gravity
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.PopupWorkStatusEditBinding
import
razerdp.basepopup.BasePopupWindow
import
javax.inject.Inject
class
ButtonWorkStatusPopup
@Inject
constructor
(
context
:
Context
?,
val
binding
:
PopupWorkStatusEditBinding
)
:
BasePopupWindow
(
context
)
{
class
ButtonWorkStatusPopup
(
context
:
Context
)
:
BasePopupWindow
(
context
)
{
init
{
contentView
=
binding
.
root
contentView
=
createPopupById
(
R
.
layout
.
popup_work_status_edit
)
setOutSideDismiss
(
true
)
popupGravity
=
Gravity
.
TOP
or
Gravity
.
CENTER
setBackgroundColor
(
R
.
color
.
color_99000000
)
...
...
app/src/main/java/com/waytous/anticollision/utils/MapExtensions.kt
View file @
1d65e955
package
com.waytous.anticollision.utils
import
android.graphics.Color
import
androidx.appcompat.app.AppCompatActivity
import
androidx.lifecycle.Lifecycle
import
androidx.lifecycle.lifecycleScope
import
androidx.lifecycle.repeatOnLifecycle
import
com.blankj.utilcode.util.LogUtils
import
com.mapbox.maps.LayerPosition
import
com.mapbox.maps.MapboxMap
import
com.mapbox.maps.Style
import
com.mapbox.maps.extension.style.expressions.dsl.generated.get
import
com.mapbox.maps.extension.style.layers.addLayer
...
...
@@ -18,6 +23,12 @@ import com.mapbox.maps.extension.style.layers.properties.generated.TextRotationA
import
com.mapbox.maps.extension.style.layers.properties.generated.Visibility
import
com.mapbox.maps.extension.style.sources.addSource
import
com.mapbox.maps.extension.style.sources.generated.geoJsonSource
import
com.mapbox.maps.plugin.animation.flyTo
import
com.waytous.anticollision.R
import
com.waytous.anticollision.databinding.LayoutMapBoxBinding
import
com.waytous.anticollision.ui.MainViewModel
import
kotlinx.coroutines.launch
import
java.math.BigDecimal
const
val
MY_MAP_BOX_STYLE
=
"asset://style.json"
...
...
@@ -73,6 +84,8 @@ const val PARK_SPOT_TEXT_LAYER = "parkSpotTextLayer"
const
val
TRUCK_PATH_SOURCE
=
"truckPathSource"
const
val
TRUCK_PATH_LAYER
=
"truckPathLayer"
const
val
ADJUST_LAYER_ORDER
=
"adjustLayerOrder"
const
val
LONGITUDE
=
119.7622539014
const
val
LATITUDE
=
49.3795031825
const
val
ZOOM
=
16.0
...
...
@@ -688,3 +701,152 @@ fun Style.adjustLayerOrder(){
STATIC_OBJECTS_LAYER
,
null
)
)
}
internal
fun
AppCompatActivity
.
setupMapBoxStyle
(
mapBox
:
MapboxMap
,
viewModel
:
MainViewModel
){
mapBox
.
loadStyleUri
(
MY_MAP_BOX_STYLE
)
mapBox
.
getStyle
{
style
->
lifecycleScope
.
launch
{
repeatOnLifecycle
(
Lifecycle
.
State
.
CREATED
)
{
viewModel
.
loadMapDataSource
().
collect
{
when
(
it
.
sourceId
){
OBSTACLES_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addObstaclesSource
(
it
.
geojson
)
style
.
addObstaclesFillLayer
()
style
.
addObstaclesSymbolLayer
()
}
}
ELECTRONIC_FENCE_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addElectronicFenceSource
(
it
.
geojson
)
style
.
addElectronicFenceFillLayer
()
style
.
addElectronicFenceSymbolLayer
()
}
}
WET_AREA_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addWetAreaSource
(
it
.
geojson
)
style
.
addWetAreaFillLayer
()
style
.
addWetAreaSymbolLayer
()
}
}
LANE_NODE_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addLaneNodeSource
(
it
.
geojson
)
style
.
addLaneNodeCircleLayer
()
style
.
addLaneNodeSymbolLayer
()
}
}
LANE_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addLaneSource
(
it
.
geojson
)
style
.
addLaneLayer
()
}
}
RUNNABLE_AREA_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addRunnableAreaSource
(
it
.
geojson
)
style
.
addRunnableAreaLayer
()
}
}
DUMP_AREA_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addDumpAreaSource
(
it
.
geojson
)
style
.
addDumpAreaFillLayer
()
style
.
addDumpAreaSymbolLayer
()
}
}
DIGGING_WORK_AREA_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addDiggingWorkAreaSource
(
it
.
geojson
)
style
.
addDiggingWorkAreaFillLayer
()
style
.
addDiggingWorkAreaSymbolLayer
()
}
}
BARRICADE_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addBarricadeSource
(
it
.
geojson
)
style
.
addBarricadeLineLayer
()
}
}
STATION_AREA_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addStationAreaSource
(
it
.
geojson
)
style
.
addStationAreaFillLayer
()
style
.
addStationAreaSymbolLayer
()
}
}
PARK_SPOT_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addParkSpotSource
(
it
.
geojson
)
style
.
addParkSpotFillLayer
()
style
.
addParkSpotSymbolLayer
()
}
}
STATIC_OBJECTS_SOURCE
->{
if
(
it
.
geojson
.
isNotEmpty
()&&
it
.
version
!=
"-1"
)
{
style
.
addStaticObjectsSource
(
it
.
geojson
)
style
.
addStaticObjectsFillLayer
()
style
.
addStaticObjectsSymbolLayer
()
}
}
TRUCK_PATH_SOURCE
->{
style
.
addTruckPathSource
()
style
.
addTruckPathLineLayer
()
}
}
style
.
adjustLayerOrder
()
}
}
}
}
}
private
fun
AppCompatActivity
.
zoomOut
(
boxBinding
:
LayoutMapBoxBinding
,
viewModel
:
MainViewModel
){
boxBinding
.
zoomOut
.
setOnClickListener
{
lifecycleScope
.
launch
{
repeatOnLifecycle
(
Lifecycle
.
State
.
CREATED
)
{
viewModel
.
updateZoom
(
BigDecimal
(
"${boxBinding.mapView.getMapboxMap().cameraState.zoom}"
).
add
(
BigDecimal
(
"0.1"
)
))
}
}
}
}
private
fun
AppCompatActivity
.
zoomIn
(
boxBinding
:
LayoutMapBoxBinding
,
viewModel
:
MainViewModel
){
boxBinding
.
zoomIn
.
setOnClickListener
{
lifecycleScope
.
launch
{
repeatOnLifecycle
(
Lifecycle
.
State
.
CREATED
)
{
viewModel
.
updateZoom
(
BigDecimal
(
"${boxBinding.mapView.getMapboxMap().cameraState.zoom}"
).
minus
(
BigDecimal
(
"0.1"
)
))
}
}
}
}
private
fun
locationTruck
(
boxBinding
:
LayoutMapBoxBinding
,
viewModel
:
MainViewModel
){
boxBinding
.
locationTruck
.
setOnClickListener
{
boxBinding
.
mapView
.
getMapboxMap
().
flyTo
(
viewModel
.
cameraOptions
.
value
)
}
}
fun
AppCompatActivity
.
setupMapBox
(
boxBinding
:
LayoutMapBoxBinding
,
viewModel
:
MainViewModel
){
val
mapBox
=
boxBinding
.
mapView
.
getMapboxMap
()
lifecycleScope
.
launch
{
repeatOnLifecycle
(
Lifecycle
.
State
.
CREATED
)
{
viewModel
.
cameraOptions
.
collect
{
mapBox
.
setCamera
(
it
)
}
}
}
zoomOut
(
boxBinding
,
viewModel
)
zoomIn
(
boxBinding
,
viewModel
)
locationTruck
(
boxBinding
,
viewModel
)
setupMapBoxStyle
(
boxBinding
.
mapView
.
getMapboxMap
(),
viewModel
)
}
fun
AppCompatActivity
.
vehicleIcon
()
=
BitmapUtils
.
bitmapFromDrawableRes
(
this
,
R
.
drawable
.
my_vehicle_normal
)
fun
AppCompatActivity
.
otherVehicleIcon
()
=
BitmapUtils
.
bitmapFromDrawableRes
(
this
,
R
.
drawable
.
my_vehicle_normal
)
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/vo/VehicleAnnotation.kt
deleted
100644 → 0
View file @
fdbd57de
package
com.waytous.anticollision.vo
import
com.mapbox.geojson.Point
data class
VehicleAnnotation
(
val
vehicleNo
:
String
,
val
speed
:
Int
,
val
distance
:
Int
,
val
point
:
Point
,
val
isShow
:
Boolean
)
\ No newline at end of file
app/src/main/java/com/waytous/anticollision/vo/VehicleLocationInfo.kt
0 → 100644
View file @
1d65e955
package
com.waytous.anticollision.vo
data class
VehicleLocationInfo
(
/**时间戳*/
val
timeStamp
:
Long
,
/**车辆id*/
val
vehicleId
:
String
,
/**车辆类型*/
val
vehicleType
:
Int
,
/**车辆状态*/
val
vehicleStatus
:
Int
,
/**车辆位置:纬度*/
val
latitude
:
Double
,
/**车辆位置:经度*/
val
longitude
:
Double
,
/**车辆位置:海拔*/
val
altitude
:
Double
,
/**车辆位置:航向*/
val
direction
:
Double
,
/**车辆速度*/
val
velocity
:
Float
)
\ No newline at end of file
app/src/main/res/layout/
fragment
_collect.xml
→
app/src/main/res/layout/
activity
_collect.xml
View file @
1d65e955
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat
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"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
tools:context=
".ui.collect.CollectFragment"
>
android:orientation=
"vertical"
tools:context=
".ui.collect.CollectActivity"
>
<include
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/titleBar"
layout=
"@layout/status_bar_layout"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RadioGroup
android:id=
"@+id/collectRadioGroup
"
android:id=
"@+id/tabContainer
"
android:layout_width=
"@dimen/dp_300"
android:layout_height=
"@dimen/dp_50"
android:layout_marginStart=
"@dimen/dp_18"
...
...
@@ -17,8 +25,8 @@
app:layout_constraintTop_toTopOf=
"parent"
android:orientation=
"horizontal"
>
<RadioButton
android:id=
"@+id/collectT
abCollect"
android:layout_width=
"0dp
"
android:id=
"@+id/t
abCollect"
android:layout_width=
"@dimen/dp_0
"
android:layout_height=
"wrap_content"
style=
"@style/StatusBarTextStyle"
android:background=
"@drawable/background_collect_radiobutton"
...
...
@@ -28,7 +36,7 @@
android:text=
"@string/more_feature_collect"
android:layout_weight=
"1"
/>
<RadioButton
android:id=
"@+id/collectT
abSettings"
android:id=
"@+id/t
abSettings"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
style=
"@style/StatusBarTextStyle"
...
...
@@ -39,25 +47,27 @@
android:layout_weight=
"1"
/>
</RadioGroup>
<FrameLayout
android:id=
"@+id/collectT
abContent"
android:id=
"@+id/t
abContent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_18"
app:layout_constraintTop_toBottomOf=
"@id/collectRadioGroup"
app:layout_constraintStart_toStartOf=
"@id/collectRadioGroup"
/>
<FrameLayout
android:id=
"@+id/collectMapWrapper"
app:layout_constraintTop_toBottomOf=
"@id/tabContainer"
app:layout_constraintStart_toStartOf=
"@id/tabContainer"
app:layout_constraintEnd_toEndOf=
"@id/tabContainer"
/>
<include
android:id=
"@+id/mapContainer"
layout=
"@layout/layout_map_box"
android:layout_width=
"0dp
"
android:layout_height=
"0dp
"
android:layout_width=
"@dimen/dp_0
"
android:layout_height=
"@dimen/dp_0
"
android:layout_marginStart=
"@dimen/dp_15"
android:layout_marginEnd=
"@dimen/dp_18"
app:layout_constraintBottom_toBottomOf=
"@id/collectT
abContent"
app:layout_constraintBottom_toBottomOf=
"@id/t
abContent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/collectRadioGroup"
app:layout_constraintTop_toTopOf=
"@id/collectRadioGroup"
/>
app:layout_constraintStart_toEndOf=
"@id/tabContainer"
app:layout_constraintTop_toTopOf=
"@id/tabContainer"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/collectTabToggleM
ore"
android:id=
"@+id/m
ore"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_18"
...
...
@@ -68,11 +78,11 @@
android:clickable=
"true"
android:contentDescription=
"@string/toggle_more"
android:focusable=
"true"
app:layout_constraintTop_toBottomOf=
"@id/collectT
abContent"
app:layout_constraintTop_toBottomOf=
"@id/t
abContent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"@id/collectT
abContent"
/>
app:layout_constraintStart_toStartOf=
"@id/t
abContent"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/collectTabBtnTo
Home"
android:id=
"@+id/back
Home"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_18"
...
...
@@ -87,11 +97,11 @@
android:focusable=
"true"
android:textSize=
"@dimen/sp_28"
android:text=
"@string/back_to_home"
app:layout_constraintTop_toTopOf=
"@id/collectTabToggleM
ore"
app:layout_constraintStart_toEndOf=
"@id/collectTabToggleM
ore"
app:layout_constraintBottom_toBottomOf=
"@id/collectTabToggleM
ore"
/>
app:layout_constraintTop_toTopOf=
"@id/m
ore"
app:layout_constraintStart_toEndOf=
"@id/m
ore"
app:layout_constraintBottom_toBottomOf=
"@id/m
ore"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/collectTabBtnTo
Upload"
android:id=
"@+id/btn
Upload"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/background_collect_tab_btn_upload"
...
...
@@ -102,11 +112,11 @@
android:textSize=
"@dimen/sp_26"
android:focusable=
"true"
android:clickable=
"true"
app:layout_constraintTop_toTopOf=
"@id/collectTabToggleM
ore"
app:layout_constraintBottom_toBottomOf=
"@id/collectTabToggleM
ore"
app:layout_constraintEnd_toEndOf=
"@id/collectMapWrapp
er"
/>
app:layout_constraintTop_toTopOf=
"@id/m
ore"
app:layout_constraintBottom_toBottomOf=
"@id/m
ore"
app:layout_constraintEnd_toEndOf=
"@id/mapContain
er"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/collectTabBtnTo
End"
android:id=
"@+id/btn
End"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/background_collect_tab_btn_end"
...
...
@@ -117,11 +127,11 @@
android:textSize=
"@dimen/sp_26"
android:focusable=
"true"
android:clickable=
"true"
app:layout_constraintTop_toTopOf=
"@id/collectTabToggleM
ore"
app:layout_constraintBottom_toBottomOf=
"@id/collectTabToggleM
ore"
app:layout_constraintEnd_toStartOf=
"@id/collectTabBtnTo
Upload"
/>
app:layout_constraintTop_toTopOf=
"@id/m
ore"
app:layout_constraintBottom_toBottomOf=
"@id/m
ore"
app:layout_constraintEnd_toStartOf=
"@id/btn
Upload"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/collectTabB
tnTap"
android:id=
"@+id/b
tnTap"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/background_collect_tab_btn_tap"
...
...
@@ -132,11 +142,11 @@
android:textSize=
"@dimen/sp_26"
android:focusable=
"true"
android:clickable=
"true"
app:layout_constraintTop_toTopOf=
"@id/collectTabToggleM
ore"
app:layout_constraintBottom_toBottomOf=
"@id/collectTabToggleM
ore"
app:layout_constraintEnd_toStartOf=
"@id/collectTabBtnTo
End"
/>
app:layout_constraintTop_toTopOf=
"@id/m
ore"
app:layout_constraintBottom_toBottomOf=
"@id/m
ore"
app:layout_constraintEnd_toStartOf=
"@id/btn
End"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/collectTabB
tnPause"
android:id=
"@+id/b
tnPause"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/background_collect_tab_btn_pause"
...
...
@@ -147,7 +157,8 @@
android:textSize=
"@dimen/sp_26"
android:focusable=
"true"
android:clickable=
"true"
app:layout_constraintTop_toTopOf=
"@id/collectTabToggleMore"
app:layout_constraintBottom_toBottomOf=
"@id/collectTabToggleMore"
app:layout_constraintEnd_toStartOf=
"@id/collectTabBtnTap"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app:layout_constraintTop_toTopOf=
"@id/more"
app:layout_constraintBottom_toBottomOf=
"@id/more"
app:layout_constraintEnd_toStartOf=
"@id/btnTap"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
app/src/main/res/layout/
fragment
_data_statistics.xml
→
app/src/main/res/layout/
activity
_data_statistics.xml
View file @
1d65e955
<?xml version="1.0" encoding="utf-8"?>
<androidx.
constraintlayout.widget.ConstraintLayou
t
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.
appcompat.widget.LinearLayoutCompa
t
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:background=
"@color/color_ffe5e5e5"
tools:context=
".ui.statistics.DataStatisticsFragment"
>
android:orientation=
"vertical"
tools:context=
".ui.statistics.DataStatisticsActivity"
>
<include
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/titleBar"
layout=
"@layout/status_bar_layout"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_ffe5e5e5"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/dataStatisticsTitle"
android:layout_width=
"wrap_content"
...
...
@@ -24,7 +32,7 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/dataStatisticsLastCommitTim
e"
android:id=
"@+id/tabTitl
e"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"@dimen/dp_20"
...
...
@@ -39,7 +47,7 @@
app:layout_constraintBottom_toBottomOf=
"@id/dataStatisticsTitle"
/>
<RadioGroup
android:id=
"@+id/dataStatisticsRadioGroup
"
android:id=
"@+id/tabContainer
"
android:layout_width=
"@dimen/dp_132"
android:layout_height=
"@dimen/dp_578"
android:layout_marginTop=
"@dimen/dp_13"
...
...
@@ -50,7 +58,7 @@
app:layout_constraintTop_toBottomOf=
"@id/dataStatisticsTitle"
>
<RadioButton
android:id=
"@+id/dataStatistics
Production"
android:id=
"@+id/tab
Production"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginTop=
"@dimen/dp_27"
...
...
@@ -65,7 +73,7 @@
android:textSize=
"@dimen/sp_20"
/>
<RadioButton
android:id=
"@+id/dataStatistics
Task"
android:id=
"@+id/tab
Task"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginTop=
"@dimen/dp_16"
...
...
@@ -79,7 +87,7 @@
android:textSize=
"@dimen/sp_20"
/>
<RadioButton
android:id=
"@+id/dataStatistics
Log"
android:id=
"@+id/tab
Log"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginTop=
"@dimen/dp_16"
...
...
@@ -99,13 +107,13 @@
android:layout_height=
"@dimen/dp_0"
android:layout_marginStart=
"@dimen/dp_8"
android:layout_marginEnd=
"@dimen/dp_18"
app:layout_constraintTop_toTopOf=
"@id/dataStatisticsRadioGroup
"
app:layout_constraintStart_toEndOf=
"@id/dataStatisticsRadioGroup
"
app:layout_constraintBottom_toBottomOf=
"@id/dataStatisticsRadioGroup
"
app:layout_constraintTop_toTopOf=
"@id/tabContainer
"
app:layout_constraintStart_toEndOf=
"@id/tabContainer
"
app:layout_constraintBottom_toBottomOf=
"@id/tabContainer
"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/dataStatisticsToggleM
ore"
android:id=
"@+id/m
ore"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_18"
...
...
@@ -116,10 +124,10 @@
android:focusable=
"true"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/dataStatisticsRadioGroup
"
/>
app:layout_constraintTop_toBottomOf=
"@id/tabContainer
"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/dataStatisticsT
oHome"
android:id=
"@+id/g
oHome"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_15"
...
...
@@ -134,8 +142,8 @@
android:text=
"@string/back_to_home"
android:textColor=
"@drawable/color_text_btn"
android:textSize=
"@dimen/sp_28"
app:layout_constraintBottom_toBottomOf=
"@id/dataStatisticsToggleM
ore"
app:layout_constraintStart_toEndOf=
"@id/dataStatisticsToggleM
ore"
app:layout_constraintTop_toTopOf=
"@id/dataStatisticsToggleM
ore"
/>
</androidx.
constraintlayout.widget.ConstraintLayou
t>
app:layout_constraintBottom_toBottomOf=
"@id/m
ore"
app:layout_constraintStart_toEndOf=
"@id/m
ore"
app:layout_constraintTop_toTopOf=
"@id/m
ore"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.
appcompat.widget.LinearLayoutCompa
t>
\ No newline at end of file
app/src/main/res/layout/
fragment_health_man
ger.xml
→
app/src/main/res/layout/
activity_health_mana
ger.xml
View file @
1d65e955
<?xml version="1.0" encoding="utf-8"?>
<androidx.
constraintlayout.widget.ConstraintLayou
t
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.
appcompat.widget.LinearLayoutCompa
t
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:background=
"@color/color_ffe5e5e5"
tools:context=
".ui.health.HealthMangerFragment"
>
android:orientation=
"vertical"
tools:context=
".ui.health.HealthManagerActivity"
>
<include
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/titleBar"
layout=
"@layout/status_bar_layout"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_ffe5e5e5"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/healthManagerTitle"
android:layout_width=
"wrap_content"
...
...
@@ -24,7 +32,7 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/healthManagerLastCommit
Time"
android:id=
"@+id/committed
Time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"@dimen/dp_20"
...
...
@@ -45,12 +53,12 @@
android:text=
"@string/health_manger_last_detection_time"
android:textColor=
"@color/color_ff333333"
android:textSize=
"@dimen/sp_20"
app:layout_constraintBottom_toBottomOf=
"@id/healthManagerLastCommit
Time"
app:layout_constraintEnd_toStartOf=
"@id/healthManagerLastCommit
Time"
app:layout_constraintTop_toTopOf=
"@id/healthManagerLastCommit
Time"
/>
app:layout_constraintBottom_toBottomOf=
"@id/committed
Time"
app:layout_constraintEnd_toStartOf=
"@id/committed
Time"
app:layout_constraintTop_toTopOf=
"@id/committed
Time"
/>
<RadioGroup
android:id=
"@+id/healthManagerRadioGroup
"
android:id=
"@+id/tabContainer
"
android:layout_width=
"@dimen/dp_132"
android:layout_height=
"@dimen/dp_578"
android:layout_marginTop=
"@dimen/dp_13"
...
...
@@ -61,7 +69,7 @@
app:layout_constraintTop_toBottomOf=
"@id/healthManagerTitle"
>
<RadioButton
android:id=
"@+id/healthManager
VehicleInspection"
android:id=
"@+id/tab
VehicleInspection"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginTop=
"@dimen/dp_27"
...
...
@@ -76,7 +84,7 @@
android:textSize=
"@dimen/sp_20"
/>
<RadioButton
android:id=
"@+id/healthManager
HardwareInspection"
android:id=
"@+id/tab
HardwareInspection"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginTop=
"@dimen/dp_16"
...
...
@@ -90,7 +98,7 @@
android:textSize=
"@dimen/sp_20"
/>
<RadioButton
android:id=
"@+id/healthManager
SoftwareInspection"
android:id=
"@+id/tab
SoftwareInspection"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginTop=
"@dimen/dp_16"
...
...
@@ -104,7 +112,7 @@
android:textSize=
"@dimen/sp_20"
/>
<RadioButton
android:id=
"@+id/healthManager
StaticInspection"
android:id=
"@+id/tab
StaticInspection"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginTop=
"@dimen/dp_16"
...
...
@@ -125,8 +133,8 @@
android:layout_marginStart=
"@dimen/dp_6"
android:layout_marginEnd=
"@dimen/dp_18"
android:background=
"@drawable/background_collect_tab_text"
app:layout_constraintTop_toTopOf=
"@id/healthManagerRadioGroup
"
app:layout_constraintStart_toEndOf=
"@id/healthManagerRadioGroup
"
app:layout_constraintTop_toTopOf=
"@id/tabContainer
"
app:layout_constraintStart_toEndOf=
"@id/tabContainer
"
app:layout_constraintEnd_toEndOf=
"parent"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/healthMangerInspectionItems"
...
...
@@ -163,11 +171,11 @@
android:scrollbarTrackVertical=
"@android:color/transparent"
app:layout_constraintStart_toStartOf=
"@id/healthMangerInspectionItemHeader"
app:layout_constraintTop_toBottomOf=
"@id/healthMangerInspectionItemHeader"
app:layout_constraintBottom_toBottomOf=
"@id/healthManagerRadioGroup
"
app:layout_constraintBottom_toBottomOf=
"@id/tabContainer
"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/healthManagerToggleM
ore"
android:id=
"@+id/m
ore"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_18"
...
...
@@ -178,10 +186,10 @@
android:focusable=
"true"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/healthManagerRadioGroup
"
/>
app:layout_constraintTop_toBottomOf=
"@id/tabContainer
"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/healthManagerT
oHome"
android:id=
"@+id/g
oHome"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_15"
...
...
@@ -196,9 +204,9 @@
android:text=
"@string/back_to_home"
android:textColor=
"@drawable/color_text_btn"
android:textSize=
"@dimen/sp_28"
app:layout_constraintBottom_toBottomOf=
"@id/healthManagerToggleM
ore"
app:layout_constraintStart_toEndOf=
"@id/healthManagerToggleM
ore"
app:layout_constraintTop_toTopOf=
"@id/healthManagerToggleM
ore"
/>
app:layout_constraintBottom_toBottomOf=
"@id/m
ore"
app:layout_constraintStart_toEndOf=
"@id/m
ore"
app:layout_constraintTop_toTopOf=
"@id/m
ore"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/healthManagerCommit"
...
...
@@ -216,7 +224,8 @@
android:text=
"@string/commit"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_28"
app:layout_constraintBottom_toBottomOf=
"@id/healthManagerToggleM
ore"
app:layout_constraintBottom_toBottomOf=
"@id/m
ore"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/healthManagerToggleMore"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
app:layout_constraintTop_toTopOf=
"@id/more"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
app/src/main/res/layout/
fragment_no_video
_home.xml
→
app/src/main/res/layout/
activity
_home.xml
View file @
1d65e955
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/
fragment_video_home
.xml
→
app/src/main/res/layout/
activity_home_video
.xml
View file @
1d65e955
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_main.xml
deleted
100644 → 0
View file @
fdbd57de
<?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:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@mipmap/background_main_light"
android:padding=
"4dp"
>
<include
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/statusBarMain"
layout=
"@layout/layout_status_bar"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<androidx.fragment.app.FragmentContainerView
android:id=
"@+id/nav_host_fragment_activity_main"
android:name=
"androidx.navigation.fragment.NavHostFragment"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
app:defaultNavHost=
"true"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/statusBarMain"
app:navGraph=
"@navigation/mobile_navigation"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_splash.xml
View file @
1d65e955
...
...
@@ -4,7 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".SplashActivity"
>
tools:context=
".
ui.
SplashActivity"
>
<ImageView
android:layout_width=
"166dp"
...
...
app/src/main/res/layout/
fragment
_user_settings.xml
→
app/src/main/res/layout/
activity
_user_settings.xml
View file @
1d65e955
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
<androidx.appcompat.widget.LinearLayoutCompat
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:background=
"@color/color_ffe5e5e5"
tools:context=
".ui.settings.UserSettingsFragment"
>
android:orientation=
"vertical"
tools:context=
".ui.settings.UserSettingsActivity"
>
<include
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/titleBar"
layout=
"@layout/status_bar_layout"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_ffe5e5e5"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/userS
ettingsTitle"
android:id=
"@+id/s
ettingsTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
...
...
@@ -23,17 +31,17 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<RadioGroup
android:id=
"@+id/useSettingsRadioGroup
"
android:id=
"@+id/tabContainer
"
android:layout_width=
"@dimen/dp_132"
android:layout_height=
"@dimen/dp_578"
android:layout_marginTop=
"@dimen/dp_13"
android:gravity=
"center_horizontal"
android:background=
"@drawable/background_user_settings_radio_group"
app:layout_constraintTop_toBottomOf=
"@id/userS
ettingsTitle"
app:layout_constraintTop_toBottomOf=
"@id/s
ettingsTitle"
app:layout_constraintStart_toStartOf=
"parent"
android:orientation=
"vertical"
>
<RadioButton
android:id=
"@+id/userSettings
VehicleInfo"
android:id=
"@+id/tab
VehicleInfo"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:gravity=
"center_horizontal"
...
...
@@ -47,7 +55,7 @@
android:layout_marginTop=
"@dimen/dp_27"
android:checked=
"true"
/>
<RadioButton
android:id=
"@+id/userSettings
Network"
android:id=
"@+id/tab
Network"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:gravity=
"center_horizontal"
...
...
@@ -60,7 +68,7 @@
android:paddingTop=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_16"
/>
<RadioButton
android:id=
"@+id/userSettings
FixedInfo"
android:id=
"@+id/tab
FixedInfo"
android:layout_width=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:gravity=
"center_horizontal"
...
...
@@ -74,14 +82,14 @@
android:layout_marginTop=
"@dimen/dp_16"
/>
</RadioGroup>
<FrameLayout
android:id=
"@+id/userSettingsContentWrapper
"
android:id=
"@+id/tabContent
"
android:layout_width=
"@dimen/dp_0"
android:layout_height=
"@dimen/dp_0"
app:layout_constraintTop_toTopOf=
"@id/useSettingsRadioGroup
"
app:layout_constraintBottom_toBottomOf=
"@id/useSettingsRadioGroup
"
app:layout_constraintStart_toStartOf=
"@id/useSettingsRadioGroup
"
/>
app:layout_constraintTop_toTopOf=
"@id/tabContainer
"
app:layout_constraintBottom_toBottomOf=
"@id/tabContainer
"
app:layout_constraintStart_toStartOf=
"@id/tabContainer
"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/useSettingsToggleM
ore"
android:id=
"@+id/m
ore"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_18"
...
...
@@ -92,10 +100,10 @@
android:focusable=
"true"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/useSettingsRadioGroup
"
/>
app:layout_constraintTop_toBottomOf=
"@id/tabContainer
"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/useSettingsT
oHome"
android:id=
"@+id/g
oHome"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_15"
...
...
@@ -110,7 +118,8 @@
android:text=
"@string/back_to_home"
android:textColor=
"@drawable/color_text_btn"
android:textSize=
"@dimen/sp_28"
app:layout_constraintBottom_toBottomOf=
"@id/useSettingsToggleMore"
app:layout_constraintStart_toEndOf=
"@id/useSettingsToggleMore"
app:layout_constraintTop_toTopOf=
"@id/useSettingsToggleMore"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app:layout_constraintBottom_toBottomOf=
"@id/more"
app:layout_constraintStart_toEndOf=
"@id/more"
app:layout_constraintTop_toTopOf=
"@id/more"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
\ No newline at end of file
app/src/main/res/layout/current_
vehicle_view_
annotation_layout.xml
→
app/src/main/res/layout/current_annotation_layout.xml
View file @
1d65e955
File moved
app/src/main/res/layout/dialog_delay_cause_select.xml
View file @
1d65e955
...
...
@@ -5,7 +5,7 @@
android:layout_width=
"@dimen/dp_984"
android:layout_height=
"@dimen/dp_636"
app:cardCornerRadius=
"@dimen/dp_20"
tools:context=
".ui.
Main
Activity"
>
tools:context=
".ui.
home.Home
Activity"
>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
app/src/main/res/layout/dialog_fault_cause_select.xml
View file @
1d65e955
...
...
@@ -5,7 +5,7 @@
android:layout_width=
"@dimen/dp_984"
android:layout_height=
"@dimen/dp_636"
app:cardCornerRadius=
"@dimen/dp_20"
tools:context=
".ui.
Main
Activity"
>
tools:context=
".ui.
home.Home
Activity"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
app/src/main/res/layout/dialog_standby_select.xml
View file @
1d65e955
...
...
@@ -5,7 +5,7 @@
android:layout_width=
"@dimen/dp_560"
android:layout_height=
"@dimen/dp_340"
app:cardCornerRadius=
"@dimen/dp_20"
tools:context=
".ui.
Main
Activity"
>
tools:context=
".ui.
home.Home
Activity"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
app/src/main/res/layout/fragment_base.xml
deleted
100644 → 0
View file @
fdbd57de
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".ui.BaseMapFragment"
>
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"@string/hello_blank_fragment"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/layout_map_box.xml
View file @
1d65e955
<?xml version="1.0" encoding="utf-8"?>
<
FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
androidx.cardview.widget.CardView
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:background=
"@drawable/drawable_bg_map_box"
android:padding=
"@dimen/dp_3"
tools:context=
".ui.MainActivity"
>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:cardCornerRadius=
"@dimen/dp_16"
>
app:cardCornerRadius=
"@dimen/dp_16"
tools:context=
".ui.home.HomeActivity"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:layout_margin=
"@dimen/dp_3"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
...
...
@@ -141,5 +138,4 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</FrameLayout>
\ No newline at end of file
</androidx.cardview.widget.CardView>
\ No newline at end of file
app/src/main/res/layout/other_
vehicle_view_
annotation_layout.xml
→
app/src/main/res/layout/other_annotation_layout.xml
View file @
1d65e955
File moved
app/src/main/res/layout/popup_more_features.xml
View file @
1d65e955
...
...
@@ -16,10 +16,10 @@
android:textSize=
"@dimen/sp_24"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toTopOf=
"@id/
moreF
eatureCollect"
/>
app:layout_constraintBottom_toTopOf=
"@id/
f
eatureCollect"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/
moreF
eatureCollect"
android:id=
"@+id/
f
eatureCollect"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_12"
...
...
@@ -34,11 +34,11 @@
android:textSize=
"@dimen/sp_20"
app:layout_constraintStart_toStartOf=
"@id/more_template_title"
app:layout_constraintTop_toBottomOf=
"@id/more_template_title"
app:layout_constraintEnd_toStartOf=
"@id/
moreF
eatureHealth"
app:layout_constraintBottom_toTopOf=
"@id/
moreF
eatureSettings"
/>
app:layout_constraintEnd_toStartOf=
"@id/
f
eatureHealth"
app:layout_constraintBottom_toTopOf=
"@id/
f
eatureSettings"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/
moreF
eatureHealth"
android:id=
"@+id/
f
eatureHealth"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_45"
...
...
@@ -51,13 +51,13 @@
android:text=
"@string/more_feature_health"
android:textColor=
"@color/home_text_color"
android:textSize=
"@dimen/sp_20"
app:layout_constraintBottom_toBottomOf=
"@id/
moreF
eatureCollect"
app:layout_constraintStart_toEndOf=
"@id/
moreF
eatureCollect"
app:layout_constraintTop_toTopOf=
"@id/
moreF
eatureCollect"
app:layout_constraintEnd_toStartOf=
"@id/
moreF
eatureData"
/>
app:layout_constraintBottom_toBottomOf=
"@id/
f
eatureCollect"
app:layout_constraintStart_toEndOf=
"@id/
f
eatureCollect"
app:layout_constraintTop_toTopOf=
"@id/
f
eatureCollect"
app:layout_constraintEnd_toStartOf=
"@id/
f
eatureData"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/
moreF
eatureData"
android:id=
"@+id/
f
eatureData"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_45"
...
...
@@ -71,13 +71,13 @@
android:text=
"@string/more_feature_data"
android:textColor=
"@color/home_text_color"
android:textSize=
"@dimen/sp_20"
app:layout_constraintBottom_toBottomOf=
"@id/
moreF
eatureHealth"
app:layout_constraintBottom_toBottomOf=
"@id/
f
eatureHealth"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/
moreF
eatureHealth"
app:layout_constraintTop_toTopOf=
"@id/
moreF
eatureHealth"
/>
app:layout_constraintStart_toEndOf=
"@id/
f
eatureHealth"
app:layout_constraintTop_toTopOf=
"@id/
f
eatureHealth"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/
moreF
eatureSettings"
android:id=
"@+id/
f
eatureSettings"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_28"
...
...
@@ -92,12 +92,12 @@
android:textColor=
"@color/home_text_color"
android:textSize=
"@dimen/sp_20"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"@id/
moreF
eatureCollect"
app:layout_constraintTop_toBottomOf=
"@id/
moreF
eatureCollect"
app:layout_constraintEnd_toStartOf=
"@id/
moreF
eatureReboot"
/>
app:layout_constraintStart_toStartOf=
"@id/
f
eatureCollect"
app:layout_constraintTop_toBottomOf=
"@id/
f
eatureCollect"
app:layout_constraintEnd_toStartOf=
"@id/
f
eatureReboot"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/
moreF
eatureReboot"
android:id=
"@+id/
f
eatureReboot"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_45"
...
...
@@ -110,13 +110,13 @@
android:text=
"@string/more_feature_reboot"
android:textColor=
"@color/home_text_color"
android:textSize=
"@dimen/sp_20"
app:layout_constraintBottom_toBottomOf=
"@id/
moreF
eatureSettings"
app:layout_constraintStart_toEndOf=
"@id/
moreF
eatureSettings"
app:layout_constraintTop_toTopOf=
"@id/
moreF
eatureSettings"
app:layout_constraintEnd_toStartOf=
"@id/
moreF
eaturePowerOff"
/>
app:layout_constraintBottom_toBottomOf=
"@id/
f
eatureSettings"
app:layout_constraintStart_toEndOf=
"@id/
f
eatureSettings"
app:layout_constraintTop_toTopOf=
"@id/
f
eatureSettings"
app:layout_constraintEnd_toStartOf=
"@id/
f
eaturePowerOff"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/
moreF
eaturePowerOff"
android:id=
"@+id/
f
eaturePowerOff"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/dp_45"
...
...
@@ -130,8 +130,8 @@
android:text=
"@string/more_feature_power_off"
android:textColor=
"@color/home_text_color"
android:textSize=
"@dimen/sp_20"
app:layout_constraintBottom_toBottomOf=
"@id/
moreF
eatureReboot"
app:layout_constraintBottom_toBottomOf=
"@id/
f
eatureReboot"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/
moreF
eatureReboot"
app:layout_constraintTop_toTopOf=
"@id/
moreF
eatureReboot"
/>
app:layout_constraintStart_toEndOf=
"@id/
f
eatureReboot"
app:layout_constraintTop_toTopOf=
"@id/
f
eatureReboot"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/
layout_status_bar
.xml
→
app/src/main/res/layout/
status_bar_layout
.xml
View file @
1d65e955
File moved
app/src/main/res/navigation/activity_navigation.xml
deleted
100644 → 0
View file @
fdbd57de
<?xml version="1.0" encoding="utf-8"?>
<navigation
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:id=
"@+id/activity_navigation"
app:startDestination=
"@id/splashActivity"
>
<activity
android:id=
"@+id/splashActivity"
android:name=
"com.waytous.anticollision.SplashActivity"
android:label=
"activity_splash"
tools:layout=
"@layout/activity_splash"
/>
<activity
android:id=
"@+id/mainActivity"
android:name=
"com.waytous.anticollision.ui.MainActivity"
android:label=
"MainActivity"
/>
</navigation>
\ No newline at end of file
app/src/main/res/navigation/mobile_navigation.xml
deleted
100644 → 0
View file @
fdbd57de
<?xml version="1.0" encoding="utf-8"?>
<navigation
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:id=
"@+id/mobile_navigation"
app:startDestination=
"@id/navigation_home"
>
<fragment
android:id=
"@+id/navigation_home"
android:name=
"com.waytous.anticollision.ui.home.HomeNoVideoFragment"
android:label=
"@string/title_home"
tools:layout=
"@layout/fragment_no_video_home"
>
<action
android:id=
"@+id/action_navigation_home_to_collectFragment"
app:destination=
"@id/collectFragment"
/>
<action
android:id=
"@+id/action_navigation_home_to_navigation_video_Home"
app:destination=
"@id/navigation_video_Home"
/>
</fragment>
<fragment
android:id=
"@+id/navigation_video_Home"
android:name=
"com.waytous.anticollision.ui.video.HomeVideoFragment"
android:label=
"fragment_video_home"
tools:layout=
"@layout/fragment_video_home"
>
<action
android:id=
"@+id/action_navigation_video_Home_to_collectFragment"
app:destination=
"@id/collectFragment"
/>
<action
android:id=
"@+id/action_navigation_video_Home_to_navigation_home"
app:destination=
"@id/navigation_home"
/>
</fragment>
<fragment
android:id=
"@+id/collectFragment"
android:name=
"com.waytous.anticollision.ui.collect.CollectFragment"
android:label=
"fragment_collect"
tools:layout=
"@layout/fragment_collect"
/>
</navigation>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment