Commit a8ab6745 authored by p x's avatar p x
Browse files

添加居中提示字的逻辑

parent 4e15cda9
...@@ -13,6 +13,8 @@ import kotlin.math.sqrt ...@@ -13,6 +13,8 @@ import kotlin.math.sqrt
/**坐标投影转换工具***/ /**坐标投影转换工具***/
object Proj4jCoord { object Proj4jCoord {
private val crsFactory: CRSFactory = CRSFactory() private val crsFactory: CRSFactory = CRSFactory()
//返回结果
private val resultArray=doubleArrayOf(0.0, 0.0, 0.0, 0.0)
// 定义坐标系参数 // 定义坐标系参数
private const val WGS84_PARAMS = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" private const val WGS84_PARAMS = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
...@@ -50,13 +52,13 @@ object Proj4jCoord { ...@@ -50,13 +52,13 @@ object Proj4jCoord {
val projectedPoint = doubleArrayOf(dstCoord.x, dstCoord.y) val projectedPoint = doubleArrayOf(dstCoord.x, dstCoord.y)
// 转换坐标点串到CGCS2000坐标系 // 转换坐标点串到CGCS2000坐标系
var projectedSeries = mutableListOf<DoubleArray>() // var projectedSeries = mutableListOf<DoubleArray>()
for (coord in coordinateSeries) { // for (coord in coordinateSeries) {
projectedSeries.add(doubleArrayOf(coord[0], coord[1])) // projectedSeries.add(doubleArrayOf(coord[0], coord[1]))
} // }
// 计算点到线串的最短距离和投影点 // 计算点到线串的最短距离和投影点
return findNearestProjection(projectedPoint, projectedSeries) return findNearestProjection(projectedPoint, coordinateSeries)
} catch (e: Proj4jException) { } catch (e: Proj4jException) {
e.printStackTrace() e.printStackTrace()
return doubleArrayOf(0.0, 0.0, -1.0, -1.0) return doubleArrayOf(0.0, 0.0, -1.0, -1.0)
...@@ -90,13 +92,19 @@ object Proj4jCoord { ...@@ -90,13 +92,19 @@ object Proj4jCoord {
projectionPoint = currentProjection projectionPoint = currentProjection
} }
} }
resultArray.set(0,projectionPoint[0])
return doubleArrayOf( resultArray.set(1,projectionPoint[1])
projectionPoint[0], resultArray.set(2,nearestIndex.toDouble())
projectionPoint[1], resultArray.set(3,minDistance)
nearestIndex.toDouble(),
minDistance return resultArray
)
// return doubleArrayOf(
// projectionPoint[0],
// projectionPoint[1],
// nearestIndex.toDouble(),
// minDistance
// )
} }
......
...@@ -32,7 +32,7 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() { ...@@ -32,7 +32,7 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() {
// //航向角 // //航向角
carPanelBean.heading.set(bean.heading.toInt()) carPanelBean.heading.set(bean.heading.toInt())
//档位 //档位
// carPanelBean.tapPos.set(vehicleInfo.tapPos.toInt()) carPanelBean.tapPos.set(bean.gear)
//驾驶模式 //驾驶模式
// carPanelBean.driveMode.set(vehicleInfo.driveMode.toInt()) // carPanelBean.driveMode.set(vehicleInfo.driveMode.toInt())
//剩余电量 //剩余电量
...@@ -42,31 +42,11 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() { ...@@ -42,31 +42,11 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() {
// var a = 0 // var a = 0
} }
/**设置档位类型*****/
fun setGearType(gearType: String) {
when (gearType) {
"PARK" -> {
carPanelBean.tapPos.set(GearStatus.P)
}
"REVERSE" -> {
carPanelBean.tapPos.set(GearStatus.R)
}
"NEUTRAL" -> {
carPanelBean.tapPos.set(GearStatus.N)
}
"DRIVE" -> {
carPanelBean.tapPos.set(GearStatus.D)
}
}
}
fun mock() { fun mock() {
changeMockHeading() changeMockHeading()
changeMockDriveMode() // changeMockDriveMode()
changeMockLight() // changeMockLight()
changeMockPro() changeMockPro()
changeMockGear() changeMockGear()
changeMockSpeed() changeMockSpeed()
...@@ -75,16 +55,16 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() { ...@@ -75,16 +55,16 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() {
private fun changeMockHeading() { private fun changeMockHeading() {
viewModelScope.launch { viewModelScope.launch {
var list = mutableListOf<Float>() var list = mutableListOf<Int>()
var ramdom = Random(360) var ramdom = Random(360)
for (i in 1..360) { for (i in 1..360) {
list.add(ramdom.nextInt(360).toFloat()) list.add(ramdom.nextInt(360))
} }
list.forEach { list.forEach {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
delay(1100) carPanelBean.heading.set(it)
delay(600)
} }
// carPanelBean.heading.set(it)
} }
} }
} }
...@@ -132,13 +112,13 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() { ...@@ -132,13 +112,13 @@ class CarPanelVM @Inject constructor() : MyBaseViewModel() {
//模拟档位 //模拟档位
private fun changeMockGear() { private fun changeMockGear() {
var list = listOf(31, 32, 33, 34) var list = listOf(0, 1, 2, 3, 7)
viewModelScope.launch { viewModelScope.launch {
for (i in 1..100) { for (i in 1..100) {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
delay(1000) delay(1000)
} }
var p = i % 4 var p = i % 5
carPanelBean.tapPos.set(list.get(p)) carPanelBean.tapPos.set(list.get(p))
} }
} }
......
...@@ -159,7 +159,6 @@ class MainVm @Inject constructor( ...@@ -159,7 +159,6 @@ class MainVm @Inject constructor(
FileIoUtils.writeToFile(str, "space_info.txt") FileIoUtils.writeToFile(str, "space_info.txt")
spaceInfo.postValue(result.data) spaceInfo.postValue(result.data)
} }
else -> { else -> {
} }
} }
...@@ -257,7 +256,10 @@ class MainVm @Inject constructor( ...@@ -257,7 +256,10 @@ class MainVm @Inject constructor(
feelTargetWSClient.onDataCb = object : FeelTargetWSClient.OnDataCb { feelTargetWSClient.onDataCb = object : FeelTargetWSClient.OnDataCb {
override fun onMsg(str: String) { override fun onMsg(str: String) {
viewModelScope.launch { viewModelScope.launch {
// FileIoUtils.writeToFile(str, "PerTarget.txt") //下载到sd卡下面的DownLoad文件夹下面
if (!str.isNullOrEmpty()){
FileIoUtils.writeToFile(str, "PerTarget.txt")
}
var bean = gson.fromJson(str, PerceptionBean::class.java) var bean = gson.fromJson(str, PerceptionBean::class.java)
targetPre.postValue(bean) targetPre.postValue(bean)
} }
......
...@@ -56,16 +56,21 @@ class MapOpt @Inject constructor( ...@@ -56,16 +56,21 @@ class MapOpt @Inject constructor(
//是否生成小地图线 //是否生成小地图线
private var smallMapLine = false private var smallMapLine = false
//全局路径
private var allLines: List<AllLine>? = null
//画全局路径 //画全局路径
fun drawAllLines(drivenDecision: DrivenDecision) { fun drawAllLines(drivenDecision: DrivenDecision) {
if (drivenDecision.trajectory.points.count() > 0) { if (drivenDecision.trajectory.points.count() > 0) {
var lines = drivenDecision.trajectory.points.map { if (allLines == null || allLines?.count() == 0) {
AllLine().apply { allLines = drivenDecision.trajectory.points.map {
this.lat = it.latitude AllLine().apply {
this.lon = it.longitude this.lat = it.latitude
this.lon = it.longitude
}
} }
HighMapApi.setCarNavPath(allLines!!, drawpassed = true, showdistance = 200)
} }
HighMapApi.setCarNavPath(lines, drawpassed = true, showdistance = 200)
} }
var arrived = drivenDecision.trajectory.arrived var arrived = drivenDecision.trajectory.arrived
if (arrived) { if (arrived) {
...@@ -111,6 +116,7 @@ class MapOpt @Inject constructor( ...@@ -111,6 +116,7 @@ class MapOpt @Inject constructor(
return return
if (drivenDecision.trajectory.points.count() > 0) { if (drivenDecision.trajectory.points.count() > 0) {
smallMapLine = true smallMapLine = true
//转换小弟提路径点
sLatLngs = drivenDecision.trajectory.points.map { sLatLngs = drivenDecision.trajectory.points.map {
Tools.latLngToPoint(LatLng(it.latitude, it.longitude)) Tools.latLngToPoint(LatLng(it.latitude, it.longitude))
}.toTypedArray() }.toTypedArray()
...@@ -127,16 +133,17 @@ class MapOpt @Inject constructor( ...@@ -127,16 +133,17 @@ class MapOpt @Inject constructor(
fun upSmallMapLine(carVehicleItem: CarVehicleItem) { fun upSmallMapLine(carVehicleItem: CarVehicleItem) {
deleteSmapLine() deleteSmapLine()
viewModelScope.launch(Dispatchers.Default) { viewModelScope.launch(Dispatchers.Default) {
var latlng = LatLng(carVehicleItem.latitude, carVehicleItem.longitude)
if (coordinateSeries.count() > 0) { if (coordinateSeries.count() > 0) {
//当前车辆位置
var latlng = LatLng(carVehicleItem.latitude, carVehicleItem.longitude)
//投影计算结果
var result = Proj4jCoord.calculatePointProjection( var result = Proj4jCoord.calculatePointProjection(
doubleArrayOf(latlng.latitude, latlng.longitude), doubleArrayOf(latlng.latitude, latlng.longitude),
coordinateSeries coordinateSeries
) )
println("----最近线段索引: " + result[2].toInt()) // println("----最近线段索引: " + result[2].toInt())
var index = result[2].toInt() var index = result[2].toInt()
var temps = sLatLngs?.sliceArray(index.. sLatLngs!!.lastIndex) var temps = sLatLngs?.sliceArray(index..sLatLngs!!.lastIndex)
deleteSmapLine() deleteSmapLine()
if (sLatLngs == null) { if (sLatLngs == null) {
...@@ -155,11 +162,13 @@ class MapOpt @Inject constructor( ...@@ -155,11 +162,13 @@ class MapOpt @Inject constructor(
fun addEndMarker(endPoint: EndPoint) { fun addEndMarker(endPoint: EndPoint) {
//删除终点marker //删除终点marker
deleteEndMarker() deleteEndMarker()
var mEndPoint = LatLng(endPoint.latitude, endPoint.longitude) if (pEndMarker == null) {
val end_icon = BitmapFactory.decodeResource(context.resources, R.drawable.plan_end) var mEndPoint = LatLng(endPoint.latitude, endPoint.longitude)
pEndMarker = mMineMap?.addMarker( val end_icon = BitmapFactory.decodeResource(context.resources, R.drawable.plan_end)
MarkerOptions().zLevel(7).position(mEndPoint).bitmap(end_icon) pEndMarker = mMineMap?.addMarker(
) MarkerOptions().zLevel(7).position(mEndPoint).bitmap(end_icon)
)
}
} }
...@@ -184,7 +193,7 @@ class MapOpt @Inject constructor( ...@@ -184,7 +193,7 @@ class MapOpt @Inject constructor(
if (businessType == "Park") { if (businessType == "Park") {
HighMapApi.parkRoundLight(space.code) HighMapApi.parkRoundLight(space.code)
} else { } else {
HighMapApi.parkRoundLight("") // HighMapApi.parkRoundLight("")
} }
} }
......
...@@ -38,7 +38,7 @@ class FeelTargetWSClient : WebSocketClient { ...@@ -38,7 +38,7 @@ class FeelTargetWSClient : WebSocketClient {
} }
override fun onMessage(message: String?) { override fun onMessage(message: String?) {
println(TAG + " : " + message) // println(TAG + " : " + message)
if (message.isNullOrEmpty()) if (message.isNullOrEmpty())
return return
onDataCb?.onMsg(message) onDataCb?.onMsg(message)
......
...@@ -22,7 +22,7 @@ class V2xWSClient : WebSocketClient { ...@@ -22,7 +22,7 @@ class V2xWSClient : WebSocketClient {
override fun onOpen(handshakedata: ServerHandshake?) { override fun onOpen(handshakedata: ServerHandshake?) {
// send("Hello, it is me. Mario :)") // send("Hello, it is me. Mario :)")
// System.out.println(TAG + "new connection opened") println(TAG + "------------Hello, v2x预警")
} }
override fun onMessage(message: String?) { override fun onMessage(message: String?) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="14dp"/>
<solid android:color="@color/black"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle" >
<corners android:radius="10dp"/>
<corners android:radius="20dp" />
<solid android:color="@android:color/transparent" />
</shape> </shape>
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:visibility="gone"
android:background="@color/white"> android:background="@color/white">
...@@ -62,7 +63,7 @@ ...@@ -62,7 +63,7 @@
android:background="@null" android:background="@null"
android:hint="请输入账号" android:hint="请输入账号"
android:maxLines="1" android:maxLines="1"
android:text="18501971666" android:text="hmi"
android:textColor="@color/text_black" android:textColor="@color/text_black"
android:textSize="10sp" /> android:textSize="10sp" />
...@@ -93,7 +94,7 @@ ...@@ -93,7 +94,7 @@
android:hint="请输入密码" android:hint="请输入密码"
android:inputType="textPassword" android:inputType="textPassword"
android:maxLines="1" android:maxLines="1"
android:text="vUO2dStZDhbd*88FfT84" android:text="8ax@Gke#13297567890"
android:textColor="@color/text_black" android:textColor="@color/text_black"
android:textSize="10sp" /> android:textSize="10sp" />
...@@ -114,12 +115,7 @@ ...@@ -114,12 +115,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<Button
android:id="@+id/bt_vehinfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="获取车辆信息"
android:visibility="visible" />
<Button <Button
android:id="@+id/bt_spaceinfo" android:id="@+id/bt_spaceinfo"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout 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"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
...@@ -28,20 +29,31 @@ ...@@ -28,20 +29,31 @@
<!-- 车辆仪表--> <!-- 车辆仪表-->
<FrameLayout <FrameLayout
android:id="@+id/map_car_pan" android:id="@+id/map_car_pan"
android:layout_width="@dimen/map_left_top_widget" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10" /> android:layout_marginTop="@dimen/dp_10" />
<!-- 距离提示-->
<fragment
android:id="@+id/distantTipFragment"
class="com.sd.cavphmi.ui.fragment.DistantTipFragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignTop="@id/map_car_pan"
/>
<!-- 预警气泡 从别的醒目扣过来的,就复用这个吧--> <!-- 预警气泡 从别的醒目扣过来的,就复用这个吧-->
<fragment <fragment
android:id="@+id/earlyWarnFragment" android:id="@+id/earlyWarnFragment"
android:name="com.sd.cavphmi.ui.fragment.WarnFragment" class="com.sd.cavphmi.ui.fragment.WarnFragment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/distantTipFragment"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="5dp" /> android:layout_marginTop="8dp" />
<LinearLayout <LinearLayout
...@@ -59,31 +71,40 @@ ...@@ -59,31 +71,40 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/text_blue" android:background="@color/text_blue"
android:paddingVertical="5dp" android:paddingVertical="5dp"
android:textColor="@color/white" android:text="网联车辆位姿"
android:text="网联车辆位姿" /> android:textColor="@color/white" />
<TextView <TextView
android:id="@+id/bt_target" android:id="@+id/bt_target"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@color/text_blue" android:background="@color/text_blue"
android:paddingVertical="5dp" android:paddingVertical="5dp"
android:layout_marginLeft="5dp" android:text="感知目标物数据"
android:textColor="@color/white" android:textColor="@color/white" />
android:text="感知目标物数据" />
<TextView <TextView
android:id="@+id/bt_v2x" android:id="@+id/bt_v2x"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@color/text_blue" android:background="@color/text_blue"
android:paddingVertical="5dp" android:paddingVertical="5dp"
android:layout_marginLeft="5dp" android:text="V2X预警开始"
android:textColor="@color/white" android:textColor="@color/white" />
android:text="V2X预警开始" />
<TextView
android:id="@+id/bt_vehinfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@color/text_blue"
android:paddingVertical="5dp"
android:text="车辆详情" />
<TextView <TextView
android:id="@+id/bt_status" android:id="@+id/bt_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -96,11 +117,11 @@ ...@@ -96,11 +117,11 @@
android:id="@+id/bt_avpStatu" android:id="@+id/bt_avpStatu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@color/text_blue" android:background="@color/text_blue"
android:paddingVertical="5dp" android:paddingVertical="5dp"
android:textColor="@color/white" android:text="AVP状态"
android:layout_marginLeft="5dp" android:textColor="@color/white" />
android:text="AVP状态" />
<TextView <TextView
android:id="@+id/bt_parkround" android:id="@+id/bt_parkround"
...@@ -132,21 +153,21 @@ ...@@ -132,21 +153,21 @@
android:id="@+id/warn_car" android:id="@+id/warn_car"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@color/text_blue" android:background="@color/text_blue"
android:paddingVertical="5dp" android:paddingVertical="5dp"
android:layout_marginLeft="5dp" android:text="预警车"
android:textColor="@color/white" android:textColor="@color/white" />
android:text="预警车" />
<TextView <TextView
android:id="@+id/warn_peo" android:id="@+id/warn_peo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@color/text_blue" android:background="@color/text_blue"
android:paddingVertical="5dp" android:paddingVertical="5dp"
android:textColor="@color/white" android:text="预警人"
android:layout_marginLeft="5dp" android:textColor="@color/white" />
android:text="预警人" />
</LinearLayout> </LinearLayout>
...@@ -159,12 +180,12 @@ ...@@ -159,12 +180,12 @@
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/rect_no_col_10" /> android:clipChildren="true" />
<FrameLayout <FrameLayout
android:layout_width="@dimen/small_map_width" android:id="@+id/small_f_layout"
android:layout_height="@dimen/small_map_height" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/dp_10" android:layout_marginEnd="@dimen/dp_10"
......
...@@ -18,15 +18,16 @@ ...@@ -18,15 +18,16 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/rect_white_10"
android:elevation="1dp" android:elevation="1dp"
android:orientation="vertical" android:orientation="vertical"
android:paddingHorizontal="10dp" android:paddingHorizontal="10dp"
android:paddingTop="5dp" android:paddingTop="5dp"
android:paddingBottom="5dp"> android:background="@drawable/rect_white_10"
android:paddingBottom="8dp">
<TextView <TextView
android:id="@+id/tv_speed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
...@@ -35,7 +36,6 @@ ...@@ -35,7 +36,6 @@
android:paddingBottom="0dp" android:paddingBottom="0dp"
android:textSize="50sp" android:textSize="50sp"
android:textStyle="bold" android:textStyle="bold"
android:text="37"
app:showSpeed="@{cpBean.speed}" app:showSpeed="@{cpBean.speed}"
tools:text="60" /> tools:text="60" />
...@@ -47,14 +47,14 @@ ...@@ -47,14 +47,14 @@
android:id="@+id/lin_dang" android:id="@+id/lin_dang"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_kmh" android:layout_alignBottom="@+id/tv_kmh"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/tv_p" android:id="@+id/tv_p"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:tag="33" android:tag="1"
android:text="P" android:text="P"
android:textColor="@color/text_grey" android:textColor="@color/text_grey"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:tag="32" android:tag="3"
android:text="R" android:text="R"
android:textColor="@color/text_grey" android:textColor="@color/text_grey"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:tag="34" android:tag="0"
android:text="N" android:text="N"
android:textColor="@color/text_grey" android:textColor="@color/text_grey"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:tag="31" android:tag="2"
android:text="D" android:text="D"
android:textColor="@color/text_grey" android:textColor="@color/text_grey"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
...@@ -102,16 +102,17 @@ ...@@ -102,16 +102,17 @@
<LinearLayout <LinearLayout
android:id="@+id/lin_elec" android:id="@+id/lin_elec"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_alignParentRight="true" android:layout_alignParentEnd="true"
android:layout_alignBottom="@id/lin_dang"
android:gravity="center_vertical"> android:gravity="center_vertical">
<!-- android:src="@drawable/remaining_elec"--> <!-- android:src="@drawable/remaining_elec"-->
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingVertical="3dp" android:paddingTop="3dp"
android:scaleType="centerCrop" android:scaleType="fitXY"
android:src="@drawable/remaining_elec" /> android:src="@drawable/remaining_elec" />
<LinearLayout <LinearLayout
...@@ -121,21 +122,19 @@ ...@@ -121,21 +122,19 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_soc"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="70%" app:showProTv="@{cpBean.remainSoc}"
tools:text="90%" /> tools:text="90%" />
<ProgressBar <ProgressBar
android:id="@+id/pro_soc"
style="@style/MyProgressBarStyle" style="@style/MyProgressBarStyle"
android:layout_width="@dimen/dp_40" android:layout_width="@dimen/dp_40"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:max="100" android:max="100"
app:showProgress="@{cpBean.remainSoc}"
android:minHeight="8dp" android:minHeight="8dp"
android:paddingVertical="0dp" android:paddingVertical="0dp"
app:showProgress="@{cpBean.remainSoc}"
tools:progress="50" /> tools:progress="50" />
</LinearLayout> </LinearLayout>
...@@ -146,11 +145,10 @@ ...@@ -146,11 +145,10 @@
android:id="@+id/tv_kmh" android:id="@+id/tv_kmh"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:text="KM/H" android:text="KM/H"
android:textColor="@color/text_grey" android:textColor="#66000000"
android:textSize="@dimen/sp_13" /> android:textSize="@dimen/sp_13" />
<FrameLayout <FrameLayout
...@@ -162,14 +160,14 @@ ...@@ -162,14 +160,14 @@
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_gravity="bottom" android:layout_gravity="center_vertical"
android:src="@color/text_grey" /> android:src="#ffd7d8d8" />
<ImageView <ImageView
android:layout_width="@dimen/dp_20" android:layout_width="@dimen/dp_20"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center"
android:src="@color/text_black" /> android:src="@drawable/rect_black_14" />
</FrameLayout> </FrameLayout>
...@@ -178,7 +176,7 @@ ...@@ -178,7 +176,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"> android:layout_marginTop="8dp">
<ImageView <ImageView
android:id="@+id/img_auto" android:id="@+id/img_auto"
...@@ -186,10 +184,8 @@ ...@@ -186,10 +184,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:src="@drawable/icon_auto_driver" /> android:src="@drawable/icon_auto_driver" />
<!-- app:showAutoDri="@{cpBean.driveMode}"-->
<!-- app:showAutoDri="@{cpBean.driveMode}"-->
<TextView <TextView
android:id="@+id/tv_drivemode"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
...@@ -198,7 +194,7 @@ ...@@ -198,7 +194,7 @@
android:text="自动驾驶" android:text="自动驾驶"
android:textColor="@color/text_black" android:textColor="@color/text_black"
android:textSize="@dimen/sp_12" android:textSize="@dimen/sp_12"
/> />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -207,20 +203,18 @@ ...@@ -207,20 +203,18 @@
app:showTurnLight="@{cpBean.lights}"> app:showTurnLight="@{cpBean.lights}">
<ImageView <ImageView
android:id="@+id/iv_left_light"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:tag="left"
android:src="@drawable/trun_left_grey" android:src="@drawable/trun_left_grey"
android:tag="left"
tools:src="@drawable/trun_left_grey" /> tools:src="@drawable/trun_left_grey" />
<ImageView <ImageView
android:id="@+id/iv_right_light"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20" android:layout_marginLeft="@dimen/dp_20"
android:tag="right"
android:src="@drawable/trun_right_grey" android:src="@drawable/trun_right_grey"
android:tag="right"
tools:src="@drawable/trun_right_blue" /> tools:src="@drawable/trun_right_blue" />
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
tools:context=".ui.fragment.DistantTipFragment">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_auto_driver" />
<TextView
android:id="@+id/tv_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/black"
android:layout_marginLeft="5dp" />
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -3,23 +3,37 @@ ...@@ -3,23 +3,37 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- <FrameLayout xmlns:tools="http://schemas.android.com/tools"--> <FrameLayout
<!-- android:layout_width="match_parent"--> android:layout_width="match_parent"
<!-- android:layout_height="match_parent"--> android:layout_height="match_parent"
<!-- --> android:background="@drawable/rect_white_small_map_4"
<!-- tools:context=".ui.fragment.ExoPlayFragment">--> android:clipToOutline="true"
android:padding="3dp">
<!-- app:show_shuffle_button="true"--> <!-- app:show_shuffle_button="true"-->
<!-- app:show_subtitle_button="true"--> <!-- app:show_subtitle_button="true"-->
<!-- app:resize_mode="fill"-->
<androidx.media3.ui.PlayerView <androidx.media3.ui.PlayerView
android:id="@+id/player_view" android:id="@+id/player_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:resize_mode="fill" /> app:artwork_display_mode="fill"
app:resize_mode="fill"
app:use_controller="false" />
<!-- <com.sd.cavphmi.ui.view.RoundedPlayerView-->
<!-- android:id="@+id/player_view"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- app:resize_mode="fill"-->
<!-- android:clipToOutline="true"/>-->
<!-- </FrameLayout>--> <!-- <-->
<!-- </androidx.cardview.widget.CardView>-->
</FrameLayout>
</layout> </layout>
......
<?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/nav_graph"
app:startDestination="@id/FirstFragment">
<fragment
android:id="@+id/FirstFragment"
android:name="com.sd.cavphmi.ui.FirstFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first">
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/SecondFragment" />
</fragment>
<fragment
android:id="@+id/SecondFragment"
android:name="com.sd.cavphmi.ui.SecondFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
</fragment>
</navigation>
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<resources> <resources>
<dimen name="dp_5">5dp</dimen> <dimen name="dp_5">5dp</dimen>
<dimen name="dp_8">8dp</dimen>
<dimen name="dp_10">10dp</dimen> <dimen name="dp_10">10dp</dimen>
<dimen name="dp_15">15dp</dimen> <dimen name="dp_15">15dp</dimen>
<dimen name="dp_20">20dp</dimen> <dimen name="dp_20">20dp</dimen>
......
<resources> <resources>
<string name="game_view_content_description">Game view</string> <string name="game_view_content_description">Game view</string>
<string name="app_name">C-adas AVP</string> <string name="app_name">C-AVP</string>
<!-- TODO: Remove or change this placeholder text --> <!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string> <string name="hello_blank_fragment">Hello blank fragment</string>
<!-- Strings used for fragments for navigation --> <!-- Strings used for fragments for navigation -->
......
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
<!-- <domain-config cleartextTrafficPermitted="true">-->
<!-- <domain includeSubdomains="true">minedata.cn</domain>-->
<!-- </domain-config>-->
</network-security-config>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment