[charter]
[3.2.0] [选择线路从view拆到fragment]
This commit is contained in:
@@ -1,21 +1,185 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.bean.LoopInfo
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoListResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
|
||||
import com.mogo.och.bus.passenger.ui.M1OrderFragment
|
||||
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
class BusPassengerFunctionOrderPresenter(view: M1OrderFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<M1OrderFragment?>(view), IOrderStatusChangeListener {
|
||||
|
||||
companion object{
|
||||
|
||||
const val TAGLINELOOP = "LineSiteViewLineLoop"
|
||||
const val TAG = "BusPassengerFunctionOrderPresenter"
|
||||
}
|
||||
|
||||
// 成功提交给后台得线路
|
||||
private var checkLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 成功提交给后台得终点站点
|
||||
private var checkSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 下一个站点
|
||||
private var currentSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 向司机端端提交的临时线路
|
||||
private var tempCheckLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 向司机端临时提交的终点站点
|
||||
private var tempCheckSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
private var tempCheckLineIsSubmit = false
|
||||
private var isChangeIngLineAndSite = false
|
||||
|
||||
|
||||
|
||||
private var subscribeSelectLine: Disposable? = null
|
||||
private var subscribeSelectSite: Disposable? = null
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG,this)
|
||||
CallerTelematicListenerManager.addListener(TAG, msgReceived)
|
||||
|
||||
val hasSetLineAndSite = CharterPassengerModel.hasSetLineAndSite()
|
||||
if (hasSetLineAndSite != null) {// 已经设置了线路和站点
|
||||
checkLine = hasSetLineAndSite.first
|
||||
checkSite = hasSetLineAndSite.second
|
||||
resetData()
|
||||
} else {
|
||||
queryLineList()
|
||||
mView?.setEnableLineStatus(true)
|
||||
mView?.setEnableSiteStatus(false)
|
||||
mView?.onlyChangeSite(false)
|
||||
mView?.setSiteAdapterEnable(false)
|
||||
mView?.setSwitchEnable(false)
|
||||
isChangeIngLineAndSite = false
|
||||
}
|
||||
}
|
||||
|
||||
fun lineReset(){
|
||||
resetData()
|
||||
tempCheckLine = null
|
||||
}
|
||||
fun siteReset(){
|
||||
resetData()
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据
|
||||
*/
|
||||
fun resetData() {
|
||||
if(checkLine==null){// 没有提交线路
|
||||
queryLineList()
|
||||
mView?.setEnableLineStatus(true)
|
||||
mView?.setEnableSiteStatus(false)
|
||||
mView?.onlyChangeSite(false)
|
||||
mView?.setSiteAdapterEnable(false)
|
||||
}else{
|
||||
checkLine?.let {
|
||||
mView?.setEnableLineStatus(false)
|
||||
mView?.setEnableSiteStatus(false)
|
||||
mView?.onlyChangeSite(false)
|
||||
mView?.setSiteAdapterEnable(true)
|
||||
isChangeIngLineAndSite = true
|
||||
mView?.lineAdapterSubmit(it)
|
||||
checkLine?.let {
|
||||
querySitesByLineId(it.lineId.toString(),false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun querySitesByLineId(lineId: String,isSelect:Boolean) {
|
||||
BusPassengerServiceManager.queryLineSiteList(
|
||||
context,
|
||||
lineId,
|
||||
object : OchCommonServiceCallback<SiteInfoResponse> {
|
||||
override fun onSuccess(data: SiteInfoResponse?) {
|
||||
if (data?.data == null) return
|
||||
mView?.siteAdapterSetData(data.data)
|
||||
if (data.data.isNotEmpty()) {
|
||||
// 计算当前站点是那个
|
||||
val calculateCurrentSite =
|
||||
CharterPassengerModel.calculateCurrentSite(data.data)
|
||||
val first = calculateCurrentSite.first// 可用站点
|
||||
if(first<0){
|
||||
// 所有站点不可用
|
||||
currentSite = data.data[data.data.size-1]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
mView?.siteAdapterEnableIndex(data.data.size-1)
|
||||
}else{
|
||||
//
|
||||
val index = if(first==0) {
|
||||
0
|
||||
}else if (first <= data.data.size-1) {
|
||||
first-1
|
||||
} else {
|
||||
data.data.size - 1
|
||||
}
|
||||
currentSite = data.data[index]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
mView?.siteAdapterEnableIndex(index)
|
||||
}
|
||||
if(isSelect){
|
||||
data.data.last().isCheck = true
|
||||
tempCheckSite = data.data.last()
|
||||
}else{
|
||||
data.data.forEach {
|
||||
if (it.siteId == checkSite?.siteId) {
|
||||
it.isCheck = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
ToastUtils.showShort("查询站点失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun queryLineList() {
|
||||
BusPassengerServiceManager.queryLineList(context, object :
|
||||
OchCommonServiceCallback<LineInfoListResponse> {
|
||||
override fun onSuccess(data: LineInfoListResponse?) {
|
||||
if (data?.data == null) return
|
||||
mView?.lineAdapterSetData(data.data)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtils.showShort("查询线路失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onResume(owner: LifecycleOwner) {
|
||||
@@ -25,10 +189,264 @@ class BusPassengerFunctionOrderPresenter(view: M1OrderFragment?) :
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "onDestroy")
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG,null)
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收司机屏反馈信息
|
||||
*/
|
||||
val msgReceived = object : IReceivedMsgListener {
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
UiThreadHandler.post {
|
||||
if (type == OchCommonConst.BUSINESS_STRING) {
|
||||
val msg = GsonUtils.fromJson(
|
||||
String(byteArray),
|
||||
ChangeDestMsg::class.java
|
||||
) as ChangeDestMsg
|
||||
if (msg.type == DPMsgType.TYPE_CHANGE_DEST.type) {
|
||||
if (msg.destSiteId == 0) {
|
||||
if (msg.isConfirmed) {
|
||||
ToastUtils.showShort("线路确定")
|
||||
mView?.setEnableLineStatus(false)
|
||||
mView?.setEnableSiteStatus(true)
|
||||
mView?.onlyChangeSite(false)
|
||||
mView?.setSiteAdapterEnable(true)
|
||||
mView?.setSwitchEnable(false)
|
||||
tempCheckLineIsSubmit = true
|
||||
tempCheckLine?.let {
|
||||
mView?.lineAdapterSubmit(it)
|
||||
}
|
||||
} else {
|
||||
tempCheckLineIsSubmit = false
|
||||
ToastUtils.showShort("司机端拒绝请重新选择")
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
mView?.endAni()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "endAni1111")
|
||||
} else {
|
||||
if (msg.isConfirmed) {
|
||||
ToastUtils.showShort("站点确定")
|
||||
mView?.setEnableLineStatus(false)
|
||||
mView?.setEnableSiteStatus(true)
|
||||
mView?.onlyChangeSite(false)
|
||||
mView?.setSiteAdapterEnable(true)
|
||||
mView?.setSwitchEnable(true)
|
||||
checkLine = tempCheckLine
|
||||
checkSite = tempCheckSite
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
tempCheckLineIsSubmit = false
|
||||
checkLine?.let {
|
||||
mView?.lineAdapterSubmit(it)
|
||||
}
|
||||
mView?.go2StartCar()
|
||||
CharterPassengerModel.queryOrder()
|
||||
CharterPassengerModel.cleanbroadcastListInfo()
|
||||
} else {
|
||||
tempCheckLineIsSubmit = true
|
||||
ToastUtils.showShort("司机端拒绝请重新选择")
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
}
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun lineSubmit(){
|
||||
if (tempCheckLine == null) {
|
||||
ToastUtils.showLong("请选择线路")
|
||||
return
|
||||
}
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return
|
||||
}
|
||||
tempCheckLine?.let {
|
||||
val msg = ChangeDestMsg(
|
||||
it.lineId!!.toInt(),
|
||||
it.name!!,
|
||||
0,
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
mView?.startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
subscribeSelectLine= RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
mView?.endAni()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "endAni3333")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun siteSubmit(){
|
||||
if (!tempCheckLineIsSubmit) {
|
||||
ToastUtils.showLong("请选择站点")
|
||||
return
|
||||
}
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return
|
||||
}
|
||||
tempCheckSite?.let { lineInfo ->
|
||||
tempCheckSite?.let { siteInfo ->
|
||||
val msg = ChangeDestMsg(
|
||||
lineInfo.lineId!!.toInt(),
|
||||
lineInfo.lineName!!,
|
||||
currentSite!!.siteId!!.toInt(),
|
||||
currentSite!!.siteName!!,
|
||||
siteInfo.siteId!!.toInt(),
|
||||
siteInfo.siteName!!,
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
mView?.startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
mView?.endAni()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "endAni444")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onlySiteSubmit(){
|
||||
tempCheckSite?.let { siteInfo ->
|
||||
val msg = ChangeDestMsg(
|
||||
siteInfo.lineId!!.toInt(),
|
||||
siteInfo.lineName!!,
|
||||
currentSite!!.siteId!!.toInt(),
|
||||
currentSite!!.siteName!!,
|
||||
siteInfo.siteId!!.toInt(),
|
||||
siteInfo.siteName!!,
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
mView?.startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
mView?.endAni()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "endAni555")
|
||||
|
||||
}
|
||||
}
|
||||
private fun checkServerStatus() {
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showShort("断开和司机端连接、请联系安全员")
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
mView?.endAni()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "endAni666")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStatusChange(currentStatus: OrderStatusEnum) {
|
||||
mView?.setViewByOrderStatus(currentStatus)
|
||||
}
|
||||
|
||||
fun switchLine() {
|
||||
val gnssSpeed =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed
|
||||
if (gnssSpeed < 0.5) {
|
||||
// TODO: 自驾中 需要 靠边停车中、到站
|
||||
// TODO: 没有自驾中 需要 靠边停车中、到站
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
// 可以切换路径
|
||||
isChangeIngLineAndSite = false
|
||||
mView?.onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
mView?.setEnableLineStatus(true)
|
||||
mView?.setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
isChangeIngLineAndSite = false
|
||||
mView?.onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
mView?.setEnableLineStatus(true)
|
||||
mView?.setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 自动驾驶中
|
||||
when (OCHPlanningStopSideStatusManager.stopSiteStatus) {
|
||||
OCHPlanningStopSideStatusManager.Status.EndingSuccess -> {
|
||||
isChangeIngLineAndSite = false
|
||||
mView?.onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
mView?.setEnableLineStatus(true)
|
||||
mView?.setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
else ->{
|
||||
ToastUtils.showShort("自动驾驶中无法切换线路")
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastUtils.showShort("因车辆正在平行驾驶中无法切换线路")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("请停车后再修改目的地~")
|
||||
}
|
||||
}
|
||||
|
||||
fun checkLineClick(lineInfo: LineInfoResponse.LineInfo) {
|
||||
tempCheckLine = lineInfo
|
||||
querySitesByLineId(lineInfo.lineId.toString(),true)
|
||||
}
|
||||
|
||||
fun checkSiteClick(siteInfo: SiteInfoResponse.SiteInfo) {
|
||||
tempCheckSite = siteInfo
|
||||
if(isChangeIngLineAndSite) {
|
||||
checkSite?.let {
|
||||
if (it.siteId == siteInfo.siteId) {
|
||||
mView?.onlyChangeSite(false)
|
||||
} else {
|
||||
mView?.onlyChangeSite(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,27 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionOrderPresenter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderLineItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderSiteItemAdapter
|
||||
import com.mogo.och.bus.passenger.view.BottomDecoration
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
* @author: yangyakun
|
||||
@@ -15,7 +30,24 @@ import kotlinx.android.synthetic.main.m1_order_fragment.*
|
||||
class M1OrderFragment :
|
||||
MvpFragment<M1OrderFragment?, BusPassengerFunctionOrderPresenter?>() {
|
||||
|
||||
private var changeCheck: M1ContainFragment.ChangeCheck?=null
|
||||
private var changeCheck: M1ContainFragment.ChangeCheck? = null
|
||||
|
||||
|
||||
private lateinit var lineAdapter: OrderLineItemAdapter
|
||||
private lateinit var siteAdapter: OrderSiteItemAdapter
|
||||
|
||||
val lineList = mutableListOf<LineInfoResponse.LineInfo>()
|
||||
val siteList = mutableListOf<SiteInfoResponse.SiteInfo>()
|
||||
|
||||
|
||||
|
||||
private val loadingAni =
|
||||
ObjectAnimator.ofFloat(iv_loading_wait_driver, "rotation", 0f, 90f, 180f, 270f, 360f)
|
||||
.apply {
|
||||
repeatCount = -1
|
||||
interpolator = LinearInterpolator()
|
||||
duration = 1000
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.m1_order_fragment
|
||||
@@ -26,10 +58,136 @@ class M1OrderFragment :
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
lsv_line_site.setchangeCheck(this.changeCheck)
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "initViews")
|
||||
lineAdapter = OrderLineItemAdapter(requireContext(), lineList)
|
||||
siteAdapter = OrderSiteItemAdapter(requireContext(), siteList)
|
||||
loadingAni.target = iv_loading_wait_driver
|
||||
rlv_line_list.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rlv_line_list.addItemDecoration(
|
||||
BottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 60f)
|
||||
)
|
||||
)
|
||||
rlv_line_list.adapter = lineAdapter
|
||||
|
||||
rv_site_list.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rv_site_list.addItemDecoration(
|
||||
BottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 60f)
|
||||
)
|
||||
)
|
||||
rv_site_list.adapter = siteAdapter
|
||||
|
||||
initListener()
|
||||
|
||||
}
|
||||
|
||||
fun setViewByOrderStatus(currentStatus: OrderStatusEnum){
|
||||
private fun initListener() {
|
||||
lineAdapter.checkChangeListener = object : OrderLineItemAdapter.CheckListener {
|
||||
override fun onCheckListener(lineInfo: LineInfoResponse.LineInfo) {
|
||||
mPresenter?.checkLineClick(lineInfo)
|
||||
siteAdapter.clearCheck()
|
||||
}
|
||||
}
|
||||
siteAdapter.checkChangeListener = object : OrderSiteItemAdapter.CheckListener {
|
||||
override fun onCheckListener(siteInfo: SiteInfoResponse.SiteInfo) {
|
||||
// 设置临时选中的
|
||||
mPresenter?.checkSiteClick(siteInfo)
|
||||
}
|
||||
|
||||
}
|
||||
tv_line_cancle.onClick {
|
||||
mPresenter?.lineReset()
|
||||
}
|
||||
tv_site_cancle.onClick {
|
||||
mPresenter?.siteReset()
|
||||
}
|
||||
tv_line_submit.onClick {
|
||||
mPresenter?.lineSubmit()
|
||||
}
|
||||
tv_site_submit.onClick {
|
||||
mPresenter?.siteSubmit()
|
||||
}
|
||||
tv_site_only_submit.onClick {
|
||||
// 线路不换只换站点
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return@onClick
|
||||
}
|
||||
mPresenter?.onlySiteSubmit()
|
||||
}
|
||||
tv_loading_wait_driver_title.onClick {
|
||||
endAni()
|
||||
}
|
||||
|
||||
tv_switch_line.onClick {
|
||||
mPresenter?.switchLine()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置是否可用进行选择线路
|
||||
*/
|
||||
fun setEnableLineStatus(enable: Boolean) {
|
||||
if (enable) {
|
||||
g_line_submit_group.visibility = View.VISIBLE
|
||||
lineAdapter.setEnable(true)
|
||||
} else {
|
||||
g_line_submit_group.visibility = View.GONE
|
||||
lineAdapter.setEnable(false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否可用选择站点
|
||||
*/
|
||||
fun setEnableSiteStatus(cancleAndSubmit: Boolean) {
|
||||
if (cancleAndSubmit) {
|
||||
g_side_cancle_submit_group.visibility = View.VISIBLE
|
||||
} else {
|
||||
g_side_cancle_submit_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun onlyChangeSite(submit: Boolean) {
|
||||
if (submit) {
|
||||
g_side_submit_group.visibility = View.VISIBLE
|
||||
} else {
|
||||
g_side_submit_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun setSiteAdapterEnable(enable: Boolean) {
|
||||
if (enable) {
|
||||
siteAdapter.setEnable(true)
|
||||
} else {
|
||||
siteAdapter.setEnable(false)
|
||||
}
|
||||
}
|
||||
|
||||
fun setSwitchEnable(enable: Boolean) {
|
||||
tv_switch_line.isEnabled = enable
|
||||
}
|
||||
|
||||
fun startAni() {
|
||||
g_lines_sites_data.visibility = View.GONE
|
||||
g_loading_group.visibility = View.VISIBLE
|
||||
if (!loadingAni.isRunning) {
|
||||
loadingAni.start()
|
||||
}
|
||||
}
|
||||
|
||||
fun endAni() {
|
||||
UiThreadHandler.post {
|
||||
g_lines_sites_data.visibility = View.VISIBLE
|
||||
g_loading_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun setViewByOrderStatus(currentStatus: OrderStatusEnum) {
|
||||
when (currentStatus) {
|
||||
OrderStatusEnum.NoOrderUnuse -> {
|
||||
// 无订单页面
|
||||
@@ -52,13 +210,40 @@ class M1OrderFragment :
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun go2StartCar() {
|
||||
changeCheck?.changeChange()
|
||||
}
|
||||
|
||||
override fun createPresenter(): BusPassengerFunctionOrderPresenter {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "createPresenter")
|
||||
return BusPassengerFunctionOrderPresenter(this)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
loadingAni.cancel()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "onDestroyView")
|
||||
}
|
||||
|
||||
fun lineAdapterSubmit(lineInfo: LineInfoResponse.LineInfo) {
|
||||
lineAdapter.submitLine(lineInfo)
|
||||
}
|
||||
|
||||
fun lineAdapterSetData(lineInfo: List<LineInfoResponse.LineInfo>) {
|
||||
lineAdapter.setDataList(lineInfo)
|
||||
}
|
||||
|
||||
fun siteAdapterSetData(siteInfo: List<SiteInfoResponse.SiteInfo>) {
|
||||
siteAdapter.setDataList(siteInfo)
|
||||
}
|
||||
fun siteAdapterEnableIndex(index: Int) {
|
||||
siteAdapter.setEnableIndex(index)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "BusPassengerFunctionOrderFragment"
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(changeCheck: M1ContainFragment.ChangeCheck): M1OrderFragment {
|
||||
val args = Bundle()
|
||||
|
||||
@@ -1,572 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui.view
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.LoopInfo
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoListResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
|
||||
import com.mogo.och.bus.passenger.ui.M1ContainFragment
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderLineItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderSiteItemAdapter
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.bus.passenger.view.BottomDecoration
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
|
||||
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.m1_order_lineside.view.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class LineSiteView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "LineSiteView"
|
||||
const val TAGLINELOOP = "LineSiteViewLineLoop"
|
||||
}
|
||||
|
||||
// 成功提交给后台得线路
|
||||
private var checkLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 成功提交给后台得终点站点
|
||||
private var checkSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 下一个站点
|
||||
private var currentSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 向司机端端提交的临时线路
|
||||
private var tempCheckLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 向司机端临时提交的终点站点
|
||||
private var tempCheckSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
private var tempCheckLineIsSubmit = false
|
||||
private var isChangeIngLineAndSite = false
|
||||
|
||||
|
||||
private val lineList = mutableListOf<LineInfoResponse.LineInfo>()
|
||||
private val siteList = mutableListOf<SiteInfoResponse.SiteInfo>()
|
||||
|
||||
private var lineAdapter: OrderLineItemAdapter
|
||||
private var siteAdapter: OrderSiteItemAdapter
|
||||
|
||||
private var gnssSpeed = 0.0
|
||||
|
||||
private val loadingAni =
|
||||
ObjectAnimator.ofFloat(iv_loading_wait_driver, "rotation", 0f, 90f, 180f, 270f, 360f)
|
||||
.apply {
|
||||
repeatCount = -1
|
||||
interpolator = LinearInterpolator()
|
||||
duration = 1000
|
||||
}
|
||||
private var changeCheck: M1ContainFragment.ChangeCheck?=null
|
||||
private var subscribeSelectLine: Disposable? = null
|
||||
private var subscribeSelectSite: Disposable? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_order_lineside, this, true)
|
||||
lineAdapter = OrderLineItemAdapter(context, lineList)
|
||||
siteAdapter = OrderSiteItemAdapter(context, siteList)
|
||||
loadingAni.target = iv_loading_wait_driver
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
rlv_line_list.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rlv_line_list.addItemDecoration(
|
||||
BottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 60f)
|
||||
)
|
||||
)
|
||||
rlv_line_list.adapter = lineAdapter
|
||||
|
||||
rv_site_list.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rv_site_list.addItemDecoration(
|
||||
BottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 60f)
|
||||
)
|
||||
)
|
||||
rv_site_list.adapter = siteAdapter
|
||||
|
||||
val hasSetLineAndSite = CharterPassengerModel.hasSetLineAndSite()
|
||||
if (hasSetLineAndSite != null) {// 已经设置了线路和站点
|
||||
checkLine = hasSetLineAndSite.first
|
||||
checkSite = hasSetLineAndSite.second
|
||||
lineList.clear()
|
||||
resetData()
|
||||
} else {
|
||||
queryLineList()
|
||||
setEnableLineStatus(true)
|
||||
setEnableSiteStatus(false)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(false)
|
||||
setSwitchEnable(false)
|
||||
isChangeIngLineAndSite = false
|
||||
}
|
||||
|
||||
initListener()
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据
|
||||
*/
|
||||
private fun resetData() {
|
||||
if(checkLine==null){// 没有提交线路
|
||||
queryLineList()
|
||||
setEnableLineStatus(true)
|
||||
setEnableSiteStatus(false)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(false)
|
||||
}else{
|
||||
checkLine?.let {
|
||||
setEnableLineStatus(false)
|
||||
setEnableSiteStatus(false)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(true)
|
||||
isChangeIngLineAndSite = true
|
||||
lineAdapter.submitLine(it)
|
||||
checkLine?.let {
|
||||
querySitesByLineId(it.lineId.toString(),false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否可用进行选择线路
|
||||
*/
|
||||
private fun setEnableLineStatus(enable: Boolean) {
|
||||
if (enable) {
|
||||
g_line_submit_group.visibility = View.VISIBLE
|
||||
lineAdapter.setEnable(true)
|
||||
} else {
|
||||
g_line_submit_group.visibility = View.GONE
|
||||
lineAdapter.setEnable(false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否可用选择站点
|
||||
*/
|
||||
private fun setEnableSiteStatus(cancleAndSubmit: Boolean) {
|
||||
if (cancleAndSubmit) {
|
||||
g_side_cancle_submit_group.visibility = View.VISIBLE
|
||||
} else {
|
||||
g_side_cancle_submit_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun onlyChangeSite(submit:Boolean){
|
||||
if (submit) {
|
||||
g_side_submit_group.visibility = View.VISIBLE
|
||||
} else {
|
||||
g_side_submit_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun setSiteAdapterEnable(enable: Boolean){
|
||||
if(enable){
|
||||
siteAdapter.setEnable(true)
|
||||
}else{
|
||||
siteAdapter.setEnable(false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
lineAdapter.checkChangeListener = object : OrderLineItemAdapter.CheckListener {
|
||||
override fun onCheckListener(lineInfo: LineInfoResponse.LineInfo) {
|
||||
tempCheckLine = lineInfo
|
||||
querySitesByLineId(lineInfo.lineId.toString(),true)
|
||||
siteAdapter.clearCheck()
|
||||
}
|
||||
}
|
||||
siteAdapter.checkChangeListener = object : OrderSiteItemAdapter.CheckListener {
|
||||
override fun onCheckListener(siteInfo: SiteInfoResponse.SiteInfo) {
|
||||
// 设置临时选中的
|
||||
tempCheckSite = siteInfo
|
||||
if(isChangeIngLineAndSite) {
|
||||
checkSite?.let {
|
||||
if (it.siteId == siteInfo.siteId) {
|
||||
onlyChangeSite(false)
|
||||
} else {
|
||||
onlyChangeSite(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
tv_line_cancle.onClick {
|
||||
resetData()
|
||||
tempCheckLine = null
|
||||
}
|
||||
tv_site_cancle.onClick {
|
||||
resetData()
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
}
|
||||
tv_line_submit.onClick {
|
||||
if (tempCheckLine == null) {
|
||||
ToastUtils.showLong("请选择线路")
|
||||
return@onClick
|
||||
}
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return@onClick
|
||||
}
|
||||
tempCheckLine?.let {
|
||||
val msg = ChangeDestMsg(
|
||||
it.lineId!!.toInt(),
|
||||
it.name!!,
|
||||
0,
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
subscribeSelectLine= RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
}
|
||||
tv_site_submit.onClick {
|
||||
if (!tempCheckLineIsSubmit) {
|
||||
ToastUtils.showLong("请选择站点")
|
||||
return@onClick
|
||||
}
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return@onClick
|
||||
}
|
||||
tempCheckSite?.let { lineInfo ->
|
||||
tempCheckSite?.let { siteInfo ->
|
||||
val msg = ChangeDestMsg(
|
||||
lineInfo.lineId!!.toInt(),
|
||||
lineInfo.lineName!!,
|
||||
currentSite!!.siteId!!.toInt(),
|
||||
currentSite!!.siteName!!,
|
||||
siteInfo.siteId!!.toInt(),
|
||||
siteInfo.siteName!!,
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
}
|
||||
tv_site_only_submit.onClick {
|
||||
// 线路不换只换站点
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return@onClick
|
||||
}
|
||||
tempCheckSite?.let { siteInfo ->
|
||||
val msg = ChangeDestMsg(
|
||||
siteInfo.lineId!!.toInt(),
|
||||
siteInfo.lineName!!,
|
||||
currentSite!!.siteId!!.toInt(),
|
||||
currentSite!!.siteName!!,
|
||||
siteInfo.siteId!!.toInt(),
|
||||
siteInfo.siteName!!,
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
tv_loading_wait_driver_title.onClick {
|
||||
endAni()
|
||||
}
|
||||
|
||||
CallerTelematicListenerManager.addListener(TAG, msgReceived)
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG) { location ->
|
||||
location?.let {
|
||||
gnssSpeed = it.gnssInfo.vehicleSpeed
|
||||
}
|
||||
}
|
||||
tv_switch_line.onClick {
|
||||
if (gnssSpeed < 0.5) {
|
||||
// TODO: 自驾中 需要 靠边停车中、到站
|
||||
// TODO: 没有自驾中 需要 靠边停车中、到站
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
// 可以切换路径
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 自动驾驶中
|
||||
when (OCHPlanningStopSideStatusManager.stopSiteStatus) {
|
||||
OCHPlanningStopSideStatusManager.Status.EndingSuccess -> {
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
else ->{
|
||||
ToastUtils.showShort("自动驾驶中无法切换线路")
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastUtils.showShort("因车辆正在平行驾驶中无法切换线路")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("请停车后再修改目的地~")
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun setSwitchEnable(enable: Boolean){
|
||||
tv_switch_line.isEnabled = enable
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收司机屏反馈信息
|
||||
*/
|
||||
val msgReceived = object : IReceivedMsgListener {
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
UiThreadHandler.post {
|
||||
if (type == OchCommonConst.BUSINESS_STRING) {
|
||||
val msg = GsonUtils.fromJson(
|
||||
String(byteArray),
|
||||
ChangeDestMsg::class.java
|
||||
) as ChangeDestMsg
|
||||
if (msg.type == DPMsgType.TYPE_CHANGE_DEST.type) {
|
||||
if (msg.destSiteId == 0) {
|
||||
if (msg.isConfirmed) {
|
||||
ToastUtils.showShort("线路确定")
|
||||
setEnableLineStatus(false)
|
||||
setEnableSiteStatus(true)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(true)
|
||||
setSwitchEnable(false)
|
||||
tempCheckLineIsSubmit = true
|
||||
tempCheckLine?.let {
|
||||
lineAdapter.submitLine(it)
|
||||
}
|
||||
} else {
|
||||
tempCheckLineIsSubmit = false
|
||||
ToastUtils.showShort("司机端拒绝请重新选择")
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
} else {
|
||||
if (msg.isConfirmed) {
|
||||
ToastUtils.showShort("站点确定")
|
||||
setEnableLineStatus(false)
|
||||
setEnableSiteStatus(true)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(true)
|
||||
setSwitchEnable(true)
|
||||
checkLine = tempCheckLine
|
||||
checkSite = tempCheckSite
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
tempCheckLineIsSubmit = false
|
||||
checkLine?.let {
|
||||
lineAdapter.submitLine(it)
|
||||
}
|
||||
go2StartCar()
|
||||
CharterPassengerModel.queryOrder()
|
||||
CharterPassengerModel.cleanbroadcastListInfo()
|
||||
} else {
|
||||
tempCheckLineIsSubmit = true
|
||||
ToastUtils.showShort("司机端拒绝请重新选择")
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
}
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun go2StartCar() {
|
||||
changeCheck?.changeChange()
|
||||
}
|
||||
|
||||
fun setchangeCheck(changeCheck: M1ContainFragment.ChangeCheck?){
|
||||
this.changeCheck = changeCheck
|
||||
}
|
||||
|
||||
private fun startAni() {
|
||||
g_lines_sites_data.visibility = View.GONE
|
||||
g_loading_group.visibility = View.VISIBLE
|
||||
if (!loadingAni.isRunning) {
|
||||
loadingAni.start()
|
||||
}
|
||||
}
|
||||
|
||||
private fun endAni() {
|
||||
UiThreadHandler.post {
|
||||
g_lines_sites_data.visibility = View.VISIBLE
|
||||
g_loading_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
loadingAni.cancel()
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG, null)
|
||||
|
||||
}
|
||||
|
||||
private fun queryLineList() {
|
||||
BusPassengerServiceManager.queryLineList(context, object :
|
||||
OchCommonServiceCallback<LineInfoListResponse> {
|
||||
override fun onSuccess(data: LineInfoListResponse?) {
|
||||
if (data?.data == null) return
|
||||
lineAdapter.setDataList(data.data)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtils.showShort("查询线路失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun checkServerStatus() {
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showShort("断开和司机端连接、请联系安全员")
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
|
||||
private fun querySitesByLineId(lineId: String,isSelect:Boolean) {
|
||||
BusPassengerServiceManager.queryLineSiteList(
|
||||
context,
|
||||
lineId,
|
||||
object : OchCommonServiceCallback<SiteInfoResponse> {
|
||||
override fun onSuccess(data: SiteInfoResponse?) {
|
||||
if (data?.data == null) return
|
||||
siteAdapter.setDataList(data.data)
|
||||
if (data.data.isNotEmpty()) {
|
||||
// 计算当前站点是那个
|
||||
val calculateCurrentSite =
|
||||
CharterPassengerModel.calculateCurrentSite(data.data)
|
||||
val first = calculateCurrentSite.first// 可用站点
|
||||
if(first<0){
|
||||
// 所有站点不可用
|
||||
currentSite = data.data[data.data.size-1]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
siteAdapter.setEnableIndex(data.data.size-1)
|
||||
}else{
|
||||
//
|
||||
val index = if(first==0) {
|
||||
0
|
||||
}else if (first <= data.data.size-1) {
|
||||
first-1
|
||||
} else {
|
||||
data.data.size - 1
|
||||
}
|
||||
currentSite = data.data[index]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
siteAdapter.setEnableIndex(index)
|
||||
}
|
||||
if(isSelect){
|
||||
data.data.last().isCheck = true
|
||||
tempCheckSite = data.data.last()
|
||||
}else{
|
||||
data.data.forEach {
|
||||
if (it.siteId == checkSite?.siteId) {
|
||||
it.isCheck = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
ToastUtils.showShort("查询站点失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
<?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="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- 订单主页面 -->
|
||||
|
||||
@@ -17,10 +18,242 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.53698">
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.LineSiteView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/lsv_line_site"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
<!-- 选择线路和站点页面 -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_line_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cl_side_list"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.35887">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line_title"
|
||||
android:text="浏览线路"
|
||||
android:textSize="@dimen/dp_26"
|
||||
android:textColor="@color/bus_p_m1_0f1e57"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_31"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_switch_line"
|
||||
android:text="切换"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textColor="@color/bus_p_m1_225eff"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_line_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_line_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:paddingEnd="@dimen/dp_31"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/m1_order_switch_line_enable"
|
||||
android:id="@+id/iv_switch_line_left"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_switch_line"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_switch_line"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_switch_line"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_16"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_line_list"
|
||||
android:background="@drawable/m1_order_line_shape"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_line_title"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_line_cancle_submit_bg"
|
||||
android:layout_width="@dimen/dp_275"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line_cancle"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_line_cancle_submit_guide"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_line_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_line_cancle_submit_guide"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_line_cancle_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_line_cancle_submit_guide"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_line_submit_group"
|
||||
app:constraint_referenced_ids="tv_line_submit,tv_line_cancle,iv_line_cancle_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_side_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_line_list"
|
||||
app:layout_constraintWidth_percent="0.64113">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_site_list"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_site_cancle_submit_bg"
|
||||
android:layout_width="@dimen/dp_375"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_site_cancle"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_site_cancle_submit_guide"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_site_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_side_cancle_submit_group"
|
||||
app:constraint_referenced_ids="tv_site_submit,tv_site_cancle,iv_site_cancle_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_site_submit_bg"
|
||||
android:layout_width="@dimen/dp_258"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_site_only_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_side_submit_group"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="tv_site_only_submit,iv_site_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_lines_sites_data"
|
||||
app:constraint_referenced_ids="cl_line_list,cl_side_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_loading_wait_driver"
|
||||
android:src="@drawable/bus_p_loading"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.372"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_71"
|
||||
android:layout_height="@dimen/dp_73"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_loading_wait_driver_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_loading_wait_driver"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_loading_wait_driver"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_loading_wait_driver"
|
||||
android:layout_marginTop="63dp"
|
||||
android:text="等待司机确认信息,请稍候…"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textColor="@color/bus_p_m1_4a5375"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_loading_group"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="iv_loading_wait_driver,tv_loading_wait_driver_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/m1_order_early_end"
|
||||
|
||||
@@ -1,238 +0,0 @@
|
||||
<?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="match_parent"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
<!-- 选择线路和站点页面 -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_line_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cl_side_list"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.35887">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line_title"
|
||||
android:text="浏览线路"
|
||||
android:textSize="@dimen/dp_26"
|
||||
android:textColor="@color/bus_p_m1_0f1e57"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_31"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_switch_line"
|
||||
android:text="切换"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textColor="@color/bus_p_m1_225eff"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_line_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_line_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:paddingEnd="@dimen/dp_31"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/m1_order_switch_line_enable"
|
||||
android:id="@+id/iv_switch_line_left"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_switch_line"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_switch_line"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_switch_line"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_16"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_line_list"
|
||||
android:background="@drawable/m1_order_line_shape"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_line_title"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_line_cancle_submit_bg"
|
||||
android:layout_width="@dimen/dp_275"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line_cancle"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_line_cancle_submit_guide"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_line_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_line_cancle_submit_guide"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_line_cancle_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_line_cancle_submit_guide"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_line_submit_group"
|
||||
app:constraint_referenced_ids="tv_line_submit,tv_line_cancle,iv_line_cancle_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_side_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_line_list"
|
||||
app:layout_constraintWidth_percent="0.64113">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_site_list"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_site_cancle_submit_bg"
|
||||
android:layout_width="@dimen/dp_375"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_site_cancle"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_site_cancle_submit_guide"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_site_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_side_cancle_submit_group"
|
||||
app:constraint_referenced_ids="tv_site_submit,tv_site_cancle,iv_site_cancle_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_site_submit_bg"
|
||||
android:layout_width="@dimen/dp_258"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_site_only_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_side_submit_group"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="tv_site_only_submit,iv_site_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_lines_sites_data"
|
||||
app:constraint_referenced_ids="cl_line_list,cl_side_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_loading_wait_driver"
|
||||
android:src="@drawable/bus_p_loading"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.372"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_71"
|
||||
android:layout_height="@dimen/dp_73"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_loading_wait_driver_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_loading_wait_driver"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_loading_wait_driver"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_loading_wait_driver"
|
||||
android:layout_marginTop="63dp"
|
||||
android:text="等待司机确认信息,请稍候…"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textColor="@color/bus_p_m1_4a5375"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_loading_group"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="iv_loading_wait_driver,tv_loading_wait_driver_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user