Merge branch 'refs/heads/dev_robotaxi-d_240807_6.6.0_yyk' into dev_robotaxi-d_240912_6.7.0

# Conflicts:
#	core/mogo-core-res/src/main/res/values/dimens.xml
This commit is contained in:
yangyakun
2024-09-13 19:41:30 +08:00
111 changed files with 2941 additions and 2434 deletions

View File

@@ -2,10 +2,7 @@
package="com.mogo.och.shuttle.weaknet">
<application>
<activity android:name="com.mogo.och.weaknet.ui.BusSwitchLineActivity"
android:theme="@style/SwitchLineDialogStyle"
android:launchMode="singleTask"
android:screenOrientation="landscape" />
</application>
</manifest>

View File

@@ -36,10 +36,23 @@ public class BusQueryLinesResponse extends BaseData {
public String startSiteName;//始发站名称
public String endSiteName;//终点名称
public boolean open;//true 打开状态 false
public boolean haveTask;
public List<BusQueryLineTaskResponse.Result> taskList;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Result result = (Result) o;
return lineId == result.lineId;
}
@Override
public int hashCode() {
return Long.hashCode(lineId);
}
}

View File

@@ -1,7 +1,12 @@
package com.mogo.och.weaknet.callback;
import com.mogo.och.data.bean.BusStationBean;
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse;
import com.mogo.och.weaknet.bean.BusQueryLinesResponse;
import com.mogo.och.weaknet.database.bean.TaskDataBean;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -10,11 +15,15 @@ import java.util.List;
* @date: 2022/2/9
*/
public interface IBusLinesCallback {
void onBusLinesChange(List<BusQueryLinesResponse.Result> data);
void onChangeLineIdSuccess();
void onBusLineTasks(List<BusQueryLineTaskResponse.Result> o, int position,boolean autoRefresh);
default void onBusLinesChange(List<BusQueryLinesResponse.Result> data){}
default void onChangeLineIdSuccess(){}
default void onBusLineTasks(List<BusQueryLineTaskResponse.Result> o){}
void onRefreshSuccess(long currentTimeStamp);
default void onRefreshSuccess(long currentTimeStamp){}
void onChangeLineIdFail();
default void onChangeLineIdFail(){}
default void onNoRunningTask(){}
default void onRunningTask(){}
}

View File

@@ -1,8 +1,6 @@
package com.mogo.och.weaknet.fragment
import android.content.Intent
import android.graphics.BitmapFactory
import android.os.Bundle
import android.view.View
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
@@ -16,7 +14,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverlayManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.map.MogoMap
@@ -36,12 +33,10 @@ import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.constant.BusConst
import com.mogo.och.weaknet.presenter.BusPresenter
import com.mogo.och.weaknet.ui.BusStationCommonItem
import com.mogo.och.weaknet.ui.BusSwitchLineActivity
import com.mogo.och.weaknet.ui.taskrunning.RunningTaskManager
import com.mogo.och.weaknet.ui.taskrunned.RunningTaskManager
import me.jessyan.autosize.utils.AutoSizeUtils
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.Objects
/**
* 网约车小巴界面
@@ -516,8 +511,9 @@ class ShuttleFragment : BaseShuttleTabFragment<ShuttleFragment?, BusPresenter?>(
return
}
if (mSwitchLine!!.tag as Int == 0) { //切换路线
val intent = Intent(context, BusSwitchLineActivity::class.java)
ActivityUtils.startActivity(intent)
context?.let {
RunningTaskManager.showSwitchLineWindow(it)
}
} else { //结束任务
val builder = OCHCommitDialog.Builder()
val closeLineConfirmDialog = builder

View File

@@ -46,9 +46,9 @@ import com.mogo.och.weaknet.database.transform.FRetryWithTime11
import com.mogo.och.weaknet.database.transform.TransformTask
import com.mogo.och.weaknet.database.transform.transform4DataBase
import com.mogo.och.weaknet.net.OrderServiceManager
import com.mogo.och.weaknet.ui.BusSwitchLineActivity
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicBoolean
/**
@@ -58,7 +58,9 @@ import java.util.concurrent.atomic.AtomicBoolean
@SuppressLint("StaticFieldLeak")
object BusLineModel {
private var mContext: Context? = null
private var mBusLinesCallback: IBusLinesCallback? = null
private val mBusLinesCallbackMap: MutableMap<String, IBusLinesCallback> = ConcurrentHashMap()
private const val TAG = "BusLineModel"
private const val LoopCarInfo = "LoopCarInfo"
@@ -68,6 +70,8 @@ object BusLineModel {
// 展示上一次刷新时间
const val executableChangeTime = "executablechangetime"
const val LASTCOMMITLINEID = "lastcommitlineid"
var currentTask: TaskDataBean?=null
// 当前任务的站点列表
@@ -100,13 +104,18 @@ object BusLineModel {
fun release() {
mContext = null
EventModel.release()
mBusLinesCallback = null
mBusLinesCallbackMap.clear()
BizLoopManager.removeCallback(loopQueryInfo)
}
@JvmStatic
fun setBusLinesCallback(callback: IBusLinesCallback?) {
mBusLinesCallback = callback
fun setBusLinesCallback(tag:String,callback: IBusLinesCallback?) {
if (tag == null || "" == tag) return
if (callback == null) {
mBusLinesCallbackMap.remove(tag)
return
}
mBusLinesCallbackMap[tag] = callback
}
fun refreshTask() {
@@ -138,7 +147,9 @@ object BusLineModel {
SharedPrefsMgr.getInstance().putLong(executableChangeTime, currentTimeStamp)
val sameDay = DateTimeUtil.isSameDay(currentTimeStamp, lastUpdateTime)
mBusLinesCallback?.onRefreshSuccess(currentTimeStamp)
mBusLinesCallbackMap.forEach {
it.value.onRefreshSuccess(currentTimeStamp)
}
if(isBackground){
if (currentRequest == lastChangeMd5 && sameDay) {
return
@@ -202,7 +213,9 @@ object BusLineModel {
}
override fun onNext(data: List<BusQueryLinesResponse.Result>) {
mBusLinesCallback?.onBusLinesChange(data)
mBusLinesCallbackMap.forEach {
it.value.onBusLinesChange(data)
}
}
})
@@ -214,7 +227,7 @@ object BusLineModel {
* @param position 位置
*/
@JvmStatic
fun queryBusLineTasksById(lineId: Long, position: Int, autoRefresh: Boolean) {
fun queryBusLineTasksById(lineId: Long) {
TaskRepository.queryCanUserTask(lineId)
?.transform4DataBase(TransformTask())
?.subscribe(object : Observer<List<BusQueryLineTaskResponse.Result>> {
@@ -231,8 +244,8 @@ object BusLineModel {
}
override fun onNext(data: List<BusQueryLineTaskResponse.Result>) {
if (mBusLinesCallback != null) {
mBusLinesCallback!!.onBusLineTasks(data, position, autoRefresh)
mBusLinesCallbackMap.forEach {
it.value.onBusLineTasks(data)
}
}
@@ -251,14 +264,18 @@ object BusLineModel {
object : TaskRepository.TaskStatusCallback {
override fun startSuccess() {
SharedPrefsMgr.getInstance()
.putLong(BusSwitchLineActivity.LASTCOMMITLINEID, line.lineId)
.putLong(LASTCOMMITLINEID, line.lineId)
EventRepository.saveEventTaskStart(task.id,line.lineId,task.taskStartTime,line.name)
mBusLinesCallback?.onChangeLineIdSuccess()
mBusLinesCallbackMap.forEach {
it.value.onChangeLineIdSuccess()
}
}
override fun startFail(msg: String) {
ToastUtils.showShort("选择任务失败:$msg")
mBusLinesCallback?.onChangeLineIdFail()
mBusLinesCallbackMap.forEach {
it.value.onChangeLineIdFail()
}
}
})
@@ -306,6 +323,9 @@ object BusLineModel {
val contraiInfoTemp = ContraiRepository.queryAutopilotInfoByLineid(it)
ContrailDataBean.save2Common(contraiInfoTemp)
}
mBusLinesCallbackMap.forEach { callback->
callback.value.onRunningTask()
}
}
}
@@ -324,7 +344,7 @@ object BusLineModel {
it.status = TaskDataBean.used
}
TaskRepository.addOrUpdate(*tempList.toTypedArray())
OrderModel.queryBusRoutes()
loadStartedTaskAndDefaultInfo()
OchChainLogManager.writeChainLogDb("加载任务", "异常情况:多个正在进行的任务 task:${runningTaskInfo} event:${queryLastData.taskId}有一个和event表对应使用相同的一个 另一个置为已使用")
return
}
@@ -342,6 +362,11 @@ object BusLineModel {
mContext?.let { contextit ->
OrderServiceManager.queryBusRoutes(contextit,object :OchCommonServiceCallback<BusRoutesResponse>{
override fun onSuccess(response: BusRoutesResponse?) {
if(response?.data == null){
mBusLinesCallbackMap.forEach { callback->
callback.value.onNoRunningTask()
}
}
response?.data?.let {
if (!it.sites.isNullOrEmpty()&&it.sites.size>1) {
val queryTaskById = TaskRepository.queryTaskById(it.taskId.toLong())

View File

@@ -320,30 +320,6 @@ object OrderModel {
BusLineModel.sendTaskDetailsToClients()
}
/**
* 离站上报成功后渲染站点
* 服务端返回的OchBusRoutesResult逻辑 离开站为当前站, 到达下一站后才会将下一站置为当前站,
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
*/
private fun leaveStationSuccess() {
onStartAutopilot()
LineManager.getStations { start, end ->
leaveTTSTips(end.name, end.nameKr)
//给bus外屏发送
LedScreenManager.sendTripInfo2Led(
LedScreenManager.LEAVE_STATION,
LineManager.lineInfos!!.lineName,
start.name,
end.name,
BusLineModel.isLastStation()==true
)
}
BusLineModel.leaveStation()
updateBusStatus()
}
private fun onStartAutopilot() {
//开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
isGoingToNextStation = true
@@ -468,18 +444,6 @@ object OrderModel {
updateBusStatus()
}
/**
* 离站上报
*/
private fun leaveStation() {
if (LineManager.endStation==null) {
OchChainLogManager.writeChainLog("滑动出发", "未设置终点坐标")
return
}
isArrivedStation = false
leaveStationSuccess()
}
//车站10s后播报
private fun leaveTTSTips(nextStation: String?, nextStationKr: String?) {
UiThreadHandler.postDelayed({ //延迟10s播报
@@ -518,7 +482,27 @@ object OrderModel {
abortTask()
return
}
leaveStation()
if (LineManager.endStation==null) {
OchChainLogManager.writeChainLog("滑动出发", "未设置终点坐标")
return
}
isArrivedStation = false
onStartAutopilot()
LineManager.getStations { start, end ->
leaveTTSTips(end.name, end.nameKr)
//给bus外屏发送
LedScreenManager.sendTripInfo2Led(
LedScreenManager.LEAVE_STATION,
LineManager.lineInfos!!.lineName,
start.name,
end.name,
BusLineModel.isLastStation()==true
)
}
BusLineModel.leaveStation()
updateBusStatus()
}
/**

View File

@@ -1,124 +0,0 @@
package com.mogo.och.weaknet.presenter
import androidx.lifecycle.LifecycleOwner
import com.mogo.commons.mvp.Presenter
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.callback.IBusLinesCallback
import com.mogo.och.weaknet.model.BusLineModel
import com.mogo.och.weaknet.model.BusLineModel.executableChangeTime
import com.mogo.och.weaknet.model.BusLineModel.queryBusLineTasksById
import com.mogo.och.weaknet.model.BusLineModel.setBusLinesCallback
import com.mogo.och.weaknet.model.OrderModel
import com.mogo.och.weaknet.model.OrderModel.clearBusStationDatas
import com.mogo.och.weaknet.ui.BusSwitchLineView
import io.reactivex.Observable
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit
/**
* @author: wangmingjun
* @date: 2022/2/9
*/
class BusLinePresenter(view: BusSwitchLineView?) : Presenter<BusSwitchLineView?>(view),
IBusLinesCallback {
private var subscribe: Disposable? = null
init {
BusLineModel.init()
OrderModel.init()
}
override fun onCreate(owner: LifecycleOwner) {
super.onCreate(owner)
initListener()
initData()
}
private fun initData() {
BusLineModel.refreshTask()
}
private fun initListener() {
setBusLinesCallback(this)
}
override fun onBusLinesChange(data: List<BusQueryLinesResponse.Result>) {
mView?.onBusLinesChange(data)
}
override fun onChangeLineIdSuccess() {
clearBusStationDatas()
UiThreadHandler.post({
mView?.startTaskState(true)
mView?.onChangeLineIdSuccess()
}, UiThreadHandler.MODE.QUEUE)
}
fun queryBusLines() {
BusLineModel.queryBusLines()
}
fun queryBusLineTasks(lineId: Long, position: Int, close: Boolean) {
if (subscribe != null && !subscribe!!.isDisposed) {
subscribe!!.dispose()
}
if (close) {
return
}
queryBusLineTasksById(lineId, position, false)
subscribe = Observable.interval(3, TimeUnit.MINUTES).subscribe { aLong: Long? ->
queryBusLineTasksById(lineId, position, true)
}
}
fun commitSwitchLineId(taskId: BusQueryLineTaskResponse.Result, lineId: BusQueryLinesResponse.Result) {
BusLineModel.commitSwitchLineId(taskId, lineId)
}
fun removeListener() {
setBusLinesCallback(null)
}
fun queryBusRoutes() {
OrderModel.queryBusRoutes()
}
override fun onDestroy(owner: LifecycleOwner) {
super.onDestroy(owner)
if (subscribe != null && !subscribe!!.isDisposed) {
subscribe!!.dispose()
}
}
override fun onBusLineTasks(
o: List<BusQueryLineTaskResponse.Result>,
position: Int,
autoRefresh: Boolean
) {
mView?.onBusLineTasks(o, position, autoRefresh)
}
override fun onRefreshSuccess(currentTimeStamp: Long) {
mView?.refreshDate(DateTimeUtil.formatLongToString(currentTimeStamp,DateTimeUtil.yyyy_MM_dd_HH_mm_ss))
}
override fun onChangeLineIdFail() {
mView?.startTaskState(false)
}
fun refreshTask() {
BusLineModel.refreshTask()
}
fun setRefreshTime() {
val lastUpdateTime = SharedPrefsMgr.getInstance().getLong(executableChangeTime, -1)
if(lastUpdateTime>0){
onRefreshSuccess(lastUpdateTime)
}
}
}

View File

@@ -214,7 +214,7 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
override fun onStatusChange(currentStatus: LoginStatusEnum) {
d(SceneConstant.M_BUS + TAG, " loginStatus =" + isLogin())
if (isLogin()) {
OrderModel.queryBusRoutes()
//OrderModel.queryBusRoutes()
} else {
BusTrajectoryManager.getInstance().stopTrajReqLoop()
BusTrajectoryManager.getInstance().stopTrajReqLoop()

View File

@@ -1,282 +0,0 @@
package com.mogo.och.weaknet.ui
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.Point
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mogo.commons.mvp.MvpActivity
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.utils.ResourcesUtils
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.presenter.BusLinePresenter
import com.mogo.och.weaknet.ui.adapter.OpenItemAnimator
import com.mogo.och.weaknet.ui.adapter.SwitchLineAdapter
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.aciv_refresh_task
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.actv_last_refresh_date
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.pb_start_task
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.tv_start_task
/**
* @author: wangmingjun
* @date: 2022/2/8
*/
class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>(),
View.OnClickListener, BusSwitchLineView {
companion object{
const val LASTCOMMITLINEID = "lastcommitlineid"
}
private lateinit var mClose: ImageView
private lateinit var mNoDatasView: ConstraintLayout
private lateinit var mLinesListView: RecyclerView
private lateinit var mLineCommitBtn: LinearLayout
private lateinit var mAdapter: SwitchLineAdapter
private lateinit var linearLayoutManager:LinearLayoutManager
private val mData: MutableList<BusQueryLinesResponse.Result> = ArrayList()
private var animator:ObjectAnimator?=null
override fun getLayoutId(): Int {
return R.layout.shuttle_weak_switch_line
}
override fun createPresenter(): BusLinePresenter {
return BusLinePresenter(this)
}
override fun initViews() {
initWH()
initView()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initDatas()
}
/**
* 初始化view
*/
private fun initView() {
mClose = findViewById(R.id.switch_line_close)
mClose.setOnClickListener(this)
mNoDatasView = findViewById(R.id.no_order_data_view)
mLineCommitBtn = findViewById(R.id.switch_line_btn_commit)
mLineCommitBtn.setOnClickListener(this)
mLinesListView = findViewById(R.id.switch_line_rv)
linearLayoutManager = LinearLayoutManager(this)
mLinesListView.setLayoutManager(linearLayoutManager)
mLinesListView.setItemAnimator(OpenItemAnimator())
mAdapter = SwitchLineAdapter(applicationContext, mData)
mLinesListView.addItemDecoration(
SpacesItemDecoration(
4
)
)
mLinesListView.setAdapter(mAdapter)
//设置item 点击事件
mAdapter.setOnLineItemClickListener(object : SwitchLineAdapter.LineItemClickListener{
override fun onItemClick(position: Int, close: Boolean) {
mPresenter?.queryBusLineTasks(mData[position].lineId, position, close)
}
})
aciv_refresh_task.onClick {
mPresenter?.refreshTask()
if(animator==null) {
animator = ObjectAnimator.ofFloat(aciv_refresh_task, "rotation", 0f, 360f)
animator?.setDuration(1000) // 设置动画持续时间
animator?.repeatCount = ValueAnimator.INFINITE // 设置动画无限重复
animator?.repeatMode = ValueAnimator.RESTART // 设置重复模式
}
animator?.start()
}
pb_start_task.progressTintList = ColorStateList.valueOf(Color.WHITE)
}
/**
* 设置布局宽高
*/
private fun initWH() {
val window = window
val params = window.attributes
val windowManager = getSystemService(WINDOW_SERVICE) as WindowManager
val point = Point()
windowManager.defaultDisplay.getSize(point) //用于获取屏幕高度
params.width = (point.x * 0.375).toInt()
params.height = ViewGroup.LayoutParams.MATCH_PARENT
window.attributes = params
window.setGravity(Gravity.START or Gravity.BOTTOM)
}
/**
* 初始化数据
*/
private fun initDatas() {
mPresenter?.queryBusLines()
mPresenter?.setRefreshTime()
}
/**
* 查询返回绑定路线集合
* @param data
*/
override fun onBusLinesChange(data: MutableList<BusQueryLinesResponse.Result>?) {
if (data.isNullOrEmpty()) {
showNoData(true)
return
}
val lastCommitLineid = SharedPrefsMgr.getInstance().getLong(LASTCOMMITLINEID, -1)
if (data.size > 0) {
showNoData(false)
mData.clear()
mData.addAll(data)
mAdapter.notifyDataSetChanged()
if(lastCommitLineid>0){
mData.forEachIndexed { index, line ->
if(line.lineId==lastCommitLineid){
line.open = true
mPresenter?.queryBusLineTasks(line.lineId,index,false)
return
}
}
}
} else {
showNoData(true)
}
}
override fun onChangeLineIdSuccess() {
ToastUtils.showLong(resources.getString(R.string.bus_change_line_commit_tip_s))
mPresenter?.queryBusRoutes()
mAdapter.setOnLineItemClickListener(null)
mPresenter?.removeListener()
finish()
}
override fun onBusLineTasks(lineTaskInfo: List<BusQueryLineTaskResponse.Result>, position: Int, autoRefresh:Boolean) {
val result = mData[position]
if (result.taskList == null) {
result.taskList = ArrayList()
}
if (lineTaskInfo == null) {
result.haveTask = true
// 打开操作
mAdapter.notifyItemChanged(position)
} else {
if ( lineTaskInfo.isEmpty()) {
result.haveTask = true
}
if (lineTaskInfo.size != result.taskList.size) { // 不相等有变动 重新赋值
result.taskList.clear()
result.taskList.addAll(lineTaskInfo)
if(autoRefresh) {
mAdapter.checkTask = null
mAdapter.checkLine = null
lineTaskInfo.forEach {lineTaskInfoInner->
mAdapter.checkTask?.let {
if (lineTaskInfoInner.id == it.id) {
mAdapter.checkTask = lineTaskInfoInner
mAdapter.checkLine = result
}
}
}
}
// 打开操作
mAdapter.notifyItemChanged(position)
linearLayoutManager.stackFromEnd = (position==mData.size-1||position==mData.size-2)&&mData.size>6
mLinesListView.smoothScrollToPosition(position)
}else if(lineTaskInfo.isEmpty()){
mAdapter.notifyItemChanged(position)
}
}
}
override fun refreshDate(formatLongToString: String?) {
UiThreadHandler.post({
formatLongToString?.let {
actv_last_refresh_date.text = ResourcesUtils.getString(R.string.bus_refresh_time,it)
animator?.cancel()
}
},UiThreadHandler.MODE.QUEUE)
}
/**
* 有无数据UI显示
* @param b
*/
private fun showNoData(b: Boolean) {
if (b) {
mLinesListView.visibility = View.GONE
mLineCommitBtn.visibility = View.GONE
mNoDatasView.visibility = View.VISIBLE
} else {
mLinesListView.visibility = View.VISIBLE
mLineCommitBtn.visibility = View.VISIBLE
mNoDatasView.visibility = View.GONE
}
}
override fun onClick(v: View) {
//关闭dialog
if (v.id == R.id.switch_line_close) {
finish()
return
}
//切换路线提交
if (v.id == R.id.switch_line_btn_commit) {
if(mAdapter.checkLine!=null&&mAdapter.checkTask!=null){
mPresenter?.let {
it.commitSwitchLineId(mAdapter.checkTask!!,mAdapter.checkLine!!)
startTaskLoading()
}
}else{
ToastUtils.showLong("请选择任务")
}
}
}
override fun startTaskState(success: Boolean) {
pb_start_task.visibility = View.GONE
if(success){
tv_start_task.text = "创建成功"
}else{
tv_start_task.text = "创建失败"
UiThreadHandler.postDelayed({
tv_start_task.text = "确定"
},1_000)
}
}
fun startTaskLoading(){
pb_start_task.visibility = View.VISIBLE
tv_start_task.text = "创建中"
}
override fun onDestroy() {
mPresenter!!.removeListener()
super.onDestroy()
}
}

View File

@@ -1,26 +0,0 @@
package com.mogo.och.weaknet.ui;
import com.mogo.commons.mvp.IView;
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse;
import com.mogo.och.weaknet.bean.BusQueryLinesResponse;
import org.jetbrains.annotations.Nullable;
import java.util.List;
/**
* @author: wangmingjun
* @date: 2022/2/10
*/
public interface BusSwitchLineView extends IView {
void onBusLinesChange(List<BusQueryLinesResponse.Result> data);
void onChangeLineIdSuccess();
void onBusLineTasks(List<BusQueryLineTaskResponse.Result> o, int position,boolean autoRefresh);
void refreshDate(@Nullable String formatLongToString);
void startTaskState(boolean b);
}

View File

@@ -1,643 +0,0 @@
package com.mogo.och.weaknet.ui.adapter;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.view.View;
import android.view.ViewPropertyAnimator;
import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import java.util.ArrayList;
import java.util.List;
/**
* This implementation of {@link RecyclerView.ItemAnimator} provides basic
* animations on remove, add, and move events that happen to the items in
* a RecyclerView. RecyclerView uses a DefaultItemAnimator by default.
*
* @see RecyclerView#setItemAnimator(RecyclerView.ItemAnimator)
*/
public class OpenItemAnimator extends DefaultItemAnimator {
private static final boolean DEBUG = false;
private static TimeInterpolator sDefaultInterpolator;
private final ArrayList<RecyclerView.ViewHolder> mPendingRemovals = new ArrayList<>();
private final ArrayList<RecyclerView.ViewHolder> mPendingAdditions = new ArrayList<>();
private final ArrayList<MoveInfo> mPendingMoves = new ArrayList<>();
private final ArrayList<ChangeInfo> mPendingChanges = new ArrayList<>();
ArrayList<ArrayList<RecyclerView.ViewHolder>> mAdditionsList = new ArrayList<>();
ArrayList<ArrayList<MoveInfo>> mMovesList = new ArrayList<>();
ArrayList<ArrayList<ChangeInfo>> mChangesList = new ArrayList<>();
ArrayList<RecyclerView.ViewHolder> mAddAnimations = new ArrayList<>();
ArrayList<RecyclerView.ViewHolder> mMoveAnimations = new ArrayList<>();
ArrayList<RecyclerView.ViewHolder> mRemoveAnimations = new ArrayList<>();
ArrayList<RecyclerView.ViewHolder> mChangeAnimations = new ArrayList<>();
private static class MoveInfo {
public RecyclerView.ViewHolder holder;
public int fromX, fromY, toX, toY;
MoveInfo(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) {
this.holder = holder;
this.fromX = fromX;
this.fromY = fromY;
this.toX = toX;
this.toY = toY;
}
}
private static class ChangeInfo {
public RecyclerView.ViewHolder oldHolder, newHolder;
public int fromX, fromY, toX, toY;
private ChangeInfo(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder) {
this.oldHolder = oldHolder;
this.newHolder = newHolder;
}
ChangeInfo(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder,
int fromX, int fromY, int toX, int toY) {
this(oldHolder, newHolder);
this.fromX = fromX;
this.fromY = fromY;
this.toX = toX;
this.toY = toY;
}
@Override
public String toString() {
return "ChangeInfo{"
+ "oldHolder=" + oldHolder
+ ", newHolder=" + newHolder
+ ", fromX=" + fromX
+ ", fromY=" + fromY
+ ", toX=" + toX
+ ", toY=" + toY
+ '}';
}
}
@Override
public void runPendingAnimations() {
boolean removalsPending = !mPendingRemovals.isEmpty();
boolean movesPending = !mPendingMoves.isEmpty();
boolean changesPending = !mPendingChanges.isEmpty();
boolean additionsPending = !mPendingAdditions.isEmpty();
if (!removalsPending && !movesPending && !additionsPending && !changesPending) {
// nothing to animate
return;
}
// First, remove stuff
for (RecyclerView.ViewHolder holder : mPendingRemovals) {
animateRemoveImpl(holder);
}
mPendingRemovals.clear();
// Next, move stuff
if (movesPending) {
final ArrayList<MoveInfo> moves = new ArrayList<>(mPendingMoves);
mMovesList.add(moves);
mPendingMoves.clear();
Runnable mover = () -> {
for (MoveInfo moveInfo : moves) {
animateMoveImpl(moveInfo.holder, moveInfo.fromX, moveInfo.fromY,
moveInfo.toX, moveInfo.toY);
}
moves.clear();
mMovesList.remove(moves);
};
if (removalsPending) {
View view = moves.get(0).holder.itemView;
ViewCompat.postOnAnimationDelayed(view, mover, getRemoveDuration());
} else {
mover.run();
}
}
// Next, change stuff, to run in parallel with move animations
if (changesPending) {
final ArrayList<ChangeInfo> changes = new ArrayList<>(mPendingChanges);
mChangesList.add(changes);
mPendingChanges.clear();
Runnable changer = () -> {
for (ChangeInfo change : changes) {
animateChangeImpl(change);
}
changes.clear();
mChangesList.remove(changes);
};
if (removalsPending) {
RecyclerView.ViewHolder holder = changes.get(0).oldHolder;
ViewCompat.postOnAnimationDelayed(holder.itemView, changer, getRemoveDuration());
} else {
changer.run();
}
}
// Next, add stuff
if (additionsPending) {
final ArrayList<RecyclerView.ViewHolder> additions = new ArrayList<>(mPendingAdditions);
mAdditionsList.add(additions);
mPendingAdditions.clear();
Runnable adder = () -> {
for (RecyclerView.ViewHolder holder : additions) {
animateAddImpl(holder);
}
additions.clear();
mAdditionsList.remove(additions);
};
if (removalsPending || movesPending || changesPending) {
long removeDuration = removalsPending ? getRemoveDuration() : 0;
long moveDuration = movesPending ? getMoveDuration() : 0;
long changeDuration = changesPending ? getChangeDuration() : 0;
long totalDelay = removeDuration + Math.max(moveDuration, changeDuration);
View view = additions.get(0).itemView;
ViewCompat.postOnAnimationDelayed(view, adder, totalDelay);
} else {
adder.run();
}
}
}
@Override
public boolean animateRemove(final RecyclerView.ViewHolder holder) {
resetAnimation(holder);
mPendingRemovals.add(holder);
return true;
}
private void animateRemoveImpl(final RecyclerView.ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimator animation = view.animate();
mRemoveAnimations.add(holder);
animation.setDuration(getRemoveDuration()).alpha(0).setListener(
new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchRemoveStarting(holder);
}
@Override
public void onAnimationEnd(Animator animator) {
animation.setListener(null);
view.setAlpha(1);
dispatchRemoveFinished(holder);
mRemoveAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
@Override
public boolean animateAdd(final RecyclerView.ViewHolder holder) {
resetAnimation(holder);
holder.itemView.setAlpha(0);
mPendingAdditions.add(holder);
return true;
}
void animateAddImpl(final RecyclerView.ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimator animation = view.animate();
mAddAnimations.add(holder);
animation.alpha(1).setDuration(getAddDuration())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchAddStarting(holder);
}
@Override
public void onAnimationCancel(Animator animator) {
view.setAlpha(1);
}
@Override
public void onAnimationEnd(Animator animator) {
animation.setListener(null);
dispatchAddFinished(holder);
mAddAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
@Override
public boolean animateMove(final RecyclerView.ViewHolder holder, int fromX, int fromY,
int toX, int toY) {
final View view = holder.itemView;
fromX += (int) holder.itemView.getTranslationX();
fromY += (int) holder.itemView.getTranslationY();
resetAnimation(holder);
int deltaX = toX - fromX;
int deltaY = toY - fromY;
if (deltaX == 0 && deltaY == 0) {
dispatchMoveFinished(holder);
return false;
}
if (deltaX != 0) {
view.setTranslationX(-deltaX);
}
if (deltaY != 0) {
view.setTranslationY(-deltaY);
}
mPendingMoves.add(new MoveInfo(holder, fromX, fromY, toX, toY));
return true;
}
void animateMoveImpl(final RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY) {
final View view = holder.itemView;
final int deltaX = toX - fromX;
final int deltaY = toY - fromY;
if (deltaX != 0) {
view.animate().translationX(0);
}
if (deltaY != 0) {
view.animate().translationY(0);
}
// TODO: make EndActions end listeners instead, since end actions aren't called when
// vpas are canceled (and can't end them. why?)
// need listener functionality in VPACompat for this. Ick.
final ViewPropertyAnimator animation = view.animate();
mMoveAnimations.add(holder);
animation.setDuration(getMoveDuration()).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchMoveStarting(holder);
}
@Override
public void onAnimationCancel(Animator animator) {
if (deltaX != 0) {
view.setTranslationX(0);
}
if (deltaY != 0) {
view.setTranslationY(0);
}
}
@Override
public void onAnimationEnd(Animator animator) {
animation.setListener(null);
dispatchMoveFinished(holder);
mMoveAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
@Override
public boolean animateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder,
int fromX, int fromY, int toX, int toY) {
if (oldHolder == newHolder) {
// Don't know how to run change animations when the same view holder is re-used.
// run a move animation to handle position changes.
return animateMove(oldHolder, fromX, fromY, toX, toY);
}
final float prevTranslationX = oldHolder.itemView.getTranslationX();
final float prevTranslationY = oldHolder.itemView.getTranslationY();
final float prevAlpha = oldHolder.itemView.getAlpha();
resetAnimation(oldHolder);
int deltaX = (int) (toX - fromX - prevTranslationX);
int deltaY = (int) (toY - fromY - prevTranslationY);
// recover prev translation state after ending animation
oldHolder.itemView.setTranslationX(prevTranslationX);
oldHolder.itemView.setTranslationY(prevTranslationY);
oldHolder.itemView.setAlpha(prevAlpha);
if (newHolder != null) {
// carry over translation values
resetAnimation(newHolder);
newHolder.itemView.setTranslationX(-deltaX);
newHolder.itemView.setTranslationY(-deltaY);
newHolder.itemView.setAlpha(0);
}
mPendingChanges.add(new ChangeInfo(oldHolder, newHolder, fromX, fromY, toX, toY));
return true;
}
void animateChangeImpl(final ChangeInfo changeInfo) {
final RecyclerView.ViewHolder holder = changeInfo.oldHolder;
final View view = holder == null ? null : holder.itemView;
final RecyclerView.ViewHolder newHolder = changeInfo.newHolder;
final View newView = newHolder != null ? newHolder.itemView : null;
if (view != null) {
final ViewPropertyAnimator oldViewAnim = view.animate().setDuration(
getChangeDuration());
mChangeAnimations.add(changeInfo.oldHolder);
oldViewAnim.translationX((float)(changeInfo.toX - changeInfo.fromX));
oldViewAnim.translationY((float)(changeInfo.toY - changeInfo.fromY));
oldViewAnim.alpha(0).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchChangeStarting(changeInfo.oldHolder, true);
}
@Override
public void onAnimationEnd(Animator animator) {
oldViewAnim.setListener(null);
view.setAlpha(1);
view.setTranslationX(0);
view.setTranslationY(0);
dispatchChangeFinished(changeInfo.oldHolder, true);
mChangeAnimations.remove(changeInfo.oldHolder);
dispatchFinishedWhenDone();
}
}).start();
}
if (newView != null) {
final ViewPropertyAnimator newViewAnimation = newView.animate();
mChangeAnimations.add(changeInfo.newHolder);
newViewAnimation.translationX(0).translationY(0).setDuration(getChangeDuration())
.alpha(1).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animator) {
dispatchChangeStarting(changeInfo.newHolder, false);
}
@Override
public void onAnimationEnd(Animator animator) {
newViewAnimation.setListener(null);
newView.setAlpha(1);
newView.setTranslationX(0);
newView.setTranslationY(0);
dispatchChangeFinished(changeInfo.newHolder, false);
mChangeAnimations.remove(changeInfo.newHolder);
dispatchFinishedWhenDone();
}
}).start();
}
}
private void endChangeAnimation(List<ChangeInfo> infoList, RecyclerView.ViewHolder item) {
for (int i = infoList.size() - 1; i >= 0; i--) {
ChangeInfo changeInfo = infoList.get(i);
if (endChangeAnimationIfNecessary(changeInfo, item)) {
if (changeInfo.oldHolder == null && changeInfo.newHolder == null) {
infoList.remove(changeInfo);
}
}
}
}
private void endChangeAnimationIfNecessary(ChangeInfo changeInfo) {
if (changeInfo.oldHolder != null) {
endChangeAnimationIfNecessary(changeInfo, changeInfo.oldHolder);
}
if (changeInfo.newHolder != null) {
endChangeAnimationIfNecessary(changeInfo, changeInfo.newHolder);
}
}
private boolean endChangeAnimationIfNecessary(ChangeInfo changeInfo, RecyclerView.ViewHolder item) {
boolean oldItem = false;
if (changeInfo.newHolder == item) {
changeInfo.newHolder = null;
} else if (changeInfo.oldHolder == item) {
changeInfo.oldHolder = null;
oldItem = true;
} else {
return false;
}
item.itemView.setAlpha(1);
item.itemView.setTranslationX(0);
item.itemView.setTranslationY(0);
dispatchChangeFinished(item, oldItem);
return true;
}
@Override
public void endAnimation(RecyclerView.ViewHolder item) {
final View view = item.itemView;
// this will trigger end callback which should set properties to their target values.
view.animate().cancel();
// TODO if some other animations are chained to end, how do we cancel them as well?
for (int i = mPendingMoves.size() - 1; i >= 0; i--) {
MoveInfo moveInfo = mPendingMoves.get(i);
if (moveInfo.holder == item) {
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(item);
mPendingMoves.remove(i);
}
}
endChangeAnimation(mPendingChanges, item);
if (mPendingRemovals.remove(item)) {
view.setAlpha(1);
dispatchRemoveFinished(item);
}
if (mPendingAdditions.remove(item)) {
view.setAlpha(1);
dispatchAddFinished(item);
}
for (int i = mChangesList.size() - 1; i >= 0; i--) {
ArrayList<ChangeInfo> changes = mChangesList.get(i);
endChangeAnimation(changes, item);
if (changes.isEmpty()) {
mChangesList.remove(i);
}
}
for (int i = mMovesList.size() - 1; i >= 0; i--) {
ArrayList<MoveInfo> moves = mMovesList.get(i);
for (int j = moves.size() - 1; j >= 0; j--) {
MoveInfo moveInfo = moves.get(j);
if (moveInfo.holder == item) {
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(item);
moves.remove(j);
if (moves.isEmpty()) {
mMovesList.remove(i);
}
break;
}
}
}
for (int i = mAdditionsList.size() - 1; i >= 0; i--) {
ArrayList<RecyclerView.ViewHolder> additions = mAdditionsList.get(i);
if (additions.remove(item)) {
view.setAlpha(1);
dispatchAddFinished(item);
if (additions.isEmpty()) {
mAdditionsList.remove(i);
}
}
}
// animations should be ended by the cancel above.
//noinspection PointlessBooleanExpression,ConstantConditions
if (mRemoveAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mRemoveAnimations list");
}
//noinspection PointlessBooleanExpression,ConstantConditions
if (mAddAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mAddAnimations list");
}
//noinspection PointlessBooleanExpression,ConstantConditions
if (mChangeAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mChangeAnimations list");
}
//noinspection PointlessBooleanExpression,ConstantConditions
if (mMoveAnimations.remove(item) && DEBUG) {
throw new IllegalStateException("after animation is cancelled, item should not be in "
+ "mMoveAnimations list");
}
dispatchFinishedWhenDone();
}
private void resetAnimation(RecyclerView.ViewHolder holder) {
if (sDefaultInterpolator == null) {
sDefaultInterpolator = new ValueAnimator().getInterpolator();
}
holder.itemView.animate().setInterpolator(sDefaultInterpolator);
endAnimation(holder);
}
@Override
public boolean isRunning() {
return (!mPendingAdditions.isEmpty()
|| !mPendingChanges.isEmpty()
|| !mPendingMoves.isEmpty()
|| !mPendingRemovals.isEmpty()
|| !mMoveAnimations.isEmpty()
|| !mRemoveAnimations.isEmpty()
|| !mAddAnimations.isEmpty()
|| !mChangeAnimations.isEmpty()
|| !mMovesList.isEmpty()
|| !mAdditionsList.isEmpty()
|| !mChangesList.isEmpty());
}
/**
* Check the state of currently pending and running animations. If there are none
* pending/running, call {@link #dispatchAnimationsFinished()} to notify any
* listeners.
*/
void dispatchFinishedWhenDone() {
if (!isRunning()) {
dispatchAnimationsFinished();
}
}
@Override
public void endAnimations() {
int count = mPendingMoves.size();
for (int i = count - 1; i >= 0; i--) {
MoveInfo item = mPendingMoves.get(i);
View view = item.holder.itemView;
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(item.holder);
mPendingMoves.remove(i);
}
count = mPendingRemovals.size();
for (int i = count - 1; i >= 0; i--) {
RecyclerView.ViewHolder item = mPendingRemovals.get(i);
dispatchRemoveFinished(item);
mPendingRemovals.remove(i);
}
count = mPendingAdditions.size();
for (int i = count - 1; i >= 0; i--) {
RecyclerView.ViewHolder item = mPendingAdditions.get(i);
item.itemView.setAlpha(1);
dispatchAddFinished(item);
mPendingAdditions.remove(i);
}
count = mPendingChanges.size();
for (int i = count - 1; i >= 0; i--) {
endChangeAnimationIfNecessary(mPendingChanges.get(i));
}
mPendingChanges.clear();
if (!isRunning()) {
return;
}
int listCount = mMovesList.size();
for (int i = listCount - 1; i >= 0; i--) {
ArrayList<MoveInfo> moves = mMovesList.get(i);
count = moves.size();
for (int j = count - 1; j >= 0; j--) {
MoveInfo moveInfo = moves.get(j);
RecyclerView.ViewHolder item = moveInfo.holder;
View view = item.itemView;
view.setTranslationY(0);
view.setTranslationX(0);
dispatchMoveFinished(moveInfo.holder);
moves.remove(j);
if (moves.isEmpty()) {
mMovesList.remove(moves);
}
}
}
listCount = mAdditionsList.size();
for (int i = listCount - 1; i >= 0; i--) {
ArrayList<RecyclerView.ViewHolder> additions = mAdditionsList.get(i);
count = additions.size();
for (int j = count - 1; j >= 0; j--) {
RecyclerView.ViewHolder item = additions.get(j);
View view = item.itemView;
view.setAlpha(1);
dispatchAddFinished(item);
additions.remove(j);
if (additions.isEmpty()) {
mAdditionsList.remove(additions);
}
}
}
listCount = mChangesList.size();
for (int i = listCount - 1; i >= 0; i--) {
ArrayList<ChangeInfo> changes = mChangesList.get(i);
count = changes.size();
for (int j = count - 1; j >= 0; j--) {
endChangeAnimationIfNecessary(changes.get(j));
if (changes.isEmpty()) {
mChangesList.remove(changes);
}
}
}
cancelAll(mRemoveAnimations);
cancelAll(mMoveAnimations);
cancelAll(mAddAnimations);
cancelAll(mChangeAnimations);
dispatchAnimationsFinished();
}
void cancelAll(List<RecyclerView.ViewHolder> viewHolders) {
for (int i = viewHolders.size() - 1; i >= 0; i--) {
viewHolders.get(i).itemView.animate().cancel();
}
}
/**
* {@inheritDoc}
* <p>
* If the payload list is not empty, DefaultItemAnimator returns <code>true</code>.
* When this is the case:
* <ul>
* <li>If you override {@link #animateChange(RecyclerView.ViewHolder, RecyclerView.ViewHolder, int, int, int, int)}, both
* ViewHolder arguments will be the same instance.
* </li>
* <li>
* If you are not overriding {@link #animateChange(RecyclerView.ViewHolder, RecyclerView.ViewHolder, int, int, int, int)},
* then DefaultItemAnimator will call {@link #animateMove(RecyclerView.ViewHolder, int, int, int, int)} and
* run a move animation instead.
* </li>
* </ul>
*/
@Override
public boolean canReuseUpdatedViewHolder(@NonNull RecyclerView.ViewHolder viewHolder,
@NonNull List<Object> payloads) {
return !payloads.isEmpty() || super.canReuseUpdatedViewHolder(viewHolder, payloads);
}
}

View File

@@ -1,172 +0,0 @@
package com.mogo.och.weaknet.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.appcompat.widget.AppCompatTextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.ui.adapter.SwitchLineAdapter.SwitchLineViewHolder
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import kotlin.text.StringBuilder
/**
* 路线列表adapter
*/
class SwitchLineAdapter(
private val mContext: Context,
private val mData: List<BusQueryLinesResponse.Result>
) : RecyclerView.Adapter<SwitchLineViewHolder>() {
companion object{
const val TAG = "SwitchLineAdapter"
}
// RecyclerView设置点击事件
private var mItemClickListener: LineItemClickListener? = null
var checkLine:BusQueryLinesResponse.Result? = null
var checkTask: BusQueryLineTaskResponse.Result? = null
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): SwitchLineViewHolder {
val view = LayoutInflater.from(mContext).inflate(
R.layout.shuttle_weak_switch_line_list_item, parent, false
)
return SwitchLineViewHolder(view)
}
override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) {
val currentPosition = holder.bindingAdapterPosition
val line = mData[currentPosition]
holder.lineName.text = line.name
val string = mContext.getString(R.string.bus_line_goto_end, line.endSiteName)
holder.lineEndName.text = string
holder.rvLineTask.layoutManager = GridLayoutManager(mContext, 3)
val switchLineTaskAdapter = SwitchLineTaskAdapter(
mContext,
if(checkTask==null) -1 else checkTask!!.id,
line.taskList,
object : SwitchLineTaskAdapter.TaskItemClickListener {
override fun onItemClick(position: Int,isCheck:Boolean) {
try {
if(isCheck) {
checkLine = line
checkTask = line.taskList[position]
}else{
checkLine=null
checkTask=null
}
}catch (e:Exception){
e.printStackTrace()
checkLine=null
checkTask=null
}
}
})
holder.rvLineTask.adapter = switchLineTaskAdapter
holder.rvLineTask.isFocusableInTouchMode = false
holder.actvShowMore.visibility = View.VISIBLE
if(line.open){
if(line.taskList==null||line.taskList.isEmpty()){
holder.actvShowMore.text = mContext.getString(R.string.bus_switch_line_no_task)
holder.actvShowMore.setTextColor(ContextCompat.getColor(mContext,R.color.bus_color_4dffffff))
holder.vLineTask.visibility = View.GONE
holder.rvLineTask.visibility = View.GONE
holder.selectIv.visibility = View.INVISIBLE
holder.itemView.setBackgroundResource(R.drawable.bus_shape_select_line_item_bg_normal)
}else {
holder.actvShowMore.text = mContext.getString(R.string.bus_switch_line_select_task)
holder.actvShowMore.setTextColor(ContextCompat.getColor(mContext,android.R.color.white))
holder.vLineTask.visibility = View.VISIBLE
holder.rvLineTask.visibility = View.VISIBLE
holder.selectIv.visibility = View.VISIBLE
holder.itemView.setBackgroundResource(R.drawable.bus_shape_select_line_item_bg_selected)
holder.selectIv.apply {
pivotX = 9.5f
pivotY = 17f
rotation = 90f
}
}
}else{
if(line.haveTask){
holder.actvShowMore.text = mContext.getString(R.string.bus_switch_line_no_task)
holder.actvShowMore.setTextColor(ContextCompat.getColor(mContext,R.color.bus_color_4dffffff))
holder.vLineTask.visibility = View.GONE
holder.rvLineTask.visibility = View.GONE
holder.selectIv.visibility = View.INVISIBLE
holder.itemView.setBackgroundResource(R.drawable.bus_shape_select_line_item_bg_normal)
}else {
holder.actvShowMore.text = mContext.getString(R.string.bus_switch_line_select_task)
holder.actvShowMore.setTextColor(ContextCompat.getColor(mContext,android.R.color.white))
holder.vLineTask.visibility = View.GONE
holder.rvLineTask.visibility = View.GONE
holder.selectIv.visibility = View.VISIBLE
holder.itemView.setBackgroundResource(R.drawable.bus_shape_select_line_item_bg_normal)
holder.selectIv.apply {
pivotX = 9.5f
pivotY = 17f
rotation = 0f
}
}
}
//设置item点击事件
holder.itemView.setOnClickListener {
if(holder.actvShowMore.text==mContext.getString(R.string.bus_switch_line_no_task)){
return@setOnClickListener
}
mData.forEachIndexed { index, result ->
if(result.open){
result.open = false;
notifyItemChanged(index)
if(result.taskList!=null) {
result.taskList.clear()
}
if(index==currentPosition){// 点击当前已经打开的item 去关闭定时网络请求
mItemClickListener?.onItemClick(currentPosition,true)
return@setOnClickListener
}
}
}
mItemClickListener?.onItemClick(currentPosition,false)
line.open = holder.rvLineTask.visibility == View.GONE
}
}
override fun getItemCount(): Int {
return mData.size
}
fun setOnLineItemClickListener(itemClickListener: LineItemClickListener?) {
mItemClickListener = itemClickListener
}
class SwitchLineViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val selectIv: ImageView
val lineName: AppCompatTextView//线路名称
val lineEndName: AppCompatTextView //终点
val actvShowMore: AppCompatTextView //选择时间
val rvLineTask: RecyclerView// 排班时间
val vLineTask: View// 白色分割线
init {
selectIv = itemView.findViewById(R.id.switch_line_item_select_iv)
lineName = itemView.findViewById(R.id.switch_line_name)
lineEndName = itemView.findViewById(R.id.switch_line_end_station)
rvLineTask = itemView.findViewById(R.id.rv_line_task_list)
vLineTask = itemView.findViewById(R.id.v_line_task)
actvShowMore = itemView.findViewById(R.id.actv_show_more)
}
}
interface LineItemClickListener {
fun onItemClick(position: Int,close:Boolean)
}
}

View File

@@ -1,76 +0,0 @@
package com.mogo.och.weaknet.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.ui.adapter.SwitchLineTaskAdapter.SwitchLineTaskViewHolder
import com.mogo.och.shuttle.weaknet.R
/**
* 路线列表adapter
*/
class SwitchLineTaskAdapter(
private val mContext: Context,
private var checkTaskId:Long,
private val mData: List<BusQueryLineTaskResponse.Result>?,
private val mTaskItemClickListener: TaskItemClickListener?
) : RecyclerView.Adapter<SwitchLineTaskViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SwitchLineTaskViewHolder {
val view = LayoutInflater.from(mContext).inflate(
R.layout.shuttle_weak_switch_line_list_task_item, parent, false
)
return SwitchLineTaskViewHolder(view)
}
override fun onBindViewHolder(holder: SwitchLineTaskViewHolder, position: Int) {
val currentPosition = holder.bindingAdapterPosition
val task = mData!![currentPosition]
val taskStartTime = TimeUtils.millis2String(task.taskStartTime, "HH:mm")
holder.lineTask.text = taskStartTime
if(checkTaskId==task.id){
holder.lineTask.setBackgroundResource(R.drawable.bus_shape_select_line_item_time_bg_selected)
}else{
holder.lineTask.setBackgroundResource(R.drawable.bus_shape_select_line_item_time_bg)
}
holder.lineTask.setOnClickListener {
if(checkTaskId==task.id){
checkTaskId = -1
mTaskItemClickListener?.onItemClick(currentPosition,false)
}else {
resetOther()
checkTaskId = task.id
mTaskItemClickListener?.onItemClick(currentPosition,true)
}
notifyItemChanged(currentPosition)
}
}
private fun resetOther() {
mData?.forEachIndexed { index, result ->
if(result.id==checkTaskId){
checkTaskId = -1
notifyItemChanged(index)
}
}
}
override fun getItemCount(): Int {
return mData?.size ?: 0
}
class SwitchLineTaskViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val lineTask: TextView // 时间
init {
lineTask = itemView.findViewById(R.id.actv_line_task)
}
}
interface TaskItemClickListener {
fun onItemClick(position: Int,isCheck:Boolean)
}
}

View File

@@ -0,0 +1,121 @@
package com.mogo.och.weaknet.ui.bizswitch
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.common.module.utils.ResourcesUtils
import com.mogo.och.common.module.wigets.WindowRelativeLayout
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.loading_biz
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.swtichLine
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.swtichTask
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.taskRunning
class SwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallback {
constructor(context: Context?) : super(context)
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
companion object {
const val TAG = "SwitchBizView"
}
private var viewModel: SwtichBizeModel?=null
init {
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_switch_biz, this, true)
initView()
}
private fun initView(){
loading_biz.setEmptyText(ResourcesUtils.getString(R.string.bus_switch_biz_loading))
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
viewModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(SwtichBizeModel::class.java)
}
viewModel?.setDistanceCallback(this)
}
var startLoading = System.currentTimeMillis()
// 展示loading页面
override fun showLoadingView(){
startLoading = System.currentTimeMillis()
loading_biz.visibility = VISIBLE
swtichLine.visibility = GONE
swtichTask.visibility = GONE
}
/**
* 初始化数据
*/
override fun loadLineData() {
swtichLine.loadingDatas()
}
override fun showSwitchTaskByLineInfo(lineInfo: BusQueryLinesResponse.Result) {
// 展示loading
showLoadingView()
swtichTask.queryTaskByLineInfo(lineInfo)
}
// 展示选择任务页面
override fun showSwitchTaskInfo() {
val endLoading = System.currentTimeMillis()
val dex = (100-(endLoading - startLoading)).takeIf { it>=0 }?:0
CallerLogger.d(TAG,"展示线路任务 lading 展示了 ${dex}毫秒")
ThreadUtils.runOnUiThreadDelayed({
loading_biz.visibility = GONE
swtichLine.visibility = GONE
swtichTask.visibility = VISIBLE
taskRunning.visibility = GONE
},dex,ThreadUtils.MODE.QUEUE)
}
// 展示选择线路页面
override fun showSwtichLineView() {
val endLoading = System.currentTimeMillis()
val dex = (100-(endLoading - startLoading)).takeIf { it>=0 }?:0
CallerLogger.d(TAG,"展示线路 lading 展示了 ${dex}毫秒")
ThreadUtils.runOnUiThreadDelayed({
loading_biz.visibility = GONE
swtichLine.visibility = VISIBLE
swtichTask.visibility = GONE
taskRunning.visibility = GONE
},dex,ThreadUtils.MODE.QUEUE)
}
// 展示正在进行的任务
override fun loadRunningTask() {
val endLoading = System.currentTimeMillis()
val dex = (100-(endLoading - startLoading)).takeIf { it>=0 }?:0
CallerLogger.d(TAG,"展示线路 lading 展示了 ${dex}毫秒")
ThreadUtils.runOnUiThreadDelayed({
loading_biz.visibility = GONE
swtichLine.visibility = GONE
swtichTask.visibility = GONE
taskRunning.visibility = VISIBLE
taskRunning.showRunningTaskInfo()
},dex,ThreadUtils.MODE.QUEUE)
}
}

View File

@@ -0,0 +1,78 @@
package com.mogo.och.weaknet.ui.bizswitch
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.data.bean.BusStationBean
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.callback.IBusLinesCallback
import com.mogo.och.weaknet.database.bean.TaskDataBean
import com.mogo.och.weaknet.model.BusLineModel
/**
* @author XuXinChao
* @description BadCase录包管理页面
* @since: 2022/12/15
*/
class SwtichBizeModel : ViewModel(), IBusLinesCallback {
private val TAG = SwtichBizeModel::class.java.simpleName
private var viewCallback: SwtichLineViewCallback? = null
override fun onCleared() {
BusLineModel.setBusLinesCallback(TAG, null)
}
fun setDistanceCallback(viewCallback: SwtichLineViewCallback) {
this.viewCallback = viewCallback
BusLineModel.setBusLinesCallback(TAG, this)
this.viewCallback?.showLoadingView()
ThreadUtils.getIoPool().execute {
BusLineModel.loadStartedTaskAndDefaultInfo()
}
}
fun loadingSwitchTask(lineInfo: BusQueryLinesResponse.Result) {
viewCallback?.showSwitchTaskByLineInfo(lineInfo)
}
fun showSwitchTaskInfo() {
viewCallback?.showSwitchTaskInfo()
}
fun showSwitchLineInfo() {
viewCallback?.showLoadingView()
viewCallback?.loadLineData()
}
fun showSwitchLineInfoResult() {
viewCallback?.showSwtichLineView()
}
fun showRunningTaskView() {
}
interface SwtichLineViewCallback {
fun showSwtichLineView()
fun showLoadingView()
fun showSwitchTaskByLineInfo(lineInfo: BusQueryLinesResponse.Result)
fun showSwitchTaskInfo()
fun loadLineData()
fun loadRunningTask()
}
override fun onNoRunningTask() {
this.viewCallback?.loadLineData()
CallerLogger.d(TAG,"没有任务去加载线路")
}
override fun onRunningTask() {
this.viewCallback?.loadRunningTask()
CallerLogger.d(TAG,"有任务去加载正在执行的任务")
}
}

View File

@@ -0,0 +1,121 @@
package com.mogo.och.weaknet.ui.switchline
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.appcompat.widget.AppCompatTextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.DiffUtil.Callback
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.ui.switchline.SwitchLineAdapter.SwitchLineViewHolder
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
/**
* 路线列表adapter
*/
class SwitchLineAdapter(
private val mContext: Context,
val mData: MutableList<BusQueryLinesResponse.Result>
) : RecyclerView.Adapter<SwitchLineViewHolder>() {
companion object{
const val TAG = "SwitchLineAdapter"
}
// RecyclerView设置点击事件
private var mItemClickListener: LineItemClickListener? = null
var checkLine:BusQueryLinesResponse.Result? = null
var checkTask: BusQueryLineTaskResponse.Result? = null
fun setDataList(dataList: List<BusQueryLinesResponse.Result>) {
if (this.mData == dataList) {
// 如果新旧列表一致,则直接返回
return
}
val diffResult = DiffUtil.calculateDiff(MyDiffCallback(this.mData, dataList))
this.mData.clear()
this.mData.addAll(dataList)
diffResult.dispatchUpdatesTo(this)
}
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): SwitchLineViewHolder {
val view = LayoutInflater.from(mContext).inflate(
R.layout.shuttle_weak_switch_line_list_item, parent, false
)
return SwitchLineViewHolder(view)
}
override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) {
val currentPosition = holder.bindingAdapterPosition
val line = mData[currentPosition]
holder.lineName.text = line.name
val string = mContext.getString(R.string.bus_line_goto_end, line.endSiteName)
holder.lineEndName.text = string
//设置item点击事件
holder.itemView.setOnClickListener {
mData.forEachIndexed { index, result ->
notifyItemChanged(index)
if(result.taskList!=null) {
result.taskList.clear()
}
if(index==currentPosition){// 点击当前已经打开的item 去关闭定时网络请求
mItemClickListener?.onItemClick(currentPosition,true)
return@setOnClickListener
}
}
mItemClickListener?.onItemClick(currentPosition,false)
}
}
override fun getItemCount(): Int {
return mData.size
}
fun setOnLineItemClickListener(itemClickListener: LineItemClickListener?) {
mItemClickListener = itemClickListener
}
class SwitchLineViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val lineName: AppCompatTextView = itemView.findViewById(R.id.switch_line_name)//线路名称
val lineEndName: AppCompatTextView = itemView.findViewById(R.id.switch_line_end_station) //终点
}
interface LineItemClickListener {
fun onItemClick(position: Int,close:Boolean)
}
inner class MyDiffCallback(private val oldData:List<BusQueryLinesResponse.Result>, private val newData:List<BusQueryLinesResponse.Result>):
Callback(){
override fun getOldListSize(): Int {
return oldData.size
}
override fun getNewListSize(): Int {
return newData.size
}
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
val oldItem = oldData[oldItemPosition]
val newItem = newData[newItemPosition]
return oldItem == newItem
}
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
val oldItem = oldData[oldItemPosition]
val newItem = newData[newItemPosition]
return oldItem == newItem
}
}
}

View File

@@ -0,0 +1,168 @@
package com.mogo.och.weaknet.ui.switchline
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.utils.ResourcesUtils
import com.mogo.och.common.module.wigets.WindowRelativeLayout
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.model.BusLineModel
import com.mogo.och.weaknet.ui.bizswitch.SwtichBizeModel
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.no_order_data_view
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.aciv_refresh_task
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.actv_last_refresh_date
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.switch_line_rv
import me.jessyan.autosize.utils.AutoSizeUtils
class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallback {
constructor(context: Context?) : super(context)
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
companion object {
const val TAG = "BadCaseManagerView"
}
private var viewModel:SwtichLineModel?=null
private var viewbizModel:SwtichBizeModel?=null
private lateinit var mAdapter: SwitchLineAdapter
private var animator:ObjectAnimator?=null
private lateinit var linearLayoutManager:LinearLayoutManager
private var animatorStart = System.currentTimeMillis()
init {
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_switch_line, this, true)
initView()
}
private fun initView(){
linearLayoutManager = LinearLayoutManager(context)
switch_line_rv.setLayoutManager(linearLayoutManager)
mAdapter = SwitchLineAdapter(context, mutableListOf())
switch_line_rv.addItemDecoration(
SpacesItemDecoration(
AutoSizeUtils.dp2px(context,20f)
)
)
switch_line_rv.setAdapter(mAdapter)
//设置item 点击事件
mAdapter.setOnLineItemClickListener(object : SwitchLineAdapter.LineItemClickListener{
override fun onItemClick(position: Int, close: Boolean) {
viewbizModel?.loadingSwitchTask(mAdapter.mData[position])
//viewModel?.queryBusLineTasks(mAdapter.mData[position].lineId, position, close)
}
})
aciv_refresh_task.onClick {
viewModel?.refreshTask()
animatorStart = System.currentTimeMillis()
if(animator==null) {
animator = ObjectAnimator.ofFloat(aciv_refresh_task, "rotation", 0f, 360f)
animator?.setDuration(1000) // 设置动画持续时间
animator?.repeatCount = ValueAnimator.INFINITE // 设置动画无限重复
animator?.repeatMode = ValueAnimator.RESTART // 设置重复模式
}
animator?.start()
}
}
/**
* 初始化数据
*/
fun loadingDatas() {
CallerLogger.d(TAG,"加载线路去")
viewModel?.queryBusLines()
viewModel?.setRefreshTime()
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
viewModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(SwtichLineModel::class.java)
}
viewbizModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(SwtichBizeModel::class.java)
}
viewModel?.setDistanceCallback(this)
}
override fun startTaskState(success: Boolean) {
}
override fun onBusLinesChange(data: MutableList<BusQueryLinesResponse.Result>?) {
if (data.isNullOrEmpty()) {
showNoData(true)
}else{
showNoData(false)
mAdapter.setDataList(data)
}
CallerLogger.d(TAG,"加载线路成功")
viewbizModel?.showSwitchLineInfoResult()
}
/**
* 有无数据UI显示
* @param b
*/
private fun showNoData(b: Boolean) {
if (b) {
switch_line_rv.visibility = View.GONE
no_order_data_view.visibility = View.VISIBLE
} else {
switch_line_rv.visibility = View.VISIBLE
no_order_data_view.visibility = View.GONE
}
}
override fun onChangeLineIdSuccess() {
ToastUtils.showLong(resources.getString(R.string.bus_change_line_commit_tip_s))
viewModel?.queryBusRoutes()
mAdapter.setOnLineItemClickListener(null)
}
override fun refreshDate(formatLongToString: String?) {
val endTime = System.currentTimeMillis()
val dex = (1000-(endTime - animatorStart)).takeIf { it>=0 }?:0
UiThreadHandler.postDelayed({
formatLongToString?.let {
actv_last_refresh_date.text = ResourcesUtils.getString(R.string.bus_refresh_time,it)
animator?.cancel()
}
},dex,UiThreadHandler.MODE.QUEUE,)
}
}

View File

@@ -0,0 +1,81 @@
package com.mogo.och.weaknet.ui.switchline
import androidx.lifecycle.ViewModel
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.callback.IBusLinesCallback
import com.mogo.och.weaknet.model.BusLineModel
import com.mogo.och.weaknet.model.BusLineModel.executableChangeTime
import com.mogo.och.weaknet.model.OrderModel
/**
* @author XuXinChao
* @description BadCase录包管理页面
* @since: 2022/12/15
*/
class SwtichLineModel : ViewModel(), IBusLinesCallback {
private val TAG = SwtichLineModel::class.java.simpleName
private var viewCallback:SwtichLineViewCallback?=null
override fun onCleared() {
BusLineModel.setBusLinesCallback(TAG,null)
}
fun setDistanceCallback(viewCallback:SwtichLineViewCallback){
this.viewCallback = viewCallback
BusLineModel.setBusLinesCallback(TAG,this)
}
fun queryBusLines() {
BusLineModel.queryBusLines()
}
fun setRefreshTime() {
val lastUpdateTime = SharedPrefsMgr.getInstance().getLong(executableChangeTime, -1)
if(lastUpdateTime>0){
this.onRefreshSuccess(lastUpdateTime)
}
}
fun refreshTask() {
BusLineModel.refreshTask()
}
fun queryBusRoutes() {
OrderModel.queryBusRoutes()
}
interface SwtichLineViewCallback{
fun startTaskState(success: Boolean)
fun onBusLinesChange(data: MutableList<BusQueryLinesResponse.Result>?)
fun onChangeLineIdSuccess()
fun refreshDate(formatLongToString: String?)
}
override fun onBusLinesChange(data: MutableList<BusQueryLinesResponse.Result>?) {
viewCallback?.onBusLinesChange(data)
}
override fun onChangeLineIdSuccess() {
ThreadUtils.runOnUiThread( {
viewCallback?.onChangeLineIdSuccess()
},ThreadUtils.MODE.QUEUE)
}
override fun onRefreshSuccess(currentTimeStamp: Long) {
viewCallback?.refreshDate(
DateTimeUtil.formatLongToString(currentTimeStamp, DateTimeUtil.HH_mm_ss)
)
}
override fun onChangeLineIdFail() {
viewCallback?.startTaskState(false)
}
}

View File

@@ -0,0 +1,129 @@
package com.mogo.och.weaknet.ui.switchtask
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.AppCompatCheckedTextView
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.DiffUtil.Callback
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.ui.switchtask.SwitchLineTaskAdapter.SwitchLineTaskViewHolder
import com.mogo.och.shuttle.weaknet.R
/**
* 路线列表adapter
*/
@Suppress("UNUSED_EXPRESSION")
class SwitchLineTaskAdapter(
private val mContext: Context,
private var checkTask:BusQueryLineTaskResponse.Result?,
private val mData: MutableList<BusQueryLineTaskResponse.Result>,
) : RecyclerView.Adapter<SwitchLineTaskViewHolder>() {
fun setDataList(dataList: List<BusQueryLineTaskResponse.Result>) {
if (this.mData == dataList) {
// 如果新旧列表一致,则直接返回
return
}
checkTask = null
val diffResult = DiffUtil.calculateDiff(MyDiffCallback(this.mData, dataList))
this.mData.clear()
this.mData.addAll(dataList)
diffResult.dispatchUpdatesTo(this)
}
fun getCheckTask():BusQueryLineTaskResponse.Result?{
return checkTask
}
private var mTaskItemClickListener: TaskItemClickListener? = null
fun setOnLineItemClickListener(mTaskItemClickListener: TaskItemClickListener?) {
this.mTaskItemClickListener = mTaskItemClickListener
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SwitchLineTaskViewHolder {
val view = LayoutInflater.from(mContext).inflate(
R.layout.shuttle_weak_switch_task_item, parent, false
)
return SwitchLineTaskViewHolder(view)
}
override fun onBindViewHolder(holder: SwitchLineTaskViewHolder, position: Int) {
val currentPosition = holder.bindingAdapterPosition
val task = mData[currentPosition]
val taskStartTime = TimeUtils.millis2String(task.taskStartTime, "HH:mm")
holder.taskTime.text = taskStartTime
holder.taskTime.isChecked = if(checkTask!=null) checkTask!!.id == task.id else false
holder.taskTime.setOnClickListener {
if(checkTask==null){
resetOther()
checkTask = task
mTaskItemClickListener?.onItemClick(currentPosition,true)
}else{
if(checkTask!!.id==task.id){
checkTask = null
mTaskItemClickListener?.onItemClick(currentPosition,false)
}else {
resetOther()
checkTask = task
mTaskItemClickListener?.onItemClick(currentPosition,true)
}
}
notifyItemChanged(currentPosition)
}
}
private fun resetOther() {
mData.forEachIndexed { index, result ->
if(checkTask!=null && result.id==checkTask!!.id){
checkTask = null
notifyItemChanged(index)
}
}
}
override fun getItemCount(): Int {
return mData.size
}
class SwitchLineTaskViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val taskTime: AppCompatCheckedTextView = itemView.findViewById(R.id.actv_task_time) // 时间
}
interface TaskItemClickListener {
fun onItemClick(position: Int,isCheck:Boolean)
}
inner class MyDiffCallback(private val oldData:List<BusQueryLineTaskResponse.Result>, private val newData:List<BusQueryLineTaskResponse.Result>):
Callback(){
override fun getOldListSize(): Int {
return oldData.size
}
override fun getNewListSize(): Int {
return newData.size
}
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
val oldItem = oldData[oldItemPosition]
val newItem = newData[newItemPosition]
return oldItem.id == newItem.id
}
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
val oldItem = oldData[oldItemPosition]
val newItem = newData[newItemPosition]
return oldItem.id == newItem.id
}
}
}

View File

@@ -0,0 +1,146 @@
package com.mogo.och.weaknet.ui.switchtask
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.utils.ResourcesUtils
import com.mogo.och.common.module.wigets.WindowRelativeLayout
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.ui.bizswitch.SwtichBizeModel
import com.mogo.och.weaknet.ui.switchtask.SwitchLineTaskAdapter.TaskItemClickListener
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.actvLineEndStationName
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.actv_cancle_task
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.actv_submit_task
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.busLineName
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.cl_submit_task
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.include_empty
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.loading_start_line
import kotlinx.android.synthetic.main.shuttle_weak_switch_task.view.rv_switch_task
import me.jessyan.autosize.utils.AutoSizeUtils
class SwitchTaskView: WindowRelativeLayout, SwtichTaskModel.SwtichLineViewCallback{
constructor(context: Context?) : super(context)
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
companion object {
const val TAG = "BadCaseManagerView"
}
private var viewModel:SwtichTaskModel?=null
private var viewbizModel:SwtichBizeModel?=null
private lateinit var mAdapter: SwitchLineTaskAdapter
private lateinit var linearLayoutManager:LinearLayoutManager
init {
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_switch_task, this, true)
initView()
}
private fun initView(){
linearLayoutManager = GridLayoutManager(context, 3)
rv_switch_task.setLayoutManager(linearLayoutManager)
mAdapter = SwitchLineTaskAdapter(context,null, mutableListOf())
rv_switch_task.setAdapter(mAdapter)
mAdapter.setOnLineItemClickListener(object : TaskItemClickListener{
override fun onItemClick(position: Int, isCheck: Boolean) {
}
})
//rv_switch_task.setRecycledViewPool(null);
rv_switch_task.addItemDecoration(
TaskBottomDecoration(
AutoSizeUtils.dp2px(context, 174f)
)
)
actv_submit_task.onClick {
val tempCheckTask = mAdapter.getCheckTask()
if(tempCheckTask==null){
ToastUtils.showShort("请选择任务")
}else{
viewModel?.changeLineStart(tempCheckTask)
}
}
actv_cancle_task.onClick {
viewbizModel?.showSwitchLineInfo()
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
viewModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(SwtichTaskModel::class.java)
}
viewbizModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(SwtichBizeModel::class.java)
}
viewModel?.setDistanceCallback(this)
}
fun queryTaskByLineInfo(lineInfo: BusQueryLinesResponse.Result) {
viewModel?.queryBusLineTasksById(lineInfo)
busLineName.text = lineInfo.name
actvLineEndStationName.text = "${lineInfo.endSiteName}方向"
}
override fun showTaskByLineIdResult(taskList: MutableList<BusQueryLineTaskResponse.Result>) {
if(taskList.isEmpty()){
showEmptyView()
}else {
showData()
mAdapter.setDataList(taskList)
}
viewbizModel?.showSwitchTaskInfo()
}
private fun showData(){
actv_submit_task.setTextColor(ResourcesUtils.getColors(R.color.bus_task_submit_text_color_selector))
actv_submit_task.isEnabled = true
rv_switch_task.visibility = VISIBLE
include_empty.visibility = GONE
}
override fun showLoading(){
loading_start_line.visibility = VISIBLE
actv_submit_task.isEnabled = false
actv_cancle_task.isEnabled = false
}
override fun hideLoading(){
loading_start_line.visibility = GONE
actv_submit_task.isEnabled = true
actv_cancle_task.isEnabled = true
}
override fun startTaskSuccess() {
viewbizModel?.showRunningTaskView()
}
private fun showEmptyView(){
actv_submit_task.setTextColor(ResourcesUtils.getColor(R.color.bus_color_66666))
actv_submit_task.isEnabled = false
rv_switch_task.visibility = GONE
include_empty.visibility = VISIBLE
}
}

View File

@@ -0,0 +1,94 @@
package com.mogo.och.weaknet.ui.switchtask
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.callback.IBusLinesCallback
import com.mogo.och.weaknet.model.BusLineModel
import io.reactivex.disposables.Disposable
/**
* @author XuXinChao
* @description BadCase录包管理页面
* @since: 2022/12/15
*/
class SwtichTaskModel : ViewModel(), IBusLinesCallback {
private val TAG = SwtichTaskModel::class.java.simpleName
private var viewCallback:SwtichLineViewCallback?=null
private var tasksBelongLine: BusQueryLinesResponse.Result? = null
private var subscribe: Disposable? = null
override fun onCleared() {
RxUtils.disposeSubscribe(subscribe)
BusLineModel.setBusLinesCallback(TAG,null)
}
fun setDistanceCallback(viewCallback:SwtichLineViewCallback){
this.viewCallback = viewCallback
BusLineModel.setBusLinesCallback(TAG,this)
}
fun queryBusLineTasksById(lineInfo: BusQueryLinesResponse.Result) {
tasksBelongLine = lineInfo
BusLineModel.queryBusLineTasksById(lineInfo.lineId)
}
interface SwtichLineViewCallback{
fun showTaskByLineIdResult(taskList: MutableList<BusQueryLineTaskResponse.Result>)
fun showLoading()
fun hideLoading()
fun startTaskSuccess()
}
override fun onBusLineTasks(o: MutableList<BusQueryLineTaskResponse.Result>) {
viewCallback?.showTaskByLineIdResult(o)
}
override fun onRefreshSuccess(currentTimeStamp: Long) {
TODO("Not yet implemented")
}
// 选择线路成功
override fun onChangeLineIdSuccess() {
if (ThreadUtils.isMainThread()) {
viewCallback?.hideLoading()
viewCallback?.startTaskSuccess()
}else{
ThreadUtils.runOnUiThread({
viewCallback?.hideLoading()
viewCallback?.startTaskSuccess()
},ThreadUtils.MODE.QUEUE)
}
}
// 选择线路失败
override fun onChangeLineIdFail() {
if (ThreadUtils.isMainThread()) {
viewCallback?.hideLoading()
}else{
ThreadUtils.runOnUiThread({
viewCallback?.hideLoading()
},ThreadUtils.MODE.QUEUE)
}
viewCallback?.hideLoading()
}
fun changeLineStart(checkTask:BusQueryLineTaskResponse.Result) {
if(tasksBelongLine==null){
ToastUtils.showShort("请重新选择线路")
return
}
viewCallback?.showLoading()
BusLineModel.commitSwitchLineId(checkTask,tasksBelongLine!!)
}
}

View File

@@ -0,0 +1,46 @@
package com.mogo.och.weaknet.ui.switchtask
import android.graphics.Rect
import android.view.View
import android.widget.LinearLayout
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
class TaskBottomDecoration(val distance: Int) : RecyclerView.ItemDecoration() {
private val TAG = "TaskBottomDecoration"
override fun getItemOffsets(
outRect: Rect,
view: View,
parent: RecyclerView,
state: RecyclerView.State
) {
val pos = parent.getChildAdapterPosition(view)
/**
* 通过设置Item左右边距实现第一个左侧和最后一个右侧设置边距,确保显示的视图位于屏幕中间
*/
val itemCount = parent.adapter!!.itemCount
val layoutManager = parent.layoutManager
if(layoutManager is GridLayoutManager){
var lastPathCount = itemCount % layoutManager.spanCount
//2 5 % 3
CallerLogger.d(TAG,"位置---${pos}_lastPathCount:${lastPathCount}_____itemCount:${itemCount}__spanCount:${layoutManager.spanCount}")
if(lastPathCount==0){
lastPathCount = layoutManager.spanCount
}
if(pos<itemCount-lastPathCount){
}else{
outRect.bottom = distance
}
// if(pos==itemCount-1){
// outRect.bottom = distance
// }
}
//super.getItemOffsets(outRect, view, parent, state)
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.weaknet.ui.taskrunning;
package com.mogo.och.weaknet.ui.taskrunned;
import android.graphics.Rect;
import android.view.View;

View File

@@ -1,4 +1,4 @@
package com.mogo.och.weaknet.ui.taskrunning
package com.mogo.och.weaknet.ui.taskrunned
import android.content.Context
import android.view.LayoutInflater
@@ -8,10 +8,7 @@ import android.widget.TextView
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.DiffUtil.Callback
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.function.business.travelreality.EventDrawBean
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import com.mogo.och.weaknet.ui.adapter.SwitchLineTaskAdapter.SwitchLineTaskViewHolder
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.WaitUploadLine

View File

@@ -1,4 +1,4 @@
package com.mogo.och.weaknet.ui.taskrunning
package com.mogo.och.weaknet.ui.taskrunned
import android.content.Context
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.kotlin.lifeCycleOwner
import com.mogo.eagle.core.utilcode.reminder.Reminder
import com.mogo.eagle.core.utilcode.reminder.api.impl.PopupWindowReminder
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.och.weaknet.ui.bizswitch.SwitchBizView
import me.jessyan.autosize.utils.AutoSizeUtils
import kotlin.math.abs
@@ -58,6 +59,14 @@ object RunningTaskManager : LifecycleEventObserver{
}
}
/**
* 展示BadCase配置页面
*/
fun showSwitchLineWindow(context: Context) {
val badCaseConfigView = SwitchBizView(context)
}
override fun onStateChanged(source: LifecycleOwner, event: Event) {
}

View File

@@ -1,8 +1,6 @@
package com.mogo.och.weaknet.ui.taskrunning
package com.mogo.och.weaknet.ui.taskrunned
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.lifecycle.ViewModelProvider
@@ -13,10 +11,8 @@ import com.mogo.och.common.module.utils.ResourcesUtils
import com.mogo.och.common.module.wigets.WindowRelativeLayout
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.WaitUploadLine
import com.mogo.och.weaknet.ui.adapter.OpenItemAnimator
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.aciv_show_data
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.actvCurrentDate
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.clLayout
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.ivTaskRunningClose
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.no_order_data_view
import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.rvDataLiet
@@ -62,7 +58,6 @@ class RunningTaskManagerView: WindowRelativeLayout, RunningTastViewModel.Running
linearLayoutManager = LinearLayoutManager(context)
rvDataLiet.setLayoutManager(linearLayoutManager)
rvDataLiet.setItemAnimator(OpenItemAnimator())
mAdapter = RunningTaskAdapter(context, mutableListOf())
rvDataLiet.addItemDecoration(
BottomDecoration(

View File

@@ -1,4 +1,4 @@
package com.mogo.och.weaknet.ui.taskrunning
package com.mogo.och.weaknet.ui.taskrunned
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger

View File

@@ -0,0 +1,129 @@
package com.mogo.och.weaknet.ui.taskrunning
import android.annotation.SuppressLint
import android.content.Context
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.AppCompatTextView
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.DiffUtil.Callback
import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.common.module.utils.ResourcesUtils
import com.mogo.och.data.bean.BusStationBean
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse
import me.jessyan.autosize.utils.AutoSizeUtils
/**
* 路线列表adapter
*/
class TaskRunningAdapter(
private val mContext: Context,
val mData: MutableList<BusStationBean>
) : RecyclerView.Adapter<TaskRunningAdapter.TaskRunningViewHolder>() {
companion object{
const val TAG = "TaskRunningAdapter"
}
private var startStationIndex:Int = -1
@SuppressLint("NotifyDataSetChanged")
fun setDataList(dataList: List<BusStationBean>, startStationIndex:Int) {
this.startStationIndex = startStationIndex
this.mData.clear()
this.mData.addAll(dataList)
notifyDataSetChanged()
}
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): TaskRunningViewHolder {
val view = LayoutInflater.from(mContext).inflate(
R.layout.shuttle_weak_running_station_list_item, parent, false
)
return TaskRunningViewHolder(view)
}
override fun onBindViewHolder(holder: TaskRunningViewHolder, position: Int) {
val currentPosition = holder.bindingAdapterPosition
val line = mData[currentPosition]
holder.actvStationName.text = line.name
if(currentPosition<startStationIndex){
holder.actvStationName.setTextSize(TypedValue.COMPLEX_UNIT_PX, AutoSizeUtils.dp2px(mContext,40f).toFloat())
holder.actvStationName.setTextColor(ResourcesUtils.getColor(R.color.bus_color_4dffffff))
holder.itemView.background = null
}else if(currentPosition==startStationIndex){
holder.actvStationName.setTextSize(TypedValue.COMPLEX_UNIT_PX, AutoSizeUtils.dp2px(mContext,45f).toFloat())
holder.actvStationName.setTextColor(ResourcesUtils.getColor(R.color.bus_color_2EACFF))
holder.itemView.setBackgroundResource(R.drawable.bus_task_current_station_bg)
}else{
holder.actvStationName.setTextColor(ResourcesUtils.getColor(R.color.white))
holder.actvStationName.setTextSize(TypedValue.COMPLEX_UNIT_PX, AutoSizeUtils.dp2px(mContext,40f).toFloat())
holder.itemView.background = null
}
when (currentPosition) {
0 -> {
holder.acivStationHeadBig.visibility = View.VISIBLE
holder.acivStationHead.visibility = View.INVISIBLE
holder.acivStationHeadBig.setImageResource(R.drawable.bus_runnint_task_start)
}
mData.size-1 -> {
holder.acivStationHeadBig.visibility = View.VISIBLE
holder.acivStationHead.visibility = View.INVISIBLE
holder.acivStationHeadBig.setImageResource(R.drawable.bus_runnint_task_end)
}
else -> {
holder.acivStationHeadBig.visibility = View.GONE
holder.acivStationHead.visibility = View.VISIBLE
holder.acivStationHead.setImageResource(R.drawable.bus_runnint_task_middle)
}
}
}
override fun getItemCount(): Int {
return mData.size
}
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 actvWriteOffCount: AppCompatTextView = itemView.findViewById(R.id.actv_write_off_count) //此战核销的人数
}
interface LineItemClickListener {
fun onItemClick(position: Int,close:Boolean)
}
inner class MyDiffCallback(private val oldData:List<BusStationBean>, private val newData:List<BusStationBean>):
Callback(){
override fun getOldListSize(): Int {
return oldData.size
}
override fun getNewListSize(): Int {
return newData.size
}
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
val oldItem = oldData[oldItemPosition]
val newItem = newData[newItemPosition]
return oldItem == newItem
}
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
val oldItem = oldData[oldItemPosition]
val newItem = newData[newItemPosition]
return oldItem == newItem
}
}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.och.weaknet.ui.taskrunning
import androidx.lifecycle.ViewModel
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
import com.mogo.och.weaknet.callback.IBusLinesCallback
import com.mogo.och.weaknet.model.BusLineModel
import com.mogo.och.weaknet.model.BusLineModel.executableChangeTime
import com.mogo.och.weaknet.model.OrderModel
/**
* @author XuXinChao
* @description BadCase录包管理页面
* @since: 2022/12/15
*/
class TaskRunningModel : ViewModel() {
private val TAG = TaskRunningModel::class.java.simpleName
private var viewCallback:SwtichLineViewCallback?=null
override fun onCleared() {
}
fun setDistanceCallback(viewCallback:SwtichLineViewCallback){
this.viewCallback = viewCallback
}
fun leaveStation() {
OrderModel.autoDriveToNextStation()
}
interface SwtichLineViewCallback{
}
}

View File

@@ -0,0 +1,96 @@
package com.mogo.och.weaknet.ui.taskrunning
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
import com.mogo.och.common.module.manager.autopilot.line.LineManager
import com.mogo.och.shuttle.weaknet.R
import com.mogo.och.weaknet.model.BusLineModel
import com.mogo.och.weaknet.ui.bizswitch.SwtichBizeModel
import com.mogo.och.weaknet.ui.switchline.SwitchLineAdapter
import com.mogo.och.weaknet.view.BizLeaveStationView.SlideListener
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.switch_line_rv
import kotlinx.android.synthetic.main.shuttle_weak_task_running.view.aciv_task_leave_station_slide_bg
import kotlinx.android.synthetic.main.shuttle_weak_task_running.view.actv_running_task_last_station
import kotlinx.android.synthetic.main.shuttle_weak_task_running.view.actv_running_task_time
import kotlinx.android.synthetic.main.shuttle_weak_task_running.view.bus_task_running_line_name
import kotlinx.android.synthetic.main.shuttle_weak_task_running.view.rl_running_task_station_list
import me.jessyan.autosize.utils.AutoSizeUtils
class TaskRunningView: ConstraintLayout, TaskRunningModel.SwtichLineViewCallback {
constructor(context: Context) : super(context)
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
companion object {
const val TAG = "TaskRunningView"
}
private var viewModel:TaskRunningModel?=null
private var viewbizModel:SwtichBizeModel?=null
private lateinit var mAdapter: TaskRunningAdapter
private var animator:ObjectAnimator?=null
private lateinit var linearLayoutManager:LinearLayoutManager
init {
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_task_running, this, true)
initView()
}
private fun initView(){
linearLayoutManager = LinearLayoutManager(context)
rl_running_task_station_list.setLayoutManager(linearLayoutManager)
mAdapter = TaskRunningAdapter(context, mutableListOf())
rl_running_task_station_list.addItemDecoration(
SpacesItemDecoration(
AutoSizeUtils.dp2px(context,20f)
)
)
rl_running_task_station_list.setAdapter(mAdapter)
aciv_task_leave_station_slide_bg.setSlideListener(object : SlideListener{
override fun slideEnd() {
viewModel?.leaveStation()
}
})
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
viewModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(TaskRunningModel::class.java)
}
viewbizModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(SwtichBizeModel::class.java)
}
viewModel?.setDistanceCallback(this)
}
fun showRunningTaskInfo() {
bus_task_running_line_name.text = LineManager.lineInfos?.lineName?:""
actv_running_task_time.text = BusLineModel.getTaskTime()
BusLineModel.stationList?.takeIf { it.size>2 }?.let {
actv_running_task_last_station.text = "${it.last().name ?: ""}"
mAdapter.setDataList(it,BusLineModel.startStationIndex)
}
}
}

View File

@@ -0,0 +1,129 @@
package com.mogo.och.weaknet.view
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.MotionEvent
import androidx.appcompat.widget.AppCompatTextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.och.shuttle.weaknet.R
class BizLeaveStationView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
companion object {
const val TAG = "LoadingMapStatusView"
}
private var initialX = 0f
private var initialY = 0f
private val tempSet = ConstraintSet()
private var draggableButton: AppCompatTextView
private var slideListener:SlideListener?=null
fun setSlideListener(slideListener:SlideListener){
this.slideListener = slideListener
}
init {
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_task_leave_station_view, this, true)
draggableButton = findViewById(R.id.actv_draggable)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerLogger.d(TAG,"onAttachedToWindow")
}
/**
* 为该组件的触碰事件重写事件处理方法
*/
override fun onTouchEvent(event: MotionEvent?): Boolean {
when (event?.action) {
MotionEvent.ACTION_DOWN -> {
initialX = event.rawX;
initialY = event.rawY;
}
MotionEvent.ACTION_MOVE -> {
val dx = event.rawX - initialX;
val dy = event.rawY - initialY;
initialX = event.rawX;
initialY = event.rawY;
if(draggableButton.translationX<0){
tempSet.clone(this)
tempSet.setTranslationX(draggableButton.id, 0f)
tempSet.applyTo(this)
}else if(draggableButton.translationX>=0&&draggableButton.translationX<=width-draggableButton.width){
tempSet.clone(this)
val dex = (draggableButton.translationX + dx).takeIf { it>=0 }?:0f
val newDex = dex.takeIf { it<=width-draggableButton.width }?:(width-draggableButton.width).toFloat()
tempSet.setTranslationX(draggableButton.id, newDex)
tempSet.applyTo(this)
}else{
tempSet.clone(this)
val dex = (draggableButton.translationX + dx).takeIf { it<=width-draggableButton.width }?:(width-draggableButton.width).toFloat()
tempSet.setTranslationX(draggableButton.id, dex)
tempSet.applyTo(this)
}
}
MotionEvent.ACTION_UP -> {
if(draggableButton.translationX<(width-draggableButton.width)){
ObjectAnimator.ofFloat(
draggableButton, "translationX", draggableButton.translationX,
0f
).apply {
duration = 100
}.start()
}else if (draggableButton.translationX>=(width-draggableButton.width)){
slideListener?.slideEnd()
}else{
ObjectAnimator.ofFloat(
draggableButton, "translationX", draggableButton.translationX,
0f
).apply {
duration = 100
}.start()
}
}
else -> {}
}
return true
}
override fun onVisibilityAggregated(isVisible: Boolean) {
super.onVisibilityAggregated(isVisible)
if(isVisible){
ObjectAnimator.ofFloat(
draggableButton, "translationX", draggableButton.translationX,
0f
).apply {
duration = 100
}.start()
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerLogger.d(TAG,"onDetachedFromWindow")
}
interface SlideListener{
fun slideEnd()
}
}

View File

@@ -0,0 +1,69 @@
package com.mogo.och.weaknet.view
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.animation.LinearInterpolator
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.map.listener.IMogoMapListener
import com.mogo.och.shuttle.weaknet.R
import kotlinx.android.synthetic.main.shuttle_weak_loading_view.view.actv_loading_text
import kotlinx.android.synthetic.main.shuttle_weak_loading_view.view.loading_view
class LoadingViewBig @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr),IMogoMapListener {
companion object {
const val TAG = "LoadingMapStatusView"
}
private var autopilotLoadingAnimator: ObjectAnimator? = null
init {
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_loading_view, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerLogger.d(TAG,"onAttachedToWindow")
if (autopilotLoadingAnimator == null) {
autopilotLoadingAnimator = ObjectAnimator.ofFloat(loading_view, "rotation", 0f, 360f)
autopilotLoadingAnimator?.setInterpolator(LinearInterpolator())
autopilotLoadingAnimator?.setRepeatCount(-1) //无限循环
autopilotLoadingAnimator?.setDuration(1000) //设置持续时间
}
}
override fun onVisibilityAggregated(isVisible: Boolean) {
super.onVisibilityAggregated(isVisible)
if(isVisible){
autopilotLoadingAnimator?.start()
}else{
autopilotLoadingAnimator?.cancel()
}
}
fun setEmptyText(text:CharSequence){
if (ThreadUtils.isMainThread()) {
actv_loading_text.text = text
}else{
ThreadUtils.runOnUiThread( {
actv_loading_text.text = text
},ThreadUtils.MODE.QUEUE)
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerLogger.d(TAG,"onDetachedFromWindow")
}
}

View File

@@ -0,0 +1,56 @@
package com.mogo.och.weaknet.view
import android.animation.ObjectAnimator
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.animation.LinearInterpolator
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.map.listener.IMogoMapListener
import com.mogo.och.shuttle.weaknet.R
import kotlinx.android.synthetic.main.shuttle_weak_loading_view_samll.view.loading_view_samll
class LoadingViewSmall @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr),IMogoMapListener {
companion object {
const val TAG = "LoadingMapStatusView"
}
private var autopilotLoadingAnimator: ObjectAnimator? = null
init {
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_loading_view_samll, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerLogger.d(TAG,"onAttachedToWindow")
if (autopilotLoadingAnimator == null) {
autopilotLoadingAnimator = ObjectAnimator.ofFloat(loading_view_samll, "rotation", 0f, 360f)
autopilotLoadingAnimator?.setInterpolator(LinearInterpolator())
autopilotLoadingAnimator?.setRepeatCount(-1) //无限循环
autopilotLoadingAnimator?.setDuration(1000) //设置持续时间
}
}
override fun onVisibilityAggregated(isVisible: Boolean) {
super.onVisibilityAggregated(isVisible)
if(isVisible){
autopilotLoadingAnimator?.start()
}else{
autopilotLoadingAnimator?.cancel()
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerLogger.d(TAG,"onDetachedFromWindow")
}
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/bus_color_2EACFF" android:state_pressed="true"/>
<item android:color="@color/white" android:state_pressed="false"/>
<item android:color="@color/white"/>
</selector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/bus_color_2EACFF" android:state_checked="true"/>
<item android:color="@color/white" android:state_checked="false"/>
<item android:color="@color/bus_color_2EACFF" android:state_pressed="true"/>
<item android:color="@color/white" android:state_pressed="false"/>
<item android:color="@color/white"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:endColor="#660043FF"
android:startColor="#0028345E" />
<solid android:color="@color/bus_color_4D000000"/>
<corners android:radius="@dimen/dp_30"/>
</shape>

View File

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

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:endColor="#CC0043FF"
android:startColor="#0028345E" />
<corners android:radius="@dimen/dp_30" />
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/bus_switch_line_selected"/>
<item android:state_pressed="false" android:drawable="@drawable/bus_switch_line_normal"/>
<item android:drawable="@drawable/bus_switch_line_normal"/>
</selector>

View File

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

View File

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

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/bus_switch_task_selected"/>
<item android:state_pressed="false" android:drawable="@drawable/bus_switch_task_normal"/>
<item android:state_checked="true" android:drawable="@drawable/bus_switch_task_selected"/>
<item android:state_checked="false" android:drawable="@drawable/bus_switch_task_normal"/>
<item android:drawable="@drawable/bus_switch_task_normal"/>
</selector>

View File

@@ -0,0 +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_30"/>
<solid android:color="@color/bus_color_4dffffff"/>
</shape>

View File

@@ -0,0 +1,8 @@
<?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_30"/>
<gradient android:startColor="@color/bus_color_19E6D4"
android:angle="-100"
android:endColor="@color/bus_color_198BF6"/>
</shape>

View File

@@ -364,4 +364,10 @@
app:layout_constraintStart_toStartOf="parent"
/>
<com.mogo.och.weaknet.ui.bizswitch.SwitchBizView
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:background="@color/bus_switch_line_bg"
android:id="@+id/no_order_data_view">
<ImageView
android:id="@+id/no_order_data_iv"
android:layout_width="@dimen/dp_198"
android:layout_height="@dimen/dp_158"
android:src="@drawable/shuttle_weak_empty"
android:scaleType="fitXY"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<TextView
android:id="@+id/no_order_data_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/bus_color_B3FFFFFF"
android:textSize="@dimen/dp_40"
android:gravity="center"
android:layout_marginTop="@dimen/dp_31"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv"
android:text="@string/bus_no_task"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/ll_loaing_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
tools:background="@color/bus_switch_line_bg"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/loading_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_16"
android:src="@drawable/bus_switch_biz_loading_big" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_loading_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_15"
android:text="@string/bus_switch_biz_loading"
android:textColor="@color/bus_color_b3ffffff"
android:textSize="@dimen/dp_40" />
</LinearLayout>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.AppCompatImageView 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:id="@+id/loading_view_samll"
android:layout_width="@dimen/dp_61"
android:layout_height="@dimen/dp_60"
android:layout_marginBottom="@dimen/dp_16"
android:src="@drawable/bus_switch_biz_loading_samll" />

View File

@@ -0,0 +1,60 @@
<?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_100"
tools:background="@drawable/bus_switch_line_selector">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_station_head"
android:src="@drawable/bus_switch_line_adapter_point"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="@dimen/dp_33"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_30"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_station_head_big"
android:src="@drawable/bus_switch_line_adapter_point"
app:layout_constraintTop_toTopOf="@+id/aciv_station_head"
app:layout_constraintStart_toStartOf="@+id/aciv_station_head"
app:layout_constraintBottom_toBottomOf="@+id/aciv_station_head"
app:layout_constraintEnd_toEndOf="@+id/aciv_station_head"
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_station_name"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/aciv_station_head"
android:layout_marginStart="@dimen/dp_36"
android:layout_marginEnd="@dimen/dp_36"
app:layout_constraintEnd_toStartOf="@+id/actv_write_off_count"
android:text="天安门天安门天安门…"
android:singleLine="true"
android:textColor="@color/white"
android:ellipsize="end"
android:textSize="@dimen/dp_45"
android:layout_width="0dp"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_write_off_count"
android:text="核销66人"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textSize="@dimen/dp_36"
android:textColor="@color/white"
android:layout_marginEnd="@dimen/dp_30"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,58 @@
<?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"
android:layout_width="@dimen/dp_964"
android:layout_height="@dimen/dp_1051"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/bus_biz_bg">
<androidx.appcompat.widget.AppCompatImageView
android:src="@drawable/bus_biz_bg_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_23"
android:layout_marginEnd="@dimen/dp_42"
android:layout_width="@dimen/dp_856"
android:layout_height="@dimen/dp_100"/>
<com.mogo.och.weaknet.view.LoadingViewBig
android:id="@+id/loading_biz"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.mogo.och.weaknet.ui.switchline.SwitchLineView
android:id="@+id/swtichLine"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="@dimen/dp_23"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.mogo.och.weaknet.ui.switchtask.SwitchTaskView
android:id="@+id/swtichTask"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="@dimen/dp_23"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.mogo.och.weaknet.ui.taskrunning.TaskRunningView
android:id="@+id/taskRunning"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="@dimen/dp_23"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,31 +1,20 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/bus_switch_line_bg">
<View
android:id="@+id/switch_line_1"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_50"
android:layout_marginLeft="@dimen/dp_80"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_lint_title"
app:layout_constraintBottom_toBottomOf="@+id/bus_lint_title"
android:background="@color/switch_line"/>
android:layout_width="@dimen/dp_880"
android:layout_height="@dimen/dp_966"
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:id="@+id/bus_lint_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_42"
android:layout_marginLeft="@dimen/dp_113"
app:layout_constraintLeft_toLeftOf="parent"
android:textSize="@dimen/dp_45"
android:layout_marginLeft="@dimen/dp_54"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_97"
android:textColor="@android:color/white"
android:layout_marginTop="@dimen/dp_37"
android:textColor="@color/white"
android:text="@string/bus_switch_line_title"/>
<androidx.appcompat.widget.AppCompatImageView
@@ -35,27 +24,17 @@
app:layout_constraintStart_toEndOf="@+id/bus_lint_title"
android:layout_marginStart="@dimen/dp_30"
android:src="@drawable/shuttle_refresh_task"
android:layout_width="@dimen/dp_59"
android:layout_height="@dimen/dp_60"/>
<ImageView
android:id="@+id/switch_line_close"
android:layout_width="@dimen/dp_107"
android:layout_height="@dimen/dp_107"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_67"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/bus_switch_line_close"/>
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_50"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_last_refresh_date"
android:textColor="@color/shuttle_driver_D4D4D4"
android:textSize="@dimen/dp_34"
android:textColor="@color/white"
android:textSize="@dimen/dp_36"
app:layout_constraintStart_toStartOf="@+id/bus_lint_title"
app:layout_constraintTop_toBottomOf="@+id/bus_lint_title"
android:layout_marginTop="@dimen/dp_50"
tools:text="更新时间:2024-07-10 15:00:00"
android:layout_marginTop="@dimen/dp_11"
tools:text="更新时间15:00:00"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
@@ -63,41 +42,12 @@
android:id="@+id/switch_line_rv"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0"
app:layout_constraintLeft_toLeftOf="@+id/switch_line_1"
android:layout_marginStart="@dimen/dp_54"
android:layout_marginEnd="@dimen/bus_dp_52"
app:layout_constraintTop_toBottomOf="@+id/actv_last_refresh_date"
app:layout_constraintBottom_toTopOf="@+id/switch_line_btn_commit"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_30"/>
<LinearLayout
android:id="@+id/switch_line_btn_commit"
android:layout_width="match_parent"
android:layout_marginStart="@dimen/dp_80"
android:layout_marginEnd="@dimen/dp_80"
android:layout_height="126dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/bus_switch_line_btn_commit"
android:gravity="center"
android:layout_marginBottom="@dimen/bus_switch_line_btn_margin_b">
<ProgressBar
android:id="@+id/pb_start_task"
android:progressBackgroundTint="@color/white"
android:visibility="gone"
android:layout_marginEnd="@dimen/dp_15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv_start_task"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_42"
android:textColor="@android:color/white"
android:text="@string/bus_switch_line_btn_txt"
android:gravity="center" />
</LinearLayout>
android:layout_marginTop="@dimen/dp_22"
android:layout_marginBottom="@dimen/dp_24"/>
<include
android:layout_width="match_parent"

View File

@@ -4,28 +4,26 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bus_shape_select_line_item_bg_normal">
android:background="@drawable/bus_switch_line_selector">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_show_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_13"
android:text="选择时间"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintTop_toTopOf="@+id/switch_line_item_select_iv"
app:layout_constraintBottom_toBottomOf="@+id/switch_line_item_select_iv"
app:layout_constraintEnd_toStartOf="@+id/switch_line_item_select_iv" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_line_point"
android:src="@drawable/bus_switch_line_adapter_point"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_width="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_39"
android:layout_marginStart="@dimen/dp_30"
android:layout_height="@dimen/dp_30"/>
<ImageView
android:id="@+id/switch_line_item_select_iv"
android:layout_width="@dimen/dp_19"
android:layout_height="@dimen/dp_34"
android:layout_marginEnd="@dimen/dp_80"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_32"
android:layout_marginEnd="@dimen/dp_30"
android:background="@drawable/bus_line_task_arrow"
app:layout_constraintBottom_toTopOf="@+id/v_line_task"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -33,15 +31,16 @@
android:id="@+id/switch_line_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_80"
android:layout_marginTop="@dimen/dp_34"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_46"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@+id/actv_show_more"
android:textSize="@dimen/dp_40"
app:layout_constraintTop_toTopOf="@+id/aciv_line_point"
app:layout_constraintBottom_toBottomOf="@+id/aciv_line_point"
app:layout_constraintStart_toEndOf="@+id/aciv_line_point"
app:layout_constraintEnd_toStartOf="@+id/switch_line_item_select_iv"
tools:text="@string/bus_switch_line_name" />
<androidx.appcompat.widget.AppCompatTextView
@@ -49,42 +48,15 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_35"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_28"
android:singleLine="true"
android:textColor="@color/bus_color_ccb9c3e9"
android:textSize="@dimen/dp_36"
app:layout_constraintBottom_toTopOf="@+id/v_line_task"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/switch_line_name"
app:layout_constraintTop_toBottomOf="@+id/switch_line_name"
app:layout_constraintEnd_toStartOf="@+id/actv_show_more"
app:layout_constraintEnd_toStartOf="@+id/switch_line_item_select_iv"
tools:text="@string/bus_switch_line_end" />
<View
android:id="@+id/v_line_task"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="@dimen/dp_80"
android:layout_marginEnd="@dimen/dp_80"
android:background="#63ffffff"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/rv_line_task_list"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch_line_end_station" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_line_task_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_50"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_20"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v_line_task" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,115 @@
<?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="@dimen/dp_880"
android:layout_height="@dimen/dp_966"
tools:background="@drawable/bus_switch_line_normal">
<TextView
android:id="@+id/busLineName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_54"
android:layout_marginTop="@dimen/dp_37"
tools:text="@string/bus_switch_line_title"
android:textColor="@color/white"
android:textSize="@dimen/dp_45"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actvLineEndStationName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/white"
android:textSize="@dimen/dp_36"
app:layout_constraintStart_toStartOf="@+id/busLineName"
app:layout_constraintTop_toBottomOf="@+id/busLineName"
tools:text="往新街口方向" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_switch_task"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0"
android:layout_marginStart="@dimen/dp_54"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginEnd="@dimen/bus_dp_52"
android:layout_marginBottom="@dimen/dp_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/actvLineEndStationName" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_bottom_shadow"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/bus_weak_switch_task_bottom"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_290"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_submit_task"
android:layout_width="@dimen/dp_356"
android:layout_height="@dimen/dp_120"
android:layout_marginStart="@dimen/dp_57"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginBottom="@dimen/dp_54">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_submit_task"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:pressed_enabled="false"
android:gravity="center"
android:text="@string/bus_switch_task_submit"
android:background="@drawable/bus_switch_task_selector"
android:textColor="@color/bus_task_submit_text_color_selector"
android:textSize="@dimen/dp_40"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
<com.mogo.och.weaknet.view.LoadingViewSmall
android:id="@+id/loading_start_line"
android:src="@drawable/bus_switch_biz_loading_samll"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="@dimen/dp_30"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_cancle_task"
android:layout_width="@dimen/dp_356"
android:layout_height="@dimen/dp_120"
android:layout_marginEnd="@dimen/dp_57"
android:layout_marginBottom="@dimen/dp_54"
app:pressed_enabled="false"
android:background="@drawable/bus_switch_task_selector"
android:gravity="center"
android:text="@string/bus_switch_task_cancle"
android:textColor="@color/bus_task_submit_text_color_selector"
android:textSize="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<include
android:id="@+id/include_empty"
layout="@layout/shuttle_weak_empty_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.AppCompatCheckedTextView 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:id="@+id/actv_task_time"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_122"
android:layout_marginStart="@dimen/dp_21"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginEnd="@dimen/dp_21"
android:layout_marginBottom="@dimen/dp_24"
android:background="@drawable/bus_switch_task_selector"
android:gravity="center"
android:textAlignment="center"
android:textColor="@color/bus_task_text_color_selector"
android:textSize="@dimen/dp_45"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="7:00">
</androidx.appcompat.widget.AppCompatCheckedTextView>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<merge 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:id="@+id/ll_loaing_view"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_task_leave_station_slide_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/bus_task_leave_station_slide_bg"
android:layout_width="@dimen/dp_774"
android:layout_height="@dimen/dp_120"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_draggable"
android:text="@string/bus_task_leave_station"
android:textColor="@color/white"
android:gravity="center"
android:background="@drawable/bus_task_leave_station_slede"
app:layout_constraintTop_toTopOf="@+id/aciv_task_leave_station_slide_bg"
app:layout_constraintBottom_toBottomOf="@+id/aciv_task_leave_station_slide_bg"
app:layout_constraintStart_toStartOf="@+id/aciv_task_leave_station_slide_bg"
android:textSize="@dimen/dp_40"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_120"/>
</merge>

View File

@@ -0,0 +1,65 @@
<?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"
android:layout_width="@dimen/dp_880"
android:layout_height="@dimen/dp_966"
tools:background="@drawable/bus_switch_line_normal"
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:id="@+id/bus_task_running_line_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_45"
android:layout_marginLeft="@dimen/dp_54"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_37"
android:textColor="@color/white"
android:text="@string/bus_switch_line_title"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_running_task_last_station"
android:textColor="@color/white"
android:textSize="@dimen/dp_36"
app:layout_constraintStart_toStartOf="@+id/bus_task_running_line_name"
app:layout_constraintTop_toBottomOf="@+id/bus_task_running_line_name"
android:layout_marginTop="@dimen/dp_11"
tools:text="往新街口方向"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_running_task_time"
android:textColor="@color/white"
android:gravity="center"
android:textSize="@dimen/dp_36"
android:layout_marginEnd="@dimen/dp_54"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="往新街口方向"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_running_task_station_list"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0"
android:layout_marginStart="@dimen/dp_54"
android:layout_marginEnd="@dimen/bus_dp_52"
app:layout_constraintTop_toBottomOf="@+id/actv_running_task_last_station"
app:layout_constraintBottom_toTopOf="@+id/aciv_task_leave_station_slide_bg"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginBottom="@dimen/dp_46"/>
<com.mogo.och.weaknet.view.BizLeaveStationView
android:id="@+id/aciv_task_leave_station_slide_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="@dimen/dp_46"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -49,9 +49,18 @@
<color name="bus_traffic_light_yellow_color_up">#FFFFE198</color>
<color name="bus_traffic_light_yellow_color_down">#FFFF9B00</color>
<color name="bus_arrived_btn_un_clickable_color">#59FFFFFF</color>
<color name="bus_color_4D000000">#4D000000</color>
<color name="bus_color_80000000">#80000000</color>
<color name="bus_color_B3FFFFFF">#B3FFFFFF</color>
<color name="bus_color_4DFFFFFF">#4D2EACFF</color>
<color name="bus_color_19E6D4">#19E6D4</color>
<color name="bus_color_198BF6">#198BF6</color>
<color name="bus_color_66666">#666666</color>
<color name="bus_color_ccb9c3e9">#CCB9C3E9</color>
<color name="bus_color_4dffffff">#4Dffffff</color>
<color name="bus_color_b3ffffff">#B3ffffff</color>
<color name="bus_color_2EACFF">#2EACFF</color>
<color name="bus_station_tag_txt_un_color">#8E9DD4</color>
<color name="bus_task_time_bg_color">#2B6EFF</color>

View File

@@ -5,9 +5,12 @@
<string name="bus_loading_autopilot_success_tv">启动成功</string>
<string name="bus_loading_autopilot_failure_tv">启动失败</string>
<string name="bus_loading_autopilot_runnig_tv">自动驾驶</string>
<string name="bus_switch_line_title">任务列表</string>
<string name="bus_switch_line_title">请选择任务</string>
<string name="bus_switch_line_no_task">暂无任务</string>
<string name="bus_switch_line_select_task">选择时间</string>
<string name="bus_switch_task_submit">确认班次</string>
<string name="bus_switch_task_cancle">返回</string>
<string name="bus_switch_biz_loading">加载中……</string>
<string name="bus_switch_line_name">路线: </string>
<string name="bus_switch_line_start">起点: </string>
<string name="bus_switch_line_end">终点:</string>
@@ -17,11 +20,13 @@
<string name="bus_switch_line_btn_warning1">自动驾驶状态中,不可切换或结束路线</string>
<string name="bus_switch_line_btn_warning2">当前行程未完成,不可切换路线</string>
<string name="bus_no_line_tip">当前车辆无路线\n请联系运营人员绑定</string>
<string name="bus_no_task">暂无任务</string>
<string name="bus_line_start">起点: </string>
<string name="bus_line_end">终点: </string>
<string name="bus_line_goto_end">往%1$s方向</string>
<string name="bus_change_line_commit_tip_s">更换任务成功</string>
<string name="bus_change_line_commit_tip_f">更换任务失败</string>
<string name="bus_task_leave_station">滑动出发</string>
<string name="bus_arrive_to_end_start">起点:</string>
<string name="bus_arrive_to_end_end">终点:</string>
<string name="bus_arrive_to_current_tag">当前站点:</string>