[6.7.0]
[fea] [选择线路和选择任务]
@@ -23,6 +23,7 @@ public class DateTimeUtil {
|
||||
public static final String yy_MM_dd = "yy.MM.dd";
|
||||
public static final String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
|
||||
public static final String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
|
||||
public static final String HH_mm_ss = "HH:mm:ss";
|
||||
public static final String MM_dd_HH_mm_china = "yyyy年MM月dd日";
|
||||
|
||||
public static String formatCalendarToString(Calendar calendar, String format){
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.common.module.utils
|
||||
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.BitmapFactory
|
||||
import androidx.annotation.ColorRes
|
||||
import androidx.annotation.StringRes
|
||||
@@ -11,6 +12,10 @@ object ResourcesUtils {
|
||||
fun getColor(@ColorRes id: Int): Int {
|
||||
return ContextCompat.getColor(AbsMogoApplication.getApp(),id)
|
||||
}
|
||||
@JvmStatic
|
||||
fun getColors(@ColorRes id: Int): ColorStateList? {
|
||||
return ContextCompat.getColorStateList(AbsMogoApplication.getApp(),id)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getString(@StringRes id: Int): String {
|
||||
|
||||
@@ -36,7 +36,6 @@ public class BusQueryLinesResponse extends BaseData {
|
||||
public String startSiteName;//始发站名称
|
||||
public String endSiteName;//终点名称
|
||||
|
||||
public boolean open;//true 打开状态 false
|
||||
public boolean haveTask;
|
||||
|
||||
public List<BusQueryLineTaskResponse.Result> taskList;
|
||||
|
||||
@@ -10,9 +10,9 @@ import java.util.List;
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public interface IBusLinesCallback {
|
||||
void onBusLinesChange(List<BusQueryLinesResponse.Result> data);
|
||||
default void onBusLinesChange(List<BusQueryLinesResponse.Result> data){}
|
||||
void onChangeLineIdSuccess();
|
||||
void onBusLineTasks(List<BusQueryLineTaskResponse.Result> o, int position,boolean autoRefresh);
|
||||
default void onBusLineTasks(List<BusQueryLineTaskResponse.Result> o){}
|
||||
|
||||
void onRefreshSuccess(long currentTimeStamp);
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ import com.mogo.och.weaknet.database.transform.transform4DataBase
|
||||
import com.mogo.och.weaknet.net.OrderServiceManager
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
/**
|
||||
@@ -57,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"
|
||||
|
||||
@@ -101,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() {
|
||||
@@ -139,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
|
||||
@@ -203,7 +213,9 @@ object BusLineModel {
|
||||
}
|
||||
|
||||
override fun onNext(data: List<BusQueryLinesResponse.Result>) {
|
||||
mBusLinesCallback?.onBusLinesChange(data)
|
||||
mBusLinesCallbackMap.forEach {
|
||||
it.value.onBusLinesChange(data)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
@@ -215,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>> {
|
||||
@@ -232,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,12 +266,16 @@ object BusLineModel {
|
||||
SharedPrefsMgr.getInstance()
|
||||
.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()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
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
|
||||
|
||||
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() {
|
||||
showLoadingView()
|
||||
swtichLine.loadingDatas()
|
||||
}
|
||||
|
||||
|
||||
override fun showSwitchTaskByLineInfo(lineInfo: BusQueryLinesResponse.Result) {
|
||||
// 展示loading
|
||||
showLoadingView()
|
||||
swtichTask.queryTaskByLineInfo(lineInfo)
|
||||
}
|
||||
|
||||
override fun showSwitchTaskInfo() {
|
||||
val endLoading = System.currentTimeMillis()
|
||||
val dex = endLoading - startLoading
|
||||
CallerLogger.d(TAG,"展示线路任务 lading 展示了 ${dex}毫秒")
|
||||
if(dex <100){
|
||||
ThreadUtils.runOnUiThreadDelayed({
|
||||
loading_biz.visibility = GONE
|
||||
swtichLine.visibility = GONE
|
||||
swtichTask.visibility = VISIBLE
|
||||
},100-dex,ThreadUtils.MODE.QUEUE)
|
||||
}else{
|
||||
loading_biz.visibility = GONE
|
||||
swtichLine.visibility = GONE
|
||||
swtichTask.visibility = VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
// 展示选择线路页面
|
||||
override fun showSwtichLineView() {
|
||||
val endLoading = System.currentTimeMillis()
|
||||
val dex = endLoading - startLoading
|
||||
CallerLogger.d(TAG,"展示线路 lading 展示了 ${dex}毫秒")
|
||||
if(dex <100){
|
||||
ThreadUtils.runOnUiThreadDelayed({
|
||||
loading_biz.visibility = GONE
|
||||
swtichLine.visibility = VISIBLE
|
||||
swtichTask.visibility = GONE
|
||||
},100-dex,ThreadUtils.MODE.QUEUE)
|
||||
}else{
|
||||
loading_biz.visibility = GONE
|
||||
swtichLine.visibility = VISIBLE
|
||||
swtichTask.visibility = GONE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun showSwitchTaskView(){
|
||||
|
||||
}
|
||||
fun showRunningTaskView(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.mogo.och.weaknet.ui.bizswitch
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.weaknet.bean.BusQueryLinesResponse
|
||||
import com.mogo.och.weaknet.model.BusLineModel
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase录包管理页面
|
||||
* @since: 2022/12/15
|
||||
*/
|
||||
class SwtichBizeModel : ViewModel() {
|
||||
|
||||
private val TAG = SwtichBizeModel::class.java.simpleName
|
||||
|
||||
private var viewCallback:SwtichLineViewCallback?=null
|
||||
|
||||
|
||||
override fun onCleared() {
|
||||
}
|
||||
|
||||
fun setDistanceCallback(viewCallback:SwtichLineViewCallback){
|
||||
this.viewCallback = viewCallback
|
||||
this.viewCallback?.loadLineData()
|
||||
}
|
||||
|
||||
fun loadingSwitchTask(lineInfo:BusQueryLinesResponse.Result){
|
||||
viewCallback?.showSwitchTaskByLineInfo(lineInfo)
|
||||
}
|
||||
|
||||
fun showSwitchTaskInfo() {
|
||||
viewCallback?.showSwitchTaskInfo()
|
||||
}
|
||||
|
||||
fun showSwitchLineInfo() {
|
||||
viewCallback?.loadLineData()
|
||||
}
|
||||
fun showSwitchLineInfoResult(){
|
||||
viewCallback?.showSwtichLineView()
|
||||
}
|
||||
|
||||
fun showRunningTaskView() {
|
||||
|
||||
}
|
||||
|
||||
interface SwtichLineViewCallback{
|
||||
fun showSwtichLineView()
|
||||
fun showLoadingView()
|
||||
fun showSwitchTaskByLineInfo(lineInfo: BusQueryLinesResponse.Result)
|
||||
fun showSwitchTaskInfo()
|
||||
fun loadLineData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.mogo.och.weaknet.ui.loading
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.mogo.och.weaknet.ui.loading
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -60,97 +60,21 @@ class SwitchLineAdapter(
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,21 +87,8 @@ class SwitchLineAdapter(
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
val lineName: AppCompatTextView = itemView.findViewById(R.id.switch_line_name)//线路名称
|
||||
val lineEndName: AppCompatTextView = itemView.findViewById(R.id.switch_line_end_station) //终点
|
||||
}
|
||||
|
||||
interface LineItemClickListener {
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
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.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.switchline.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)
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,11 @@ package com.mogo.och.weaknet.ui.switchline
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
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
|
||||
@@ -21,14 +20,12 @@ 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.pb_start_task
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.switch_line_btn_commit
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.switch_line_close
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.switch_line_rv
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.tv_start_task
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
|
||||
class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallback {
|
||||
@@ -47,8 +44,8 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
const val TAG = "BadCaseManagerView"
|
||||
}
|
||||
|
||||
private var clickListener:ClickListener?=null
|
||||
private var viewModel:SwtichLineModel?=null
|
||||
private var viewbizModel:SwtichBizeModel?=null
|
||||
|
||||
private lateinit var mAdapter: SwitchLineAdapter
|
||||
|
||||
@@ -63,32 +60,20 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
switch_line_close.onClick {
|
||||
clickListener?.onClose()
|
||||
}
|
||||
switch_line_btn_commit.onClick {
|
||||
if(mAdapter.checkLine!=null&&mAdapter.checkTask!=null){
|
||||
viewModel?.let {
|
||||
it.commitSwitchLineId(mAdapter.checkTask!!,mAdapter.checkLine!!)
|
||||
startTaskLoading()
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showLong("请选择任务")
|
||||
}
|
||||
}
|
||||
linearLayoutManager = LinearLayoutManager(context)
|
||||
switch_line_rv.setLayoutManager(linearLayoutManager)
|
||||
mAdapter = SwitchLineAdapter(context, mutableListOf())
|
||||
switch_line_rv.addItemDecoration(
|
||||
SpacesItemDecoration(
|
||||
4
|
||||
AutoSizeUtils.dp2px(context,20f)
|
||||
)
|
||||
)
|
||||
switch_line_rv.setAdapter(mAdapter)
|
||||
//设置item 点击事件
|
||||
mAdapter.setOnLineItemClickListener(object : SwitchLineAdapter.LineItemClickListener{
|
||||
override fun onItemClick(position: Int, close: Boolean) {
|
||||
viewModel?.queryBusLineTasks(mAdapter.mData[position].lineId, position, close)
|
||||
viewbizModel?.loadingSwitchTask(mAdapter.mData[position])
|
||||
//viewModel?.queryBusLineTasks(mAdapter.mData[position].lineId, position, close)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -102,72 +87,40 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
}
|
||||
animator?.start()
|
||||
}
|
||||
pb_start_task.progressTintList = ColorStateList.valueOf(Color.WHITE)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
private fun initDatas() {
|
||||
fun loadingDatas() {
|
||||
viewModel?.queryBusLines()
|
||||
viewModel?.setRefreshTime()
|
||||
}
|
||||
|
||||
fun setOnClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
|
||||
interface ClickListener {
|
||||
fun onClose()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewModel = ViewModelProvider(this).get(SwtichLineModel::class.java)
|
||||
viewModel?.setDistanceCallback(this)
|
||||
initDatas()
|
||||
}
|
||||
viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(SwtichLineModel::class.java)
|
||||
}
|
||||
viewbizModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(SwtichBizeModel::class.java)
|
||||
}
|
||||
|
||||
fun startTaskLoading(){
|
||||
pb_start_task.visibility = View.VISIBLE
|
||||
tv_start_task.text = "创建中"
|
||||
viewModel?.setDistanceCallback(this)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onBusLinesChange(data: MutableList<BusQueryLinesResponse.Result>?) {
|
||||
if (data.isNullOrEmpty()) {
|
||||
showNoData(true)
|
||||
return
|
||||
}
|
||||
val lastCommitLineid = SharedPrefsMgr.getInstance().getLong(BusLineModel.LASTCOMMITLINEID, -1)
|
||||
if (data.size > 0) {
|
||||
}else{
|
||||
showNoData(false)
|
||||
mAdapter.setDataList(data)
|
||||
if(lastCommitLineid>0){
|
||||
mAdapter.mData.forEachIndexed { index, line ->
|
||||
if(line.lineId==lastCommitLineid){
|
||||
line.open = true
|
||||
viewModel?.queryBusLineTasks(line.lineId,index,false)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showNoData(true)
|
||||
}
|
||||
viewbizModel?.showSwitchLineInfoResult()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,11 +130,9 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
private fun showNoData(b: Boolean) {
|
||||
if (b) {
|
||||
switch_line_rv.visibility = View.GONE
|
||||
switch_line_btn_commit.visibility = View.GONE
|
||||
no_order_data_view.visibility = View.VISIBLE
|
||||
} else {
|
||||
switch_line_rv.visibility = View.VISIBLE
|
||||
switch_line_btn_commit.visibility = View.VISIBLE
|
||||
no_order_data_view.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
@@ -190,46 +141,6 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
ToastUtils.showLong(resources.getString(R.string.bus_change_line_commit_tip_s))
|
||||
viewModel?.queryBusRoutes()
|
||||
mAdapter.setOnLineItemClickListener(null)
|
||||
clickListener?.onClose()
|
||||
}
|
||||
|
||||
override fun onBusLineTasks(lineTaskInfo: List<BusQueryLineTaskResponse.Result>, position: Int, autoRefresh:Boolean) {
|
||||
val result = mAdapter.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 == mAdapter.itemCount - 1 || position == mAdapter.itemCount - 2) && mAdapter.itemCount > 6
|
||||
switch_line_rv.smoothScrollToPosition(position)
|
||||
}else if(lineTaskInfo.isEmpty()){
|
||||
mAdapter.notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun refreshDate(formatLongToString: String?) {
|
||||
|
||||
@@ -2,25 +2,14 @@ package com.mogo.och.weaknet.ui.switchline
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
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.bean.WaitUploadLine
|
||||
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.EventModel
|
||||
import com.mogo.och.weaknet.model.OrderModel
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -33,16 +22,14 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
|
||||
private var viewCallback:SwtichLineViewCallback?=null
|
||||
|
||||
private var subscribe: Disposable? = null
|
||||
|
||||
override fun onCleared() {
|
||||
RxUtils.disposeSubscribe(subscribe)
|
||||
BusLineModel.setBusLinesCallback(null)
|
||||
BusLineModel.setBusLinesCallback(TAG,null)
|
||||
}
|
||||
|
||||
fun setDistanceCallback(viewCallback:SwtichLineViewCallback){
|
||||
this.viewCallback = viewCallback
|
||||
BusLineModel.setBusLinesCallback(this)
|
||||
BusLineModel.setBusLinesCallback(TAG,this)
|
||||
}
|
||||
|
||||
fun queryBusLines() {
|
||||
@@ -60,23 +47,6 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
BusLineModel.refreshTask()
|
||||
}
|
||||
|
||||
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 queryBusRoutes() {
|
||||
OrderModel.queryBusRoutes()
|
||||
}
|
||||
@@ -85,12 +55,6 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
fun startTaskState(success: Boolean)
|
||||
fun onBusLinesChange(data: MutableList<BusQueryLinesResponse.Result>?)
|
||||
fun onChangeLineIdSuccess()
|
||||
fun onBusLineTasks(
|
||||
lineTaskInfo: List<BusQueryLineTaskResponse.Result>,
|
||||
position: Int,
|
||||
autoRefresh: Boolean
|
||||
)
|
||||
|
||||
fun refreshDate(formatLongToString: String?)
|
||||
}
|
||||
|
||||
@@ -104,17 +68,9 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
},ThreadUtils.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun onBusLineTasks(
|
||||
o: MutableList<BusQueryLineTaskResponse.Result>,
|
||||
position: Int,
|
||||
autoRefresh: Boolean
|
||||
) {
|
||||
viewCallback?.onBusLineTasks(o,position,autoRefresh)
|
||||
}
|
||||
|
||||
override fun onRefreshSuccess(currentTimeStamp: Long) {
|
||||
viewCallback?.refreshDate(
|
||||
DateTimeUtil.formatLongToString(currentTimeStamp, DateTimeUtil.yyyy_MM_dd_HH_mm_ss)
|
||||
DateTimeUtil.formatLongToString(currentTimeStamp, DateTimeUtil.HH_mm_ss)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
private fun initDatas() {
|
||||
viewModel?.queryBusLines()
|
||||
}
|
||||
|
||||
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)
|
||||
initDatas()
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
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 queryBusLines() {
|
||||
BusLineModel.queryBusLines()
|
||||
}
|
||||
|
||||
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!!)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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 com.mogo.och.weaknet.ui.switchline.SwitchLineView
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import kotlin.math.abs
|
||||
@@ -63,21 +64,8 @@ object RunningTaskManager : LifecycleEventObserver{
|
||||
* 展示BadCase配置页面
|
||||
*/
|
||||
fun showSwitchLineWindow(context: Context) {
|
||||
val badCaseConfigView = SwitchLineView(context)
|
||||
badCaseConfigView.setOnClickListener(object : SwitchLineView.ClickListener {
|
||||
override fun onClose() {
|
||||
hideFloat?.invoke()
|
||||
hideFloat = null
|
||||
}
|
||||
})
|
||||
enqueuePop(
|
||||
badCaseConfigView,
|
||||
AutoSizeUtils.dp2px(context, 960f),
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
key = "BadCaseConfigView"
|
||||
).also {
|
||||
hideFloat = it
|
||||
}
|
||||
val badCaseConfigView = SwitchBizView(context)
|
||||
|
||||
}
|
||||
|
||||
override fun onStateChanged(source: LifecycleOwner, event: Event) {
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
BIN
OCH/shuttle/driver_weaknet/src/main/res/drawable-nodpi/bus_biz_bg.png
Executable file
|
After Width: | Height: | Size: 310 KiB |
BIN
OCH/shuttle/driver_weaknet/src/main/res/drawable-nodpi/bus_biz_bg_header.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OCH/shuttle/driver_weaknet/src/main/res/drawable-nodpi/bus_line_task_arrow.png
Normal file → Executable file
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 137 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 521 B |
|
After Width: | Height: | Size: 610 B |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
OCH/shuttle/driver_weaknet/src/main/res/drawable-nodpi/shuttle_refresh_task.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
OCH/shuttle/driver_weaknet/src/main/res/drawable-nodpi/shuttle_weak_empty.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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" />
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.mogo.och.weaknet.ui.loading.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"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
@@ -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.ui.loading.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>
|
||||
@@ -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>
|
||||
@@ -49,9 +49,16 @@
|
||||
<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_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>
|
||||
|
||||
@@ -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,6 +20,7 @@
|
||||
<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>
|
||||
|
||||
@@ -274,7 +274,6 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
val endStation = MogoLocation()
|
||||
endStation.longitude = curTaskAndOrder.endSite!!.gcjLon
|
||||
endStation.latitude = curTaskAndOrder.endSite!!.gcjLat
|
||||
LineManager.setLineInfo(LineInfo(result.lineId,""))
|
||||
TrajectoryAndDistanceManager.setStationPoint(
|
||||
startStation,
|
||||
endStation,
|
||||
|
||||
@@ -1119,6 +1119,9 @@ object TaxiTaskModel {
|
||||
data?.data?.also {
|
||||
mTaskTrajectoryList.addAll(it)
|
||||
mCurrentTaskTrajectory = it.first { currentTaskLineId == it.lineId }
|
||||
mCurrentTaskTrajectory?.let {traj->
|
||||
LineManager.setLineInfo(LineInfo(traj.lineId,traj.lineName))
|
||||
}
|
||||
}
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
@@ -1304,7 +1307,6 @@ object TaxiTaskModel {
|
||||
val endStation = MogoLocation()
|
||||
endStation.longitude = curTaskAndOrder.endSite!!.gcjLon
|
||||
endStation.latitude = curTaskAndOrder.endSite!!.gcjLat
|
||||
LineManager.setLineInfo(LineInfo(curTaskAndOrder.lineId,""))
|
||||
TrajectoryAndDistanceManager.setStationPoint(
|
||||
startStation,
|
||||
endStation,
|
||||
|
||||
@@ -1028,6 +1028,7 @@
|
||||
<dimen name="dp_1000">1000dp</dimen>
|
||||
<dimen name="dp_1003">1003dp</dimen>
|
||||
<dimen name="dp_1017">1017dp</dimen>
|
||||
<dimen name="dp_1051">1051dp</dimen>
|
||||
<dimen name="dp_1055">1055dp</dimen>
|
||||
<dimen name="dp_1090">1090dp</dimen>
|
||||
<dimen name="dp_1092">1092dp</dimen>
|
||||
|
||||