Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
p x
SuZhouAvp
Commits
827d0a40
Commit
827d0a40
authored
Jun 18, 2025
by
p x
Browse files
集成一部分http
parent
aa341738
Changes
33
Expand all
Hide whitespace changes
Inline
Side-by-side
app/src/main/AndroidManifest.xml
View file @
827d0a40
...
...
@@ -25,7 +25,7 @@
<!-- 允许程序读取手机状态 -->
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<!-- 打电话的权限 -->
<!-- <uses-permission android:name="android.permission.CALL_PHONE" />-->
<!-- <uses-permission android:name="android.permission.CALL_PHONE" />-->
<!-- 从SDCard读出数据权限 -->
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<!-- 允许程序写入外部存储设备 -->
...
...
@@ -40,12 +40,12 @@
<uses-permission
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
/>
<application
android:name=
".MyAppcation"
android:allowBackup=
"true"
android:dataExtractionRules=
"@xml/data_extraction_rules"
android:fullBackupContent=
"@xml/backup_rules"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:name=
".MyAppcation"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.SuZhouAvp"
...
...
@@ -58,11 +58,11 @@
<meta-data
android:name=
"com.minedata.minenavi.apikey"
android:value=
"57ac7a0d56494912a0c28e651fa4a40a"
/>
<!-- android:screenOrientation="userLandscape"-->
<!-- android:screenOrientation="userLandscape"-->
<activity
android:name=
".ui.BootActivity"
android:exported=
"true"
android:screenOrientation=
"landscape"
android:theme=
"@style/SplashTheme"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
@@ -74,7 +74,8 @@
<activity
android:name=
".ui.MainActivity"
android:exported=
"true"
android:launchMode=
"singleTask"
>
android:launchMode=
"singleTask"
android:screenOrientation=
"landscape"
>
</activity>
</application>
...
...
app/src/main/assets/CarJSON.json
deleted
100644 → 0
View file @
aa341738
This diff is collapsed.
Click to expand it.
app/src/main/assets/SpaceJSON.json
deleted
100644 → 0
View file @
aa341738
This diff is collapsed.
Click to expand it.
app/src/main/assets/avphmi-demo.vue
View file @
827d0a40
This diff is collapsed.
Click to expand it.
app/src/main/assets/main-view.vue
0 → 100644
View file @
827d0a40
This diff is collapsed.
Click to expand it.
app/src/main/assets/postData.json
deleted
100644 → 0
View file @
aa341738
This diff is collapsed.
Click to expand it.
app/src/main/assets/setting.js
View file @
827d0a40
...
...
@@ -2,7 +2,8 @@ export default {
webSocket
:
{
// url: "ws://127.0.0.1:1884",
// url: "wss://10.166.5.5:10443/socket/ws?clientSource=100",
url
:
"
wss://sip-avp.isungent.cn:8443/socket/ws?clientSource=100
"
,
url
:
"
wss://faw.cuscavp.cn:8443/socket/ws?clientSource=100
"
,
// url: "wss://itg-test.cu-sc.com:13443/WS/socket?clientSource=100",
/* dic: {
// "/topic/vehicle": "/topic/vehicle/1556919708184276993",
"/topic/vehicle": "/topic/vehicle",
...
...
@@ -17,12 +18,16 @@ export default {
/* "/topic/vehicle": "/topic/vehicle/1556919708184276993", */
"
/topic/vehicle
"
:
"
/avp/api/VL961/vehicle/1694264612474306561
"
,
"
/topic/dataMerge
"
:
"
/avp/api/VL961/dataMerge
"
,
// "/topic/dataMerge": "/zhixing/v2/PM270/topic/dataMerge",
"
/topic/signal
"
:
"
/avp/api/VL961/signal
"
,
"
/topic/v2xStart
"
:
"
/avp/api/VL961/v2xStart
"
,
"
/topic/v2xEnd
"
:
"
/avp/api/VL961/v2xEnd
"
,
"
/topic/vehicleStatus
"
:
"
/avp/api/VL961/vehicleStatus
"
,
"
/topic/timeDelay
"
:
"
/avp/api/VL961/timeDelay
"
,
"
/topic/points
"
:
"
/avp/api/VL961/points
"
,
"
/topic/linePlaning
"
:
"
/avp/api/VL961/linePlaning
"
,
"
/topic/partLine
"
:
"
/avp/api/VL961/partLine
"
,
"
/topic/rsiEvent
"
:
"
/avp/api/VL961/rsiEvent
"
,
},
},
cesiumSetting
:
{
...
...
app/src/main/java/com/sd/cavphmi/bean/OrderBean.kt
0 → 100644
View file @
827d0a40
package
com.sd.cavphmi.bean
/**{"id":"1935144643924385794","reserveOrderId":null,"orderNo":"20250618091651107821","vehicleId":"1700381241280815105","plateNo":"吉AC242","parkingLotId":"1589482925440901121","parkingLotName":"长春一汽园区内停车场","parkingLotSpaceId":null,"parkingLotSpaceCode":null,"userId":"1856265200534417410","userName":null,"appointmentEnterTime":null,"cancelBy":null,"cancelReason":null,"cancelTime":null,"avpStatus":6,"enterTime":"2025-06-18 09:16:51","outTime":null,"duration":5341,"durationString":"1小时29分钟","payTime":null,"payType":null,"orderStatus":20,"actualCost":12.0,"ifAppointEnd":0,"vehicleType":1,"payState":0,"parkImg":"","entranceId":"1589482929723285510","entranceLng":125.14179663,"entranceLat":43.83972200,"vehicleLng":125.14245358326262,"vehicleLat":43.838947467820994,"parkingPointId":null,"callPointId":null,"heading":149.77603}**/
data class
OrderBean
(
val
actualCost
:
Float
,
val
appointmentEnterTime
:
String
,
val
avpStatus
:
Int
,
val
callPointId
:
String
,
val
cancelBy
:
Any
,
val
cancelReason
:
Any
,
val
cancelTime
:
Any
,
val
duration
:
Int
,
val
durationString
:
String
,
val
enterTime
:
String
,
val
entranceId
:
String
,
val
entranceLat
:
Double
,
val
entranceLng
:
Double
,
val
heading
:
Double
,
val
id
:
String
,
val
ifAppointEnd
:
Int
,
val
orderNo
:
String
,
val
orderStatus
:
Int
,
val
outTime
:
Any
,
val
parkImg
:
String
,
val
parkingLotId
:
String
,
val
parkingLotName
:
String
,
val
parkingLotSpaceCode
:
String
,
val
parkingLotSpaceId
:
String
,
val
parkingPointId
:
String
,
val
payState
:
Int
,
val
payTime
:
Any
,
val
payType
:
Any
,
val
plateNo
:
String
,
val
reserveOrderId
:
String
,
val
userId
:
String
,
val
userName
:
Any
,
val
vehicleId
:
String
,
val
vehicleLat
:
Double
,
val
vehicleLng
:
Double
,
val
vehicleType
:
Int
)
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/bindadapters/ShowCarStatuObject.kt
View file @
827d0a40
...
...
@@ -5,14 +5,47 @@ import android.text.SpannableStringBuilder
import
android.text.Spanned
import
android.text.style.RelativeSizeSpan
import
android.text.style.StyleSpan
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.databinding.BindingAdapter
import
com.sd.cavphmi.R
import
java.text.DecimalFormat
import
kotlin.math.absoluteValue
object
ShowCarStatuObject
{
/**信号***/
@JvmStatic
@BindingAdapter
(
"showXinhao"
)
fun
showXinhao
(
iv
:
ImageView
,
timeDiff
:
Int
)
{
when
(
timeDiff
)
{
in
1
..
100
->
iv
.
setImageResource
(
R
.
drawable
.
xinhao5
)
in
101
..
200
->
iv
.
setImageResource
(
R
.
drawable
.
xinhao4
)
in
201
..
300
->
iv
.
setImageResource
(
R
.
drawable
.
xinhao3
)
in
301
..
400
->
iv
.
setImageResource
(
R
.
drawable
.
xinhao2
)
else
->
{
iv
.
setImageResource
(
R
.
drawable
.
xinhao1
)
}
}
}
/**泊车状态***/
@JvmStatic
@BindingAdapter
(
"showAvpStatus"
)
fun
showAvpStatus
(
tv
:
TextView
,
avpStatus
:
Int
?)
{
when
(
avpStatus
)
{
1
->
tv
.
setText
(
"场外行驶"
)
2
,
6
->
tv
.
setText
(
"场内行驶"
)
3
->
tv
.
setText
(
"自动泊车中"
)
4
->
tv
.
setText
(
"车辆停靠"
)
5
->
tv
.
setText
(
"自动召车中"
)
else
->
{
tv
.
setText
(
""
)
}
}
}
@JvmStatic
@BindingAdapter
(
"showSpeed"
)
fun
showSpeed
(
tv
:
TextView
,
speed
:
Float
)
{
...
...
@@ -20,7 +53,7 @@ object ShowCarStatuObject {
var
mixSpan
=
RelativeSizeSpan
(
1f
)
var
maxSpan
=
RelativeSizeSpan
(
2f
)
var
bold
=
StyleSpan
(
Typeface
.
BOLD
)
var
bold
=
StyleSpan
(
Typeface
.
BOLD
)
if
(
speed
>
0f
)
{
val
df
:
DecimalFormat
=
DecimalFormat
(
"#.0"
)
...
...
app/src/main/java/com/sd/cavphmi/bindadapters/ShowOrderObject.kt
0 → 100644
View file @
827d0a40
package
com.sd.cavphmi.bindadapters
import
android.graphics.Color
import
android.text.Spannable
import
android.text.SpannableStringBuilder
import
android.text.style.ForegroundColorSpan
import
android.text.style.RelativeSizeSpan
import
android.view.View
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.core.text.set
import
androidx.databinding.BindingAdapter
import
androidx.core.graphics.toColorInt
object
ShowOrderObject
{
@JvmStatic
@BindingAdapter
(
"showOrderLayout"
)
fun
showOrderLayout
(
ll
:
LinearLayout
,
avpStatus
:
Int
?)
{
when
(
avpStatus
)
{
in
1
..
6
->
ll
.
visibility
=
View
.
VISIBLE
else
->
{
ll
.
visibility
=
View
.
GONE
}
}
}
@JvmStatic
@BindingAdapter
(
"showOrderCost"
)
fun
showOrderCost
(
tv
:
TextView
,
actualCost
:
Float
)
{
var
color
=
ForegroundColorSpan
(
"#3C61E2"
.
toColorInt
())
var
sb
=
SpannableStringBuilder
()
sb
.
append
(
"${actualCost}元"
)
sb
.
setSpan
(
color
,
0
,
actualCost
.
toString
().
count
(),
Spannable
.
SPAN_INCLUSIVE_EXCLUSIVE
)
tv
.
setText
(
sb
)
}
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/intfaces/OnConCan.kt
0 → 100644
View file @
827d0a40
package
com.sd.cavphmi.intfaces
interface
OnConCan
{
fun
onCon
()
fun
onCan
()
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/moudule/NetworkModule.kt
View file @
827d0a40
package
com.sd.cavphmi.moudule
import
com.sd.cavphmi.net.HeadParamsInterceptor
import
com.sd.cavphmi.net.RetrofitApi
import
com.sd.cavphmi.net.RetrofitApi.retrofitBuild
import
com.sd.cavphmi.net.httpmothod.ClientRetrofitMethod
...
...
@@ -36,7 +37,7 @@ object NetworkModule {
var
logging
=
HttpLoggingInterceptor
()
init
{
logging
.
level
=
HttpLoggingInterceptor
.
Level
.
BODY
logging
.
level
=
HttpLoggingInterceptor
.
Level
.
NONE
}
...
...
@@ -51,11 +52,11 @@ object NetworkModule {
@NormalInterceptorOkHttpClient
@Provides
fun
provideNormalInterceptorOkHttpClient
(
//
headParamsInterceptor: HeadParamsInterceptor,
headParamsInterceptor
:
HeadParamsInterceptor
,
):
OkHttpClient
{
return
OkHttpClient
.
Builder
()
.
cache
(
RetrofitApi
.
cache
)
//
.addInterceptor(headParamsInterceptor)
.
addInterceptor
(
headParamsInterceptor
)
.
hostnameVerifier
{
hostname
,
session
->
true
}
.
addInterceptor
(
logging
)
.
build
()
...
...
app/src/main/java/com/sd/cavphmi/net/HeadParamsInterceptor.kt
0 → 100644
View file @
827d0a40
package
com.sd.cavphmi.net
import
okhttp3.Interceptor
import
okhttp3.Response
import
javax.inject.Inject
/**
* 公共参数拦截处理器 http://blog.csdn.net/spinchao/article/details/52932145
*/
class
HeadParamsInterceptor
@Inject
constructor
()
:
Interceptor
{
override
fun
intercept
(
chain
:
Interceptor
.
Chain
):
Response
{
// LogUtil.d("----------token=" + MyPres.token)
var
original
=
chain
.
request
()
// var path = original.url.encodedPath.substringAfterLast("/")
var
request
=
original
.
newBuilder
()
request
.
header
(
"Tenant-Id"
,
"1484465260508323841"
)
return
chain
.
proceed
(
request
.
build
())
}
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/net/httpmothod/ClientRetrofitMethod.kt
View file @
827d0a40
package
com.sd.cavphmi.net.httpmothod
import
com.sd.cavphmi.bean.OrderBean
import
com.sd.cavphmi.bean.SpaceNoBean
import
com.sd.cavphmi.net.MyBaseResource
import
io.reactivex.rxjava3.core.Observable
...
...
@@ -21,7 +22,15 @@ interface ClientRetrofitMethod {
排序方向order
*/
@POST
(
"hkapi/pms/v1/parkingSpace/spaceNo"
)
suspend
fun
getSpaceData
(
@Body
body
:
RequestBody
):
MyBaseResource
<
SpaceNoBean
>
suspend
fun
getSpaceData
(
@Body
body
:
RequestBody
):
MyBaseResource
<
SpaceNoBean
>
/***获取订单信息**/
@POST
(
"avp/avpMonitor/getOrderParkingInfoForPlate"
)
suspend
fun
getOrderData
(
@Body
body
:
RequestBody
):
OrderBean
/***获取网络质量**/
@POST
(
"avp/siteLine/getNetworkQuality"
)
suspend
fun
getTimeOut
():
Any
/**
...
...
app/src/main/java/com/sd/cavphmi/repositorys/ParseSocketRepo.kt
View file @
827d0a40
package
com.sd.cavphmi.repositorys
import
com.google.gson.Gson
import
com.sd.cavphmi.bean.OrderBean
import
com.sd.cavphmi.net.MyResult
import
com.sd.cavphmi.net.RequestBodyUtil
import
com.sd.cavphmi.net.httpmothod.ClientRetrofitMethod
import
com.sd.cavphmi.utils.MyContants
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.withContext
import
retrofit2.HttpException
import
java.io.EOFException
import
java.util.concurrent.atomic.AtomicBoolean
import
javax.inject.Inject
class
ParseSocketRepo
@Inject
constructor
()
{
class
ParseSocketRepo
@Inject
constructor
(
private
val
clientRetrofitMethod
:
ClientRetrofitMethod
)
{
var
gson
=
Gson
()
private
var
gson
=
Gson
()
/**联网车辆状态数据***/
suspend
fun
<
T
>
genDataBean
(
str
:
String
,
clazz
:
Class
<
T
>):
T
{
// private var orderCalled = AtomicBoolean(false)
/**解析网络数据***/
suspend
fun
<
T
>
parseDataBean
(
str
:
String
,
clazz
:
Class
<
T
>):
T
{
return
withContext
(
Dispatchers
.
Default
)
{
gson
.
fromJson
(
str
,
clazz
)
}
}
suspend
fun
getOrderData
(
carPlate
:
String
):
MyResult
<
OrderBean
>
{
// if (!orderCalled.getAndSet(true)) {
delay
(
5000
)
var
map
=
mapOf
(
"vehiclePlate"
to
carPlate
)
var
body
=
RequestBodyUtil
.
toRequestBody
(
map
)
try
{
var
bean
=
clientRetrofitMethod
.
getOrderData
(
body
)
return
MyResult
.
Success
(
bean
)
}
catch
(
e
:
HttpException
)
{
// println("e.message = ${e.message}")
return
MyResult
.
Error
(
e
.
code
(),
e
.
message
()
?:
"error"
)
}
catch
(
e
:
Exception
)
{
return
MyResult
.
Error
(
500
,
e
.
message
?:
"error"
)
}
// } else {
// return MyResult.Error(MyContants.ALREADT_ONCE, "")
// }
}
suspend
fun
getTimeOut
():
MyResult
<
Int
>
{
try
{
var
star
=
System
.
currentTimeMillis
()
clientRetrofitMethod
.
getTimeOut
()
var
end
=
System
.
currentTimeMillis
()
return
MyResult
.
Success
(
end
.
minus
(
star
).
toInt
())
}
catch
(
e
:
HttpException
)
{
return
MyResult
.
Error
(
e
.
code
(),
e
.
message
()
?:
"error"
)
}
catch
(
e
:
Exception
)
{
return
MyResult
.
Error
(
500
,
e
.
message
?:
"error"
)
}
}
// /**联网车辆状态数据***/
// suspend fun<T> genVehStatus():T {
//
...
...
app/src/main/java/com/sd/cavphmi/ui/BootActivity.kt
View file @
827d0a40
...
...
@@ -62,7 +62,7 @@ class BootActivity : BaseActivity<ActivityBootBinding, MyBaseViewModel>() {
var
jump
=
Intent
(
this
,
MainActivity
::
class
.
java
)
startActivity
(
jump
)
finish
()
},
10
00
)
},
10
)
}
fun
initMap
()
{
...
...
app/src/main/java/com/sd/cavphmi/ui/ExitAppDialog.kt
0 → 100644
View file @
827d0a40
package
com.sd.cavphmi.ui
import
android.app.Dialog
import
android.content.DialogInterface
import
android.os.Bundle
import
androidx.appcompat.app.AlertDialog
import
androidx.fragment.app.DialogFragment
import
com.sd.cavphmi.intfaces.OnConCan
class
ExitAppDialog
:
DialogFragment
()
{
var
onConCan
:
OnConCan
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
isCancelable
=
false
}
override
fun
onCreateDialog
(
savedInstanceState
:
Bundle
?):
Dialog
{
return
AlertDialog
.
Builder
(
requireContext
())
// dialog.setIcon(android.R.drawable.ic_dialog_info)
.
setTitle
(
"提示"
)
.
setMessage
(
"确定退出应用"
)
.
setPositiveButton
(
"确定"
)
{
dialog1
:
DialogInterface
?,
which
:
Int
->
onConCan
?.
onCon
()
}
.
setNegativeButton
(
"取消"
)
{
dialog
,
_
->
onConCan
?.
onCan
()
}.
create
()
}
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/ui/MainActivity.kt
View file @
827d0a40
package
com.sd.cavphmi.ui
import
android.content.DialogInterface
import
android.view.KeyEvent
import
androidx.a
ppcompat.app.AlertDialog
import
androidx.a
ctivity.viewModels
import
androidx.lifecycle.ViewModelProvider
import
com.sd.cavphmi.BR
import
com.sd.cavphmi.R
...
...
@@ -10,10 +9,12 @@ import com.sd.cavphmi.base.BaseActivity
import
com.sd.cavphmi.bean.CarVehicle
import
com.sd.cavphmi.bean.VehicleStats
import
com.sd.cavphmi.databinding.ActivityMainBinding
import
com.sd.cavphmi.
utils.DateUtils
import
com.sd.cavphmi.
intfaces.OnConCan
import
com.sd.cavphmi.viewmodels.MainVm
import
com.sd.cavphmi.viewmodels.MockVM
import
dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class
MainActivity
:
BaseActivity
<
ActivityMainBinding
,
MainVm
>()
{
...
...
@@ -21,7 +22,6 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainVm>() {
return
-
1
}
override
fun
initContentView
():
Int
{
return
R
.
layout
.
activity_main
}
...
...
@@ -34,15 +34,18 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainVm>() {
return
BR
.
vm
}
private
val
mockVM
:
MockVM
by
viewModels
()
private
lateinit
var
dialogFragment
:
ExitAppDialog
override
fun
initView
()
{
// viewModel.showVToTip()
viewModel
.
startWS
()
}
override
fun
getToData
()
{
viewModel
.
startWS
()
viewModel
.
getCurrentTime
()
viewModel
.
getMobileNetworkSignal
()
}
override
fun
initListener
()
{
...
...
@@ -50,6 +53,7 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainVm>() {
viewModel
.
subVehicle
().
observe
(
this
)
{
topicVehicle
(
it
)
}
// mockVM.onVehicleMock()
}
binding
.
btStatus
.
setOnClickListener
{
viewModel
.
subVehicleStatus
().
observe
(
this
)
{
...
...
@@ -69,12 +73,17 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainVm>() {
binding
.
btChewei
.
setOnClickListener
{
viewModel
.
subPoints
()
}
//订单数据
viewModel
.
orderBean
.
observe
(
this
)
{
binding
.
order
=
it
}
mockVM
.
orderBean
.
observe
(
this
)
{
binding
.
order
=
it
}
}
/**车辆姿态**/
private
fun
topicVehicle
(
bean
:
CarVehicle
)
{
var
time
=
DateUtils
.
longToString
(
bean
.
wsTime
,
DateUtils
.
FORMAT_TIME
)
binding
.
tvTime
.
setText
(
time
)
if
(
bean
.
vehicleData
?.
isNotEmpty
()
?:
false
)
{
viewModel
.
heading
.
set
(
bean
.
vehicleData
.
get
(
0
).
heading
.
toInt
())
viewModel
.
speed
.
set
(
bean
.
vehicleData
.
get
(
0
).
speed
)
...
...
@@ -98,29 +107,21 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainVm>() {
override
fun
dispatchKeyEvent
(
event
:
KeyEvent
):
Boolean
{
if
((
event
.
getKeyCode
()
==
KeyEvent
.
KEYCODE_BACK
)
||
event
.
getKeyCode
()
==
KeyEvent
.
KEYCODE_HOME
)
{
val
dialog
=
AlertDialog
.
Builder
(
this
)
// dialog.setIcon(android.R.drawable.ic_dialog_info)
dialog
.
setTitle
(
"提示"
)
dialog
.
setMessage
(
"确定退出应用"
)
dialog
.
setPositiveButton
(
"确定"
,
DialogInterface
.
OnClickListener
{
dialog1
:
DialogInterface
?,
which
:
Int
->
dialog1
?.
dismiss
()
viewModel
.
closeWS
()
// var ft = supportFragmentManager.beginTransaction()
dialogFragment
=
ExitAppDialog
()
dialogFragment
.
onConCan
=
object
:
OnConCan
{
override
fun
onCon
()
{
viewModel
.
cleanRes
()
finish
()
})
dialog
.
setNegativeButton
(
"取消"
,
DialogInterface
.
OnClickListener
{
dialog12
:
DialogInterface
?,
which
:
Int
->
dialog12
?.
dismiss
()
})
dialog
.
show
()
}
override
fun
onCan
()
{
}
}
dialogFragment
.
show
(
supportFragmentManager
,
"exit"
)
return
true
}
else
{
return
super
.
dispatchKeyEvent
(
event
)
}
}
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/utils/DateUtils.kt
View file @
827d0a40
...
...
@@ -9,7 +9,13 @@ import com.minedata.minenavi.addons.DistanceBean
import
com.minedata.minenavi.util.MineNaviUtil
import
java.text.ParseException
import
java.text.SimpleDateFormat
import
java.util.*
import
java.time.LocalTime
import
java.time.format.DateTimeFormatter
import
java.util.Calendar
import
java.util.Date
import
java.util.GregorianCalendar
import
java.util.Locale
import
java.util.TimeZone
/**
...
...
@@ -168,6 +174,11 @@ object DateUtils {
return
sdf
.
format
(
Date
())
}
fun
getCurrentTime12HourFormat
():
String
{
val
formatter
=
DateTimeFormatter
.
ofPattern
(
"hh:mm a"
,
Locale
.
CHINESE
)
return
LocalTime
.
now
().
format
(
formatter
)
}
/**
* 格林威治时间
*/
...
...
app/src/main/java/com/sd/cavphmi/utils/DisplayUtil.kt
View file @
827d0a40
package
com.
ltzw.adasdriver
.utils
package
com.
sd.cavphmi
.utils
import
android.app.Activity
import
android.content.Context
...
...
Prev
1
2
Next
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