[6.5.0][道路事件][UI走查] 绿波通行UI调整

This commit is contained in:
renwj
2024-07-22 20:03:27 +08:00
parent a185fcb529
commit e3df85964b
9 changed files with 31 additions and 31 deletions

View File

@@ -140,8 +140,8 @@
app:layout_goneMarginTop="@dimen/dp_236" />
<com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_580"
android:layout_height="@dimen/dp_129"
android:layout_marginTop="@dimen/dp_71"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"

View File

@@ -256,10 +256,10 @@
app:layout_constraintEnd_toEndOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_50"
android:layout_marginBottom="-80dp"
android:layout_width="@dimen/dp_580"
android:layout_height="@dimen/dp_156"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginBottom="-60dp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/aciv_xiaozhi_normal"
app:layout_constraintEnd_toEndOf="parent" />

View File

@@ -139,11 +139,11 @@
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
<com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_580"
android:layout_height="@dimen/dp_129"
android:layout_marginTop="@dimen/dp_71"
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
app:layout_goneMarginEnd="40dp"
app:layout_goneMarginEnd="@dimen/dp_40"
app:layout_goneMarginTop="@dimen/dp_236"
android:visibility="invisible"
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>

View File

@@ -267,11 +267,11 @@
app:layout_constraintEnd_toEndOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_50"
android:layout_width="@dimen/dp_580"
android:layout_height="@dimen/dp_156"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginBottom="-60dp"
app:layout_constraintBottom_toTopOf="@id/aciv_xiaozhi_normal"
android:layout_marginBottom="-80dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" />

View File

@@ -20,10 +20,9 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.scope
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.rv.divider.CommonDividerItemDecoration
import com.mogo.eagle.core.utilcode.util.SizeUtils
import kotlinx.coroutines.Runnable
import kotlinx.coroutines.launch
import me.jessyan.autosize.utils.AutoSizeUtils
import kotlin.math.abs
import kotlinx.android.synthetic.main.view_green_wave_passenger_layout.view.speed as passenger_speed
import kotlinx.android.synthetic.main.view_green_wave_driver_layout.view.speed as driver_speed
@@ -55,11 +54,13 @@ class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerVi
private class WaveHolder(item: ImageView): RecyclerView.ViewHolder(item)
private class WaveAdapter: RecyclerView.Adapter<WaveHolder>() {
private inner class WaveAdapter: RecyclerView.Adapter<WaveHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WaveHolder {
val item = ImageView(parent.context)
item.layoutParams = RecyclerView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT)
val width = if (isDriver) 156 / 153 * AutoSizeUtils.dp2px(parent.context, 129f) else AutoSizeUtils.dp2px(parent.context, 156f)
val height = (153 * 1.0 / 156 * width).toInt()
item.layoutParams = RecyclerView.LayoutParams(width, height)
return WaveHolder(item)
}
@@ -144,10 +145,10 @@ class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerVi
scope.launch {
this@GreenWaveView.visibility = View.VISIBLE
val rv: RecyclerView? = if (isDriver) driver_wave_rv else passenger_wave_rv
rv?.addItemDecoration(CommonDividerItemDecoration.Builder()
.spanCountTBCare(false)
.horizontalInnerSpace(SizeUtils.dp2px(10f))
.build())
// rv?.addItemDecoration(CommonDividerItemDecoration.Builder()
// .spanCountTBCare(false)
// .horizontalInnerSpace(SizeUtils.dp2px(10f))
// .build())
rv?.addOnItemTouchListener(this@GreenWaveView)
rv?.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, true)
rv?.adapter = WaveAdapter()

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/dp_20" />
<corners android:radius="@dimen/dp_36" />
<solid android:color="#43D1A6" />
</shape>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/dp_20" />
<corners android:radius="@dimen/dp_36" />
<gradient
android:startColor="#68E0BB"
android:endColor="#b072ECC3"/>

View File

@@ -2,8 +2,8 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:background="@drawable/bg_green_wave_driver"
tools:layout_height="wrap_content"
tools:layout_width="wrap_content"
tools:layout_height="@dimen/dp_129"
tools:layout_width="@dimen/dp_580"
tools:parentTag="android.widget.LinearLayout">
<LinearLayout
@@ -44,7 +44,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/wave_rv"
android:layout_width="@dimen/dp_400"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_129"
android:layout_centerVertical="true"/>

View File

@@ -2,8 +2,8 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:parentTag="android.widget.LinearLayout"
tools:layout_width="wrap_content"
tools:layout_height="wrap_content"
tools:layout_width="@dimen/dp_580"
tools:layout_height="@dimen/dp_156"
tools:gravity="center_vertical"
tools:background="@drawable/bg_green_wave_passenger">
@@ -44,8 +44,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/wave_rv"
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_155"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_156"
android:layout_centerVertical="true"/>
<LinearLayout
@@ -74,5 +74,4 @@
tools:text="可丝滑通过2个路口" />
</LinearLayout>
</RelativeLayout>
</merge>