[8.0.0]MogoMind 全息路口UI调整
This commit is contained in:
@@ -28,7 +28,12 @@ class RoadCrossRoamListAdapter(private val mContext: Context, private val lightM
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view: View = LayoutInflater.from(mContext).inflate(R.layout.item_road_cross_roam_tip, parent, false)
|
||||
val view: View =
|
||||
if(lightMode){
|
||||
LayoutInflater.from(mContext).inflate(R.layout.item_road_cross_ai_roam_tip, parent, false)
|
||||
}else{
|
||||
LayoutInflater.from(mContext).inflate(R.layout.item_road_cross_roam_tip, parent, false)
|
||||
}
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
@@ -47,13 +52,13 @@ class RoadCrossRoamListAdapter(private val mContext: Context, private val lightM
|
||||
// 随机决定是否显示ProgressBar
|
||||
// if (Random.nextBoolean()) { // 50%的几率显示ProgressBar
|
||||
holder.progressBar.visibility = View.VISIBLE
|
||||
holder.checkIcon.visibility = View.GONE
|
||||
holder.checkIcon.visibility = View.INVISIBLE
|
||||
|
||||
val r0 = Random.nextInt(0,3)
|
||||
val r1 = Random.nextInt(1,9)
|
||||
// 模拟加载完成
|
||||
holder.itemView.postDelayed({
|
||||
holder.progressBar.visibility = View.GONE
|
||||
holder.progressBar.visibility = View.INVISIBLE
|
||||
holder.checkIcon.visibility = View.VISIBLE
|
||||
},r0 * 1000L + r1 * 100L)
|
||||
// } else {
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_36">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbRoadItemTip"
|
||||
android:layout_width="@dimen/dp_35"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_road_cross_progress"
|
||||
android:indeterminateOnly="true"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRoadItemTip"
|
||||
android:layout_width="@dimen/dp_35"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_road_roam_tip"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRoadItemTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivRoadItemTip"
|
||||
android:layout_marginStart="@dimen/dp_26"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user