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
GeelyHMIWeb
Commits
fdd7fd19
Commit
fdd7fd19
authored
Oct 17, 2025
by
p x
Browse files
1
parent
6b9a3463
Changes
5
Show whitespace changes
Inline
Side-by-side
.kotlin/sessions/kotlin-compiler-5892032229631614990.salive
deleted
100644 → 0
View file @
6b9a3463
app/src/main/java/com/sd/geelyhmiweb/JsApi.kt
View file @
fdd7fd19
...
...
@@ -12,21 +12,21 @@ class JsApi {
//同步API
@JavascriptInterface
fun
testSyn
(
msg
:
String
):
String
{
fun
testSyn
(
msg
:
Object
):
String
{
return
msg
.
toString
()
+
"[syn call]"
}
//异步API
@JavascriptInterface
fun
testAsyn
(
msg
:
String
,
handler
:
CompletionHandler
<
String
?
>)
{
fun
testAsyn
(
msg
:
Object
,
handler
:
CompletionHandler
<
String
?
>)
{
handler
.
complete
(
msg
.
toString
()
+
" [ asyn call]"
)
}
@JavascriptInterface
fun
writeLog
(
msg
:
String
)
{
println
(
"------------
writeLog"
)
mainVM
?.
writeLog
(
msg
)
fun
writeLog
(
msg
:
Object
)
{
println
(
"------------writeLog
${msg}
"
)
mainVM
?.
writeLog
(
msg
.
toString
()
)
// FileIoUtils.writeToFile(gson.toJson(perceptionBean), "PerTarget_15_move.txt")
}
...
...
app/src/main/java/com/sd/geelyhmiweb/MainActivity.kt
View file @
fdd7fd19
...
...
@@ -54,11 +54,9 @@ class MainActivity : AppCompatActivity() {
setAllowFileAccessFromFileURLs
(
true
)
setAllowUniversalAccessFromFileURLs
(
true
)
}
val
url
=
"file:///android_asset/dist/index.html"
// val url = "http://192.168.60.134:8081/#/index.html"
// val url = "http://82.156.182.48:8088/3dmap/"
// val url = "https://10.149.230.104:19443/shudao-navigation3d-app/index"
// val url = "https://172.29.128.38:13443/shudao-navigation3d-app/index"
// val url = "file:///android_asset/dist/index.html"
val
url
=
"http://192.168.60.109:5101/#/"
binding
.
dwebview
.
loadUrl
(
url
)
binding
.
dwebview
.
webViewClient
=
object
:
WebViewClient
()
{
...
...
app/src/main/java/com/sd/geelyhmiweb/utils/DateUtils.kt
View file @
fdd7fd19
...
...
@@ -29,6 +29,7 @@ object DateUtils {
val
FORMAT_DATE_TIME
=
"yyyy-MM-dd HH:mm"
val
FORMAT_DATE1_TIME
=
"yyyy/MM/dd HH:mm"
val
FORMAT_DATE_TIME_SECOND
=
"yyyy-MM-dd HH:mm:ss"
val
FORMAT_DATE_TIME_SECOND_MIll
=
"yyyy-MM-dd HH:mm:ss.SSS"
val
FORMAT_MM_DD
=
"MM.dd"
val
FORMAT_YYYY_MM_DD
=
"yyyy.MM.dd"
val
FORMAT_DATE_CHINA
=
"yyyy年MM月dd日"
...
...
app/src/main/java/com/sd/geelyhmiweb/viewmodels/MainVM.kt
View file @
fdd7fd19
...
...
@@ -3,6 +3,7 @@ package com.sd.geelyhmiweb.viewmodels
import
android.content.Context
import
androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
com.sd.geelyhmiweb.utils.DateUtils
import
com.sd.geelyhmiweb.utils.FileIoUtils
import
dagger.hilt.android.lifecycle.HiltViewModel
import
dagger.hilt.android.qualifiers.ApplicationContext
...
...
@@ -18,7 +19,8 @@ class MainVM @Inject constructor(
fun
writeLog
(
str
:
String
){
viewModelScope
.
launch
{
FileIoUtils
.
writeToFile
(
str
,
"log.txt"
)
var
time
=
DateUtils
.
getCurrentTime
(
DateUtils
.
FORMAT_DATE_TIME_SECOND_MIll
)
FileIoUtils
.
writeToFile
(
"$time ${str}"
,
"web_log.txt"
)
}
}
...
...
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