[fix]
[默认背景变更]
This commit is contained in:
yangyakun
2024-10-23 16:15:28 +08:00
parent 6ef982d270
commit 179851a69e
3 changed files with 27 additions and 28 deletions

View File

@@ -2,7 +2,6 @@ package com.mogo.och.weaknet.ui.taskrunning
import android.animation.ArgbEvaluator
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.util.TypedValue
import android.view.LayoutInflater
@@ -93,13 +92,13 @@ class TaskRunningAdapter(
holder.acivStationHeadBig.visibility = View.VISIBLE
holder.acivStationHead.visibility = View.INVISIBLE
holder.acivStationHeadBig.setImageResource(R.drawable.bus_runnint_task_start)
holder.bgPassBg.visibility = View.GONE
holder.bgPassBottomBg.visibility = View.VISIBLE
holder.bgPassHeadBg.visibility = View.GONE
holder.middleStationBg.visibility = View.GONE
holder.startStationBg.visibility = View.VISIBLE
holder.endStationBg.visibility = View.GONE
if(startStationIndex==0){
if(line.isLeaving){
// 下端 灰色
holder.bgPassBottomBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.startStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.itemView.background = null
}else{
// 下端 彩色
@@ -110,11 +109,11 @@ class TaskRunningAdapter(
startColor,
endColor
))
holder.bgPassBottomBg.background = temp01
holder.startStationBg.background = temp01
}
}else{
// 下端 灰色
holder.bgPassBottomBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.startStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.itemView.background = null
}
}
@@ -122,16 +121,16 @@ class TaskRunningAdapter(
holder.acivStationHeadBig.visibility = View.VISIBLE
holder.acivStationHead.visibility = View.INVISIBLE
holder.acivStationHeadBig.setImageResource(R.drawable.bus_runnint_task_end)
holder.bgPassBg.visibility = View.GONE
holder.bgPassBottomBg.visibility = View.GONE
holder.bgPassHeadBg.visibility = View.VISIBLE
holder.middleStationBg.visibility = View.GONE
holder.startStationBg.visibility = View.GONE
holder.endStationBg.visibility = View.VISIBLE
if(startStationIndex==itemCount-1){
if(line.isLeaving){
holder.bgPassHeadBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.endStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.itemView.setBackgroundResource(R.drawable.bus_task_current_station_bg)
}else{
holder.itemView.setBackgroundResource(R.drawable.bus_task_current_station_bg)
holder.bgPassHeadBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.endStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
}
}else{
// 上端 彩色
@@ -143,19 +142,19 @@ class TaskRunningAdapter(
startColorTemp,
endColorTemp
))
holder.bgPassHeadBg.background = temp01
holder.endStationBg.background = temp01
}
}
else -> {
holder.acivStationHeadBig.visibility = View.GONE
holder.acivStationHead.visibility = View.VISIBLE
holder.bgPassBg.visibility = View.VISIBLE
holder.bgPassBottomBg.visibility = View.GONE
holder.bgPassHeadBg.visibility = View.GONE
holder.middleStationBg.visibility = View.VISIBLE
holder.startStationBg.visibility = View.GONE
holder.endStationBg.visibility = View.GONE
if(currentPosition==startStationIndex){
if(line.isLeaving){
// 灰色
holder.bgPassBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.middleStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.itemView.background = null
}else{
// 彩色
@@ -167,11 +166,11 @@ class TaskRunningAdapter(
startColorTemp,
endColorTemp
))
holder.bgPassBg.background = temp01
holder.middleStationBg.background = temp01
}
}else if(currentPosition<startStationIndex){
// 灰色
holder.bgPassBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.middleStationBg.setBackgroundResource(R.color.shuttle_driver_4DFFFFFF)
holder.itemView.background = null
}else{
var dex = 0f
@@ -199,7 +198,7 @@ class TaskRunningAdapter(
startColorTemp,
endColorTemp
))
holder.bgPassBg.background = temp01
holder.middleStationBg.background = temp01
}
}
}
@@ -220,12 +219,12 @@ class TaskRunningAdapter(
class TaskRunningViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val actvStationName: AppCompatTextView = itemView.findViewById(R.id.actv_station_name)//站点名称
val acivStationHead: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head)//线路标识
val acivStationHeadBig: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head_big)//线路标识
val acivStationHead: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head)//普通站点标识 不是起始和终点坐标
val acivStationHeadBig: AppCompatImageView = itemView.findViewById(R.id.aciv_station_head_big)//起始和终点坐标标识
val actvWriteOffCount: WriteOffView = itemView.findViewById(R.id.actv_write_off_count) //此战核销的人数
val bgPassBg: View = itemView.findViewById(R.id.bg_pass_bg) //贯通背景调
val bgPassHeadBg: View = itemView.findViewById(R.id.bg_pass_head_bg) //贯通背景
val bgPassBottomBg: View = itemView.findViewById(R.id.bg_pass_bottom_bg) //贯通背景
val middleStationBg: View = itemView.findViewById(R.id.bg_pass_bg) //贯通背景调
val endStationBg: View = itemView.findViewById(R.id.bg_pass_head_bg) //终点的背景
val startStationBg: View = itemView.findViewById(R.id.bg_pass_bottom_bg) //起点坐标的背景
}

View File

@@ -20,7 +20,7 @@
android:layout_marginBottom="@dimen/dp_11"
app:layout_constraintStart_toStartOf="@+id/aciv_station_head_big"
app:layout_constraintEnd_toEndOf="@+id/aciv_station_head_big"
android:background="@color/light_prompt_red"
tools:background="@color/light_prompt_red"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/aciv_station_head_big"
android:layout_width="@dimen/dp_7"
@@ -33,7 +33,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/aciv_station_head_big"
android:layout_marginTop="@dimen/dp_11"
android:background="@color/light_prompt_red"
tools:background="@color/light_prompt_red"
android:layout_width="@dimen/dp_7"
android:layout_height="0dp"/>

View File

@@ -20,7 +20,7 @@
android:layout_marginEnd="@dimen/dp_140"
android:layout_marginTop="@dimen/dp_37"
android:textColor="@color/white"
android:text="@string/bus_switch_line_title"/>
tools:text="@string/bus_switch_line_title"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_running_task_last_station"