Merge branch 'dev_robotaxi-d_230912_6.1.0' into base_3.4.0-map-sdk
This commit is contained in:
@@ -60,9 +60,11 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
|
||||
private lateinit var rootLayout: ConstraintLayout
|
||||
private lateinit var statusIcon: ImageView
|
||||
private lateinit var statusIconOuter: ImageView
|
||||
private lateinit var statusTitle: TextView
|
||||
private var listener: ClickEventListener? = null
|
||||
private var animator: ObjectAnimator? = null
|
||||
private var syncAnimator: ObjectAnimator? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_parallel_drive, this, true)
|
||||
@@ -79,6 +81,7 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
private fun initView() {
|
||||
rootLayout = findViewById(R.id.parDriveLayout)
|
||||
statusIcon = findViewById(R.id.ivStatusIcon)
|
||||
statusIconOuter = findViewById(R.id.ivStatusProgress)
|
||||
statusTitle = findViewById(R.id.tvAutopilotContent)
|
||||
rootLayout.setOnClickListener {
|
||||
when (state) {
|
||||
@@ -211,6 +214,8 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
when (state) {
|
||||
0 -> {
|
||||
stopRotateAnimation()
|
||||
stopSyncAnimation()
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.isEnabled = true
|
||||
rootLayout.alpha = 1f
|
||||
statusIcon.background =
|
||||
@@ -222,7 +227,9 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
APP_REQUESTING -> {
|
||||
stopSyncAnimation()
|
||||
rootLayout.isEnabled = true
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.alpha = 1f
|
||||
statusIcon.background =
|
||||
resources.getDrawable(R.drawable.icon_para_requesting, null)
|
||||
@@ -234,7 +241,9 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
AD_REQUESTING -> {
|
||||
stopSyncAnimation()
|
||||
rootLayout.isEnabled = false
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.alpha = 1f
|
||||
statusIcon.background =
|
||||
resources.getDrawable(R.drawable.icon_para_requesting, null)
|
||||
@@ -250,15 +259,19 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
rootLayout.isEnabled = false
|
||||
rootLayout.alpha = 1f
|
||||
statusIcon.background =
|
||||
resources.getDrawable(R.drawable.icon_para_syn, null)
|
||||
resources.getDrawable(R.drawable.icon_para_syn_inner, null)
|
||||
statusTitle.setTextColor(Color.parseColor("#FFFFFF"))
|
||||
statusIcon.alpha = 1f
|
||||
statusIconOuter.visibility = VISIBLE
|
||||
startSyncAnimation()
|
||||
statusTitle.text = context.getString(R.string.parallel_drive_synchronizing)
|
||||
rootLayout.background = resources.getDrawable(R.drawable.bg_auto_pilot, null)
|
||||
}
|
||||
|
||||
PARALLEL_DRIVING -> {
|
||||
stopRotateAnimation()
|
||||
stopSyncAnimation()
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.isEnabled = false
|
||||
rootLayout.alpha = 1f
|
||||
statusIcon.background =
|
||||
@@ -272,6 +285,8 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
|
||||
FAILURE -> {
|
||||
stopRotateAnimation()
|
||||
stopSyncAnimation()
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.isEnabled = false
|
||||
rootLayout.alpha = 1f
|
||||
rootLayout.postDelayed({
|
||||
@@ -287,6 +302,8 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
|
||||
ONE_EXCEPTION -> {
|
||||
stopRotateAnimation()
|
||||
stopSyncAnimation()
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.isEnabled = false
|
||||
rootLayout.alpha = 1f
|
||||
rootLayout.postDelayed({
|
||||
@@ -302,6 +319,8 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
|
||||
TWO_EXCEPTION -> {
|
||||
stopRotateAnimation()
|
||||
stopSyncAnimation()
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.isEnabled = false
|
||||
rootLayout.alpha = 1f
|
||||
rootLayout.postDelayed({
|
||||
@@ -317,7 +336,9 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
|
||||
UNAVAILABLE -> {
|
||||
stopRotateAnimation()
|
||||
rootLayout.isEnabled = false
|
||||
stopSyncAnimation()
|
||||
statusIconOuter.visibility = GONE
|
||||
rootLayout.isEnabled = true
|
||||
rootLayout.alpha = 0.4f
|
||||
statusIcon.background =
|
||||
resources.getDrawable(R.drawable.icon_autopilot_status, null)
|
||||
@@ -391,6 +412,28 @@ class ParallelDriveView @JvmOverloads constructor(
|
||||
it.cancel()
|
||||
}
|
||||
}
|
||||
statusIcon.rotation = 0f
|
||||
}
|
||||
|
||||
@SuppressLint("Recycle")
|
||||
private fun startSyncAnimation() {
|
||||
if (syncAnimator == null) {
|
||||
syncAnimator = ObjectAnimator.ofFloat(statusIconOuter, "rotation", 0f, 360f).apply {
|
||||
duration = 1500
|
||||
repeatMode = ValueAnimator.RESTART
|
||||
repeatCount = ValueAnimator.INFINITE
|
||||
interpolator = LinearInterpolator()
|
||||
}
|
||||
}
|
||||
syncAnimator?.start()
|
||||
}
|
||||
|
||||
private fun stopSyncAnimation() {
|
||||
syncAnimator?.let {
|
||||
if (it.isRunning) {
|
||||
it.cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
|
||||
@@ -16,6 +16,18 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="56dp"
|
||||
tools:background="@drawable/icon_para_syn_inner"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivStatusProgress"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="58dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginStart="72dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:background="@drawable/icon_para_syn_outer"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user