[fea]
[电量展示优化]
This commit is contained in:
yangyakun
2024-11-20 17:04:08 +08:00
parent 81758ae33a
commit ddafb900cb
3 changed files with 15 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.shuttle.weaknet.passenger.R
import kotlinx.android.synthetic.main.shuttle_p_m2_view_status_bar.view.aciv_wait_ele
import kotlinx.android.synthetic.main.shuttle_p_m2_view_status_bar.view.progress
import kotlinx.android.synthetic.main.shuttle_p_m2_view_status_bar.view.tv_power_cos
import kotlinx.coroutines.*
@@ -64,10 +65,11 @@ class M2StatusBarView @JvmOverloads constructor(
CallerChassisStatesListenerManager.addListener(TAG,this)
progress?.also {
it.progress = 50
it.progress = 0
aciv_wait_ele.visibility = VISIBLE
}
tv_power_cos?.also {
it.text = "50%"
it.text = "检测中"
}
}
@@ -104,6 +106,7 @@ class M2StatusBarView @JvmOverloads constructor(
progress?.also { it.progress = power }
tv_power_cos?.also {it.text = "$power%" }
}
aciv_wait_ele.visibility = GONE
}
}
} finally {

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

View File

@@ -58,6 +58,16 @@
app:layout_constraintRight_toLeftOf="@+id/tv_power_cos"
app:layout_constraintTop_toTopOf="@+id/iv_logon" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_wait_ele"
android:src="@drawable/shuttle_p_m2_electricity"
app:layout_constraintTop_toTopOf="@+id/progress"
app:layout_constraintBottom_toBottomOf="@+id/progress"
app:layout_constraintStart_toStartOf="@+id/progress"
app:layout_constraintEnd_toEndOf="@+id/progress"
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_18"/>
<TextView
android:id="@+id/tv_power_cos"
android:layout_width="wrap_content"