[6.9.0]
[fea] [taxi] [选择新的标定站点]
This commit is contained in:
@@ -122,6 +122,12 @@ object BizLoopManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun runInMainThreadDelay(delay:Long,function:Runnable){
|
||||
ThreadUtils.runOnUiThreadDelayed({
|
||||
function.run()
|
||||
},delay,ThreadUtils.MODE.QUEUE)
|
||||
}
|
||||
|
||||
fun runInIoThread(runable:Runnable){
|
||||
if(ThreadUtils.isMainThread()){
|
||||
ThreadUtils.getIoPool().submit(runable)
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.mogo.och.weaknet.ui.switchtask
|
||||
package com.mogo.och.common.module.wigets
|
||||
|
||||
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
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
|
||||
class TaskBottomDecoration(val distance: Int) : RecyclerView.ItemDecoration() {
|
||||
class TaskBottomDecoration(val distance: Int,val norDistance:Int) : RecyclerView.ItemDecoration() {
|
||||
|
||||
private val TAG = M_BUS + "TaskBottomDecoration"
|
||||
|
||||
@@ -42,6 +41,12 @@ class TaskBottomDecoration(val distance: Int) : RecyclerView.ItemDecoration() {
|
||||
} else {
|
||||
outRect.bottom = distance
|
||||
}
|
||||
}else if(layoutManager is LinearLayoutManager){
|
||||
if(pos==itemCount-1) {
|
||||
outRect.bottom = distance
|
||||
}else{
|
||||
outRect.bottom = norDistance
|
||||
}
|
||||
}
|
||||
//super.getItemOffsets(outRect, view, parent, state)
|
||||
}
|
||||
@@ -46,6 +46,6 @@
|
||||
<color name="common_3B3D44">#3B3D44</color>
|
||||
<color name="common_2E323A">#2E323A</color>
|
||||
<color name="common_ffffffff">#ffffffff</color>
|
||||
|
||||
<color name="common_2eacff">#2EACFF</color>
|
||||
|
||||
</resources>
|
||||
@@ -39,4 +39,6 @@
|
||||
<string name="common_dialog_confirm">确认</string>
|
||||
<string name="common_dialog_cancel">取消</string>
|
||||
|
||||
<string name="common_dialog_goback">返回</string>
|
||||
|
||||
</resources>
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.data.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -14,12 +15,15 @@ import java.util.Objects;
|
||||
*/
|
||||
public class BusStationBean {
|
||||
private int siteId;
|
||||
@SerializedName(value = "name",alternate = {"siteName"})
|
||||
private String name;
|
||||
private String nameKr;
|
||||
private int seq;
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
@SerializedName(value = "lon",alternate = {"wgs84Lon"})
|
||||
private double lon; //高精坐标
|
||||
@SerializedName(value = "lat",alternate = {"wgs84Lat"})
|
||||
private double lat; //高精坐标
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private boolean leaving;// 为出发false 出发true
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.mogo.och.data.bean;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 站点视频
|
||||
*/
|
||||
public class SiteIntroduce {
|
||||
private int type;
|
||||
private String url;
|
||||
|
||||
@@ -4,11 +4,12 @@ project.dependencies {
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
|
||||
} else {
|
||||
|
||||
if(isDriver()){
|
||||
implementation project.project(':OCH:offline:driver')
|
||||
}
|
||||
if (isCurrentDriver("C1")) {
|
||||
implementation project.project(':OCH:sweeper:driver')
|
||||
} else if (isCurrentDriver("B1")) {
|
||||
implementation project.project(':OCH:offline:driver')
|
||||
implementation project.project(':OCH:shuttle:driver_weaknet')
|
||||
} else if (isCurrentPassenger("B1")) {
|
||||
implementation project.project(':OCH:shuttle:passenger_weaknet')
|
||||
@@ -21,7 +22,6 @@ project.dependencies {
|
||||
} else if (isCurrentPassenger("M1")) {
|
||||
implementation project.project(':OCH:shuttle:passenger_weaknet')
|
||||
} else if (isCurrentDriver("B2")) {
|
||||
implementation project.project(':OCH:offline:driver')
|
||||
implementation project.project(':OCH:shuttle:driver_weaknet')
|
||||
} else if (isCurrentPassenger("B2")) {
|
||||
implementation project.project(':OCH:shuttle:passenger_weaknet')
|
||||
@@ -30,7 +30,6 @@ project.dependencies {
|
||||
} else if (isCurrentPassenger("T1T2")) {
|
||||
implementation project.project(':OCH:taxi:unmanned-passenger')
|
||||
} else if (isCurrentDriver("ALL")) {
|
||||
implementation project.project(':OCH:offline:driver')
|
||||
implementation project.project(':OCH:taxi:unmanned-driver')
|
||||
implementation project.project(':OCH:charter:driver')
|
||||
implementation project.project(':OCH:sweeper:driver')
|
||||
@@ -41,7 +40,6 @@ project.dependencies {
|
||||
implementation project.project(':OCH:shuttle:passenger_weaknet')
|
||||
|
||||
} else {
|
||||
implementation project.project(':OCH:offline:driver')
|
||||
implementation project.project(':OCH:charter:driver')
|
||||
implementation project.project(':OCH:charter:passenger')
|
||||
implementation project.project(':OCH:sweeper:driver')
|
||||
|
||||
@@ -68,7 +68,6 @@ class SwitchLineTaskAdapter(
|
||||
if(checkTask==task){
|
||||
checkTask = null
|
||||
}else {
|
||||
resetOther()
|
||||
mData.forEachIndexed { index, result ->
|
||||
if(checkTask == result){
|
||||
checkTask = null
|
||||
@@ -85,10 +84,6 @@ class SwitchLineTaskAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
private fun resetOther() {
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return mData.size
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.wigets.TaskBottomDecoration
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.data.db.bean.LineDataBean
|
||||
@@ -65,9 +66,7 @@ class SwitchTaskView: WindowRelativeLayout, SwtichTaskModel.SwtichLineViewCallba
|
||||
mAdapter = SwitchLineTaskAdapter(context,null, mutableListOf())
|
||||
rv_switch_task.setAdapter(mAdapter)
|
||||
rv_switch_task.addItemDecoration(
|
||||
TaskBottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 174f)
|
||||
)
|
||||
TaskBottomDecoration(AutoSizeUtils.dp2px(context, 174f),0)
|
||||
)
|
||||
|
||||
actv_submit_task.onClick {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.unmanned.taxi.bean
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -32,4 +33,13 @@ data class StartServiceRespBean(var data: Result?) : BaseData() {
|
||||
var wgs84Lon: Double,
|
||||
var wgs84Lat: Double
|
||||
)
|
||||
}
|
||||
|
||||
data class StartServiceRespBeans(var data:List<StartStationBean>):BaseData()
|
||||
|
||||
|
||||
data class StartStationBean(var distance2Current:Float):BusStationBean() {
|
||||
fun toResult(): StartServiceRespBean.Result {
|
||||
return StartServiceRespBean.Result(siteId.toLong(),name,gcjLat,gcjLon,lon,lat)
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import com.mogo.och.unmanned.taxi.bean.PrepareTaskRespBean
|
||||
import com.mogo.och.unmanned.taxi.bean.QueryCurrentTaskRespBean
|
||||
import com.mogo.och.unmanned.taxi.bean.StartServiceReqBean
|
||||
import com.mogo.och.unmanned.taxi.bean.StartServiceRespBean
|
||||
import com.mogo.och.unmanned.taxi.bean.StartServiceRespBeans
|
||||
import com.mogo.och.unmanned.taxi.bean.StartTaskReqBean
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.Body
|
||||
@@ -159,4 +160,12 @@ interface TaxiTaskWithOrderServiceApi {
|
||||
@Query("sn") sn: String? = OchSPManager.getSn()
|
||||
): Observable<QueryCarOrderByNoRespBean>
|
||||
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-taxi-cabin/api/business/v1/queryStartSiteListBySn")
|
||||
fun queryStartSiteListBySn(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = SharedPrefsMgr.getInstance().token,
|
||||
@Query("sn") sn: String? = OchSPManager.getSn()
|
||||
): Observable<StartServiceRespBeans>
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.network.interceptor.transformIoTry
|
||||
import com.mogo.och.common.module.network.interceptor.transformTry
|
||||
import com.mogo.och.data.taxi.QueryCarOrderByNoReqBean
|
||||
import com.mogo.och.data.taxi.QueryCarOrderByNoRespBean
|
||||
@@ -19,6 +20,7 @@ import com.mogo.och.unmanned.taxi.bean.PrepareTaskRespBean
|
||||
import com.mogo.och.unmanned.taxi.bean.QueryCurrentTaskRespBean
|
||||
import com.mogo.och.unmanned.taxi.bean.StartServiceReqBean
|
||||
import com.mogo.och.unmanned.taxi.bean.StartServiceRespBean
|
||||
import com.mogo.och.unmanned.taxi.bean.StartServiceRespBeans
|
||||
import com.mogo.och.unmanned.taxi.bean.StartTaskReqBean
|
||||
import com.mogo.och.unmanned.taxi.bean.TrajectoryListRespBean
|
||||
|
||||
@@ -158,7 +160,7 @@ object TaxiTaskWithOrderServiceManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务完成
|
||||
* 取消虚拟任务并暂停接单
|
||||
*/
|
||||
@JvmStatic
|
||||
fun resetInit(
|
||||
@@ -168,6 +170,17 @@ object TaxiTaskWithOrderServiceManager {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "orderCompleted"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询开始站点
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryStartSiteListBySn(
|
||||
context: Context, callback: OchCommonServiceCallback<StartServiceRespBeans>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.queryStartSiteListBySn().transformIoTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "orderCompleted"))
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
|
||||
@@ -51,6 +51,7 @@ import com.mogo.och.common.module.manager.socket.cloud.action.OperateAction2
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil.coordinateConverterWgsToGcjLocations
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
@@ -1163,12 +1164,7 @@ object TaxiTaskModel {
|
||||
return
|
||||
}
|
||||
}
|
||||
mDriveToNearestStationTask = data.data
|
||||
mLastArrivedSiteId = -1L //开始标定站点任务时, 到达站点标志位需复位
|
||||
mTaxiCarServiceCallback?.onCarStartServiceSuccess(
|
||||
mDriveToNearestStationTask,
|
||||
mCurrentTaskWithOrder
|
||||
)
|
||||
setCalibrationSite(data.data)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
@@ -1183,6 +1179,17 @@ object TaxiTaskModel {
|
||||
})
|
||||
}
|
||||
|
||||
fun setCalibrationSite(data: StartServiceRespBean.Result?) {
|
||||
BizLoopManager.runInMainThread{
|
||||
mDriveToNearestStationTask = data
|
||||
mLastArrivedSiteId = -1L //开始标定站点任务时, 到达站点标志位需复位
|
||||
mTaxiCarServiceCallback?.onCarStartServiceSuccess(
|
||||
mDriveToNearestStationTask,
|
||||
mCurrentTaskWithOrder
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 以当前订单为基础,开启自动驾驶
|
||||
*/
|
||||
@@ -1192,7 +1199,6 @@ object TaxiTaskModel {
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_OCH_TAXI_START_AUTOPILOT,
|
||||
paramIndexes = [-1]
|
||||
)
|
||||
|
||||
fun startAutopilotByClick() {
|
||||
//订单状态流转成功, 点击了开启自驾按钮, 启动自驾
|
||||
if (QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)) {
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.ItinerarySummaryDialog
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
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.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
@@ -51,6 +50,7 @@ import com.mogo.och.unmanned.taxi.ui.task.TaskUiIntent
|
||||
import com.mogo.och.unmanned.taxi.ui.task.TaskWithOrderUIState
|
||||
import com.mogo.och.unmanned.taxi.ui.task.TaxiTaskModel
|
||||
import com.mogo.och.unmanned.taxi.ui.task.cancleorder.CancleOrderView
|
||||
import com.mogo.och.unmanned.taxi.ui.task.itinerayswitch.ItinerarySwitchModel
|
||||
import com.mogo.och.unmanned.taxi.utils.TaskUtils
|
||||
//演练单标识
|
||||
import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.aciv_task_type_exercise
|
||||
@@ -75,6 +75,7 @@ import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_order
|
||||
import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.orderPhoneAndNum
|
||||
// 运营单标识
|
||||
import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.aciv_task_type_order
|
||||
import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_switch_site
|
||||
// 取消订单
|
||||
import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.cancelOrder
|
||||
import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.currentTaskStation
|
||||
@@ -103,6 +104,13 @@ import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.trajectory
|
||||
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
||||
/**
|
||||
* 1、标定单
|
||||
* 2、虚拟单
|
||||
* 3、运营单
|
||||
* 4、没有接单
|
||||
* 5、接单中拉去倒计时
|
||||
*/
|
||||
class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineViewCallback,
|
||||
View.OnClickListener, ICommonNaviChangedCallback {
|
||||
|
||||
@@ -125,6 +133,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
private var dialog: ItinerarySummaryDialog? = null
|
||||
|
||||
private var viewModel: ItineraryCurrentModel?=null
|
||||
private var viewModelSwitch: ItinerarySwitchModel?=null
|
||||
|
||||
private var fragment: LifecycleOwner?=null
|
||||
|
||||
@@ -202,6 +211,9 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
ViewModelProvider(it).get(ItineraryCurrentModel::class.java)
|
||||
}
|
||||
viewModel?.setDistanceCallback(this)
|
||||
viewModelSwitch = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(ItinerarySwitchModel::class.java)
|
||||
}
|
||||
initOnClickListener()
|
||||
initTaskDebugViewListener()
|
||||
initViewModelObserver()
|
||||
@@ -209,7 +221,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun initOnClickListener() {
|
||||
CallerLogger.d(TAG,"initOnClickListener")
|
||||
d(TAG,"initOnClickListener")
|
||||
naviToStart.setOnClickListener(this)
|
||||
naviToEnd.setOnClickListener(this)
|
||||
cancelTask.setOnClickListener(this)
|
||||
@@ -228,6 +240,9 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
actv_end_order.onClick {
|
||||
startOrEndService()
|
||||
}
|
||||
actv_switch_site.onClick {
|
||||
viewModelSwitch?.switchSite()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
@@ -278,7 +293,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
* 更新拉取任务倒计时
|
||||
*/
|
||||
private fun updatePrepareTaskDelayUI(millisInFuture: Long, isStart: Boolean) {
|
||||
CallerLogger.d(TAG,"updatePrepareTaskDelayUI")
|
||||
d(TAG,"updatePrepareTaskDelayUI")
|
||||
DebugView.printInfoMsg("距离任务获取还有 ${DateTimeUtil.second2MMSS(millisInFuture / 1000)}")
|
||||
if (!isStart) {
|
||||
prepareTaskCountdownTv.visibility = View.GONE
|
||||
@@ -328,7 +343,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
* 更新当前任务和订单信息
|
||||
*/
|
||||
private fun updateViewByCurrentTaskWithOrder(taskAndOrder: QueryCurrentTaskRespBean.Result?) {
|
||||
CallerLogger.d(TAG,"updateViewByCurrentTaskWithOrder")
|
||||
d(TAG,"updateViewByCurrentTaskWithOrder")
|
||||
if (taskAndOrder == null) return
|
||||
/**
|
||||
* 根据任务类型判断任务显示,
|
||||
@@ -383,7 +398,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
|
||||
// 第一个特殊任务 也是虚拟任务
|
||||
private fun updateViewByDriveToNearestStationTask(driveToNearestStationTask: StartServiceRespBean.Result?) {
|
||||
CallerLogger.d(TAG,"updateViewByDriveToNearestStationTask 标定单")
|
||||
d(TAG,"updateViewByDriveToNearestStationTask 标定单")
|
||||
if (driveToNearestStationTask == null) return
|
||||
initContainerView(true)
|
||||
// DriverToNearestStationTask 任务更新
|
||||
@@ -395,6 +410,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
startStationName.text = resources.getString(R.string.task_current_loc)
|
||||
endStationName.text = driveToNearestStationTask.siteName
|
||||
aciv_task_type_exercise.setImageResource(R.drawable.taxi_task_calibration)
|
||||
actv_switch_site.visibility = View.VISIBLE
|
||||
naviToStart.visibility = GONE
|
||||
setOrRemoveMapMaker(
|
||||
true,
|
||||
@@ -413,9 +429,10 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun showEmptyView() {
|
||||
CallerLogger.d(TAG,"showEmptyView")
|
||||
d(TAG,"showEmptyView")
|
||||
gourp_order.visibility = GONE
|
||||
aciv_task_type_exercise.visibility = GONE
|
||||
actv_switch_site.visibility = View.GONE
|
||||
group_itinerary_info.visibility = GONE
|
||||
include_empty.visibility = VISIBLE
|
||||
prepareTaskCountdownTv.visibility = GONE
|
||||
@@ -429,7 +446,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun initTaskDebugViewListener() {
|
||||
CallerLogger.d(TAG,"initTaskDebugViewListener")
|
||||
d(TAG,"initTaskDebugViewListener")
|
||||
fragment?.let { fr->
|
||||
aciv_task_type_exercise.setOnLongClickListener {
|
||||
FlowBus.with<Boolean>(TaxiDriverEventConst.TaxiFragmentEvent.EVENT_TYPE_SHOW_DEBUG_VIEW)
|
||||
@@ -445,7 +462,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun startOrEndService() {
|
||||
CallerLogger.d(TAG,"startOrEndService")
|
||||
d(TAG,"startOrEndService")
|
||||
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder()
|
||||
if (currentTaskWithOrder?.order == null) return
|
||||
val order = currentTaskWithOrder.order
|
||||
@@ -468,7 +485,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun closeOrderDialog() {
|
||||
CallerLogger.d(TAG,"closeOrderDialog")
|
||||
d(TAG,"closeOrderDialog")
|
||||
val builder = CommonDialogStatus.Builder()
|
||||
val closeOrderDialog = builder
|
||||
.title(ResourcesUtils.getString(R.string.dialog_order_close_title))
|
||||
@@ -495,7 +512,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
* @param isShow
|
||||
*/
|
||||
private fun showNaviToEndStationFragment() {
|
||||
CallerLogger.d(TAG,"showNaviToEndStationFragment")
|
||||
d(TAG,"showNaviToEndStationFragment")
|
||||
fragment?.let {
|
||||
TaxiTaskModel.startNaviToEndStation(true);
|
||||
}
|
||||
@@ -507,7 +524,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
* @param hasCurrentTask
|
||||
*/
|
||||
private fun initContainerView(hasCurrentTask: Boolean) {
|
||||
CallerLogger.d(TAG,"initContainerView")
|
||||
d(TAG,"initContainerView")
|
||||
d(
|
||||
TAG,
|
||||
"hasCurrentTask = $hasCurrentTask"
|
||||
@@ -530,6 +547,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
pathwayPoint.visibility = View.GONE
|
||||
// 演练单标识
|
||||
aciv_task_type_exercise.visibility = View.GONE
|
||||
actv_switch_site.visibility = View.GONE
|
||||
// 轨迹标识
|
||||
trajectoryType.visibility = View.GONE
|
||||
cancelTask.visibility = View.GONE
|
||||
@@ -543,12 +561,12 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun removeAllMapMarker() {
|
||||
CallerLogger.d(TAG,"removeAllMapMarker")
|
||||
d(TAG,"removeAllMapMarker")
|
||||
MapMakerManager.removeAllMapMarkerByOwner(TYPE_MARKER_TAXI_ORDER)
|
||||
}
|
||||
|
||||
private fun updateNextTaskFragment(result: QueryCurrentTaskRespBean.Result?) {
|
||||
CallerLogger.d(TAG,"updateNextTaskFragment")
|
||||
d(TAG,"updateNextTaskFragment")
|
||||
fragment?.let {
|
||||
FlowBus.with<QueryCurrentTaskRespBean.Result?>(TaxiDriverEventConst.TabFragmentEvent.EVENT_TYPE_TASK_WITH_ORDER_CHANGED)
|
||||
.post(it.lifecycleScope, result)
|
||||
@@ -570,12 +588,13 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun updateOrderUI(order: OrderDetail) {
|
||||
CallerLogger.d(TAG,"updateOrderUI")
|
||||
d(TAG,"updateOrderUI")
|
||||
gourp_order.visibility = View.VISIBLE
|
||||
cancelOrder.visibility = if (order.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.code
|
||||
) View.GONE else View.VISIBLE
|
||||
group_itinerary_info.visibility = View.VISIBLE
|
||||
aciv_task_type_exercise.visibility = View.GONE
|
||||
actv_switch_site.visibility = View.GONE
|
||||
// orderStatus: 0 订单创建(为派单), 10 已派上司机(司机去往上车点), 20 司机到达上车点,
|
||||
// 30 乘客到达上车点, 40 服务中(去往目的地), 50 到达目的地, 60 已完成, 70 已取消
|
||||
naviToStart.visibility = if (order.orderStatus
|
||||
@@ -676,7 +695,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
|
||||
//展示虚拟订单
|
||||
private fun updateVirtualTaskUI(taskAndOrder: QueryCurrentTaskRespBean.Result?) {
|
||||
CallerLogger.d(TAG,"updateVirtualTaskUI")
|
||||
d(TAG,"updateVirtualTaskUI")
|
||||
if (taskAndOrder == null) return
|
||||
|
||||
val startSite = taskAndOrder.startSite // 起点
|
||||
@@ -698,6 +717,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
pathwayPoint.visibility = View.GONE
|
||||
// 演练单标识
|
||||
aciv_task_type_exercise.visibility = View.VISIBLE
|
||||
actv_switch_site.visibility = View.GONE
|
||||
|
||||
actv_end_order.visibility = GONE
|
||||
commonSlideViewStartServer.visibility = GONE
|
||||
@@ -724,7 +744,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun updatePathwayPoint(taskType: Int, endSiteName: String?) {
|
||||
CallerLogger.d(TAG,"updatePathwayPoint")
|
||||
d(TAG,"updatePathwayPoint")
|
||||
if (TextUtils.isEmpty(endSiteName)) return
|
||||
pathwayPoint.visibility = if (taskType == TaskTypeEnum.ToOrderStartTask.code)
|
||||
View.VISIBLE else View.GONE
|
||||
@@ -732,7 +752,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun updateMapMarkers(taskAndOrder: QueryCurrentTaskRespBean.Result?) {
|
||||
CallerLogger.d(TAG,"updateMapMarkers")
|
||||
d(TAG,"updateMapMarkers")
|
||||
if (taskAndOrder?.startSite != null
|
||||
&& taskAndOrder.endSite != null
|
||||
) {
|
||||
@@ -805,7 +825,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
isAdd: Boolean, uuid: String,
|
||||
lat: Double, lon: Double, resourceId: Int
|
||||
) {
|
||||
CallerLogger.d(TAG,"setOrRemoveMapMaker")
|
||||
d(TAG,"setOrRemoveMapMaker")
|
||||
if (isAdd) {
|
||||
MapMakerManager.addMapMaker(TYPE_MARKER_TAXI_ORDER, uuid, lat, lon, resourceId)
|
||||
} else {
|
||||
@@ -817,7 +837,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
* 根据任务状态计算剩余历程和时间
|
||||
*/
|
||||
private fun updateRemainDistanceAndTime(isVoicePlay: Boolean) {
|
||||
CallerLogger.d(TAG,"updateRemainDistanceAndTime")
|
||||
d(TAG,"updateRemainDistanceAndTime")
|
||||
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() ?: return
|
||||
d(TAG, "updateRemainDistanceAndTime ${currentTaskWithOrder.currentStatus}")
|
||||
if (currentTaskWithOrder.currentStatus == TaskStatusEnum.StartTask.code) {
|
||||
@@ -838,7 +858,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun startNaviToStation(isVoicePlay: Boolean, stationLat: Double, stationLng: Double) {
|
||||
CallerLogger.d(TAG,"startNaviToStation")
|
||||
d(TAG,"startNaviToStation")
|
||||
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()
|
||||
val gcJ02Location = OchLocationManager.getGCJ02Location()
|
||||
val mCurLatitude = gcJ02Location.latitude
|
||||
@@ -852,7 +872,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun showDialog(){
|
||||
CallerLogger.d(TAG,"showDialog")
|
||||
d(TAG,"showDialog")
|
||||
if(dialog==null&&context!=null){
|
||||
|
||||
}
|
||||
@@ -870,7 +890,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun dismissDialog(){
|
||||
CallerLogger.d(TAG,"dismissDialog")
|
||||
d(TAG,"dismissDialog")
|
||||
dialog?.let {
|
||||
if(it.isShowing){
|
||||
it.dismiss()
|
||||
@@ -880,7 +900,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
private fun hideNaviBtns() {
|
||||
CallerLogger.d(TAG,"hideNaviBtns")
|
||||
d(TAG,"hideNaviBtns")
|
||||
naviToStart.visibility = View.GONE
|
||||
naviToEnd.visibility = View.GONE
|
||||
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()
|
||||
@@ -894,12 +914,12 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
override fun onCurrentNaviDistAndTimeChanged(meters: Int, timeInSecond: Long) {
|
||||
CallerLogger.d(TAG,"onCurrentNaviDistAndTimeChanged")
|
||||
d(TAG,"onCurrentNaviDistAndTimeChanged")
|
||||
actv_distance_end.text = TaskUtils.getCurrentTaskDistance(meters.toLong())+" "+TaskUtils.getCurrentTaskTime(timeInSecond)
|
||||
}
|
||||
|
||||
override fun reInitNaviAmap(isPlay: Boolean, isRestart: Boolean) {
|
||||
CallerLogger.d(TAG,"reInitNaviAmap")
|
||||
d(TAG,"reInitNaviAmap")
|
||||
d(TAG, "isPlay = $isPlay, isRestart=$isRestart")
|
||||
if (!isRestart) {
|
||||
fragment?.let {
|
||||
@@ -933,7 +953,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
fun onNaviToEndStationByAMap(isShow: Boolean) {
|
||||
CallerLogger.d(TAG,"onNaviToEndStationByAMap")
|
||||
d(TAG,"onNaviToEndStationByAMap")
|
||||
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() ?: return
|
||||
fragment?.let {
|
||||
if (currentTaskWithOrder.currentStatus == TaskStatusEnum.StartTask.code)
|
||||
@@ -953,7 +973,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi
|
||||
}
|
||||
|
||||
override fun onStartTaskFail() {
|
||||
CallerLogger.d(TAG,"onStartTaskFail")
|
||||
d(TAG,"onStartTaskFail")
|
||||
commonSlideViewStartServer.reset()
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,17 @@ class ItinerarySwitchModel : ViewModel() {
|
||||
this.viewCallback = viewCallback
|
||||
}
|
||||
|
||||
interface SwtichLineViewCallback {
|
||||
fun switchSite() {
|
||||
this.viewCallback?.showSwitchSite()
|
||||
}
|
||||
|
||||
fun showItinerary() {
|
||||
this.viewCallback?.showItinerary()
|
||||
}
|
||||
|
||||
interface SwtichLineViewCallback {
|
||||
fun showSwitchSite()
|
||||
fun showItinerary()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.FlowBus
|
||||
import com.mogo.och.unmanned.taxi.R
|
||||
import com.mogo.och.unmanned.taxi.TaxiUnmannedDriverProvider
|
||||
@@ -20,27 +21,37 @@ import com.mogo.och.unmanned.taxi.wigets.TaxiSelectViewGroup
|
||||
import kotlinx.android.synthetic.main.unmanned_switch_itinerary.view.currentItinerary
|
||||
import kotlinx.android.synthetic.main.unmanned_switch_itinerary.view.nextItinerary
|
||||
import kotlinx.android.synthetic.main.unmanned_switch_itinerary.view.order_operation_change
|
||||
import kotlinx.android.synthetic.main.unmanned_switch_itinerary.view.switch_site_view
|
||||
import kotlinx.android.synthetic.main.unmanned_switch_itinerary.view.taxiServerSelector
|
||||
|
||||
class ItinerarySwitchView: ConstraintLayout, ItinerarySwitchModel.SwtichLineViewCallback {
|
||||
class ItinerarySwitchView : ConstraintLayout, ItinerarySwitchModel.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) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
constructor(
|
||||
context: Context,
|
||||
attributeSet: AttributeSet,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
|
||||
companion object {
|
||||
const val TAG = "SwitchBizView"
|
||||
}
|
||||
|
||||
private var viewModel: ItinerarySwitchModel?=null
|
||||
private var viewModel: ItinerarySwitchModel? = null
|
||||
|
||||
private var fragment: LifecycleOwner?=null
|
||||
private var fragment: LifecycleOwner? = null
|
||||
|
||||
|
||||
init {
|
||||
@@ -49,27 +60,29 @@ class ItinerarySwitchView: ConstraintLayout, ItinerarySwitchModel.SwtichLineView
|
||||
initEventBus()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
private fun initView() {
|
||||
fragment = TaxiUnmannedDriverProvider.getFragmentInfo()
|
||||
order_operation_change.onClick {
|
||||
if (MogoStatusManager.getInstance().isTaxiUnmanedDriverLineRoutingVerifyMode) {
|
||||
ToastUtils.showLong("退出验证模式后再接单吧")
|
||||
return@onClick
|
||||
}
|
||||
viewModel?.changeOperationStatus()
|
||||
viewModel?.changeOperationStatus()
|
||||
}
|
||||
taxiServerSelector.checkChangeListener = object : TaxiSelectViewGroup.CheckChangeListener{
|
||||
taxiServerSelector.checkChangeListener = object : TaxiSelectViewGroup.CheckChangeListener {
|
||||
override fun changeCheck(newCheck: TaxiSelectViewGroup.ServerType?) {
|
||||
when (newCheck) {
|
||||
TaxiSelectViewGroup.ServerType.currentItinerary -> {
|
||||
currentItinerary.visibility = View.VISIBLE
|
||||
nextItinerary.visibility = View.GONE
|
||||
}
|
||||
|
||||
TaxiSelectViewGroup.ServerType.nextItinerary -> {
|
||||
currentItinerary.visibility = View.GONE
|
||||
nextItinerary.visibility = View.VISIBLE
|
||||
}
|
||||
else ->{
|
||||
|
||||
else -> {
|
||||
currentItinerary.visibility = View.GONE
|
||||
nextItinerary.visibility = View.GONE
|
||||
}
|
||||
@@ -83,7 +96,7 @@ class ItinerarySwitchView: ConstraintLayout, ItinerarySwitchModel.SwtichLineView
|
||||
fragment?.let {
|
||||
FlowBus.with<Boolean>(TaxiDriverEventConst.TabFragmentEvent.EVENT_TYPE_SHOW_RED_POINT)
|
||||
.register(it) { show ->
|
||||
taxiServerSelector.setNextItineraryRedBagVisable( if (show) View.VISIBLE else View.GONE)
|
||||
taxiServerSelector.setNextItineraryRedBagVisable(if (show) View.VISIBLE else View.GONE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,5 +111,23 @@ class ItinerarySwitchView: ConstraintLayout, ItinerarySwitchModel.SwtichLineView
|
||||
viewModel?.setDistanceCallback(this)
|
||||
}
|
||||
|
||||
override fun showSwitchSite() {
|
||||
BizLoopManager.runInMainThread {
|
||||
currentItinerary.visibility = View.GONE
|
||||
nextItinerary.visibility = View.GONE
|
||||
taxiServerSelector.visibility = View.GONE
|
||||
order_operation_change.visibility = View.GONE
|
||||
switch_site_view.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
override fun showItinerary() {
|
||||
currentItinerary.visibility = View.VISIBLE
|
||||
taxiServerSelector.visibility = View.VISIBLE
|
||||
order_operation_change.visibility = View.VISIBLE
|
||||
switch_site_view.visibility = View.GONE
|
||||
nextItinerary.visibility = View.GONE
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.mogo.och.unmanned.taxi.ui.task.siteswitch
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.DiffUtil.Callback
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.och.unmanned.taxi.R
|
||||
import com.mogo.och.unmanned.taxi.bean.StartStationBean
|
||||
import com.mogo.och.unmanned.taxi.utils.TaskUtils
|
||||
import me.jessyan.autosize.AutoSizeCompat
|
||||
|
||||
class SwitchSiteAdapter(
|
||||
private val mContext: Context,
|
||||
var checkStationBean: StartStationBean?,
|
||||
val mData: MutableList<StartStationBean>
|
||||
) : RecyclerView.Adapter<SwitchSiteAdapter.SwitchSiteViewHolder>() {
|
||||
companion object{
|
||||
const val TAG = M_BUS+"SwitchLineAdapter"
|
||||
}
|
||||
// RecyclerView设置点击事件
|
||||
private var mItemClickListener: LineItemClickListener? = null
|
||||
|
||||
fun setDataList(dataList: List<StartStationBean>) {
|
||||
|
||||
val diffResult = DiffUtil.calculateDiff(MyDiffCallback(this.mData, dataList))
|
||||
this.mData.clear()
|
||||
this.mData.addAll(dataList)
|
||||
diffResult.dispatchUpdatesTo(this)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): SwitchSiteViewHolder {
|
||||
val view = LayoutInflater.from(mContext).inflate(
|
||||
R.layout.taxi_site_list_item, parent, false
|
||||
)
|
||||
return SwitchSiteViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: SwitchSiteViewHolder, position: Int) {
|
||||
val currentPosition = holder.bindingAdapterPosition
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(holder.itemView.resources)
|
||||
val site = mData[currentPosition]
|
||||
|
||||
holder.lineName.text = site.name
|
||||
holder.lineEndName.text = TaskUtils.getCurrentTaskDistance(site.distance2Current.toLong())
|
||||
|
||||
if(site==checkStationBean) {
|
||||
holder.itemView.setBackgroundResource(R.drawable.taxi_switch_site_selected)
|
||||
}else {
|
||||
holder.itemView.setBackgroundResource(R.drawable.taxi_switch_site_normal)
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener {
|
||||
var preCheckIndex = -1
|
||||
if(checkStationBean==null){
|
||||
checkStationBean = site
|
||||
}else{
|
||||
if(checkStationBean==site){
|
||||
checkStationBean = null
|
||||
}else {
|
||||
mData.forEachIndexed { index, result ->
|
||||
if(checkStationBean == result){
|
||||
checkStationBean = null
|
||||
preCheckIndex = index
|
||||
}
|
||||
}
|
||||
checkStationBean = site
|
||||
}
|
||||
}
|
||||
notifyItemChanged(currentPosition)
|
||||
if(preCheckIndex>=0){
|
||||
notifyItemChanged(preCheckIndex)
|
||||
}
|
||||
mItemClickListener?.onItemClick(checkStationBean)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return mData.size
|
||||
}
|
||||
|
||||
fun setOnLineItemClickListener(itemClickListener: LineItemClickListener?) {
|
||||
mItemClickListener = itemClickListener
|
||||
}
|
||||
|
||||
class SwitchSiteViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
val lineName: AppCompatTextView = itemView.findViewById(R.id.switch_line_name)//线路名称
|
||||
val lineEndName: AppCompatTextView = itemView.findViewById(R.id.switch_line_end_station) //终点
|
||||
}
|
||||
|
||||
interface LineItemClickListener {
|
||||
fun onItemClick(data: StartStationBean?)
|
||||
}
|
||||
|
||||
inner class MyDiffCallback(private val oldData:List<StartStationBean>, private val newData:List<StartStationBean>):
|
||||
Callback(){
|
||||
override fun getOldListSize(): Int {
|
||||
return oldData.size
|
||||
}
|
||||
|
||||
override fun getNewListSize(): Int {
|
||||
return newData.size
|
||||
}
|
||||
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldData[oldItemPosition]
|
||||
val newItem = newData[newItemPosition]
|
||||
return oldItem == newItem
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldData[oldItemPosition]
|
||||
val newItem = newData[newItemPosition]
|
||||
return oldItem == newItem
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
package com.mogo.och.unmanned.taxi.ui.task.siteswitch
|
||||
|
||||
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.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.wigets.TaskBottomDecoration
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import com.mogo.och.common.module.wigets.WrapContentLinearLayoutManager
|
||||
import com.mogo.och.common.module.wigets.commonview.ErrorView
|
||||
import com.mogo.och.unmanned.taxi.R
|
||||
import com.mogo.och.unmanned.taxi.bean.StartStationBean
|
||||
import com.mogo.och.unmanned.taxi.ui.task.itinerayswitch.ItinerarySwitchModel
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.aciv_bottom_shadow
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.actv_cancle_task
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.actv_cancle_task_nodata
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.cl_submit_task
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.include_empty
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.include_errorview
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.site_switch_loading_biz
|
||||
import kotlinx.android.synthetic.main.taxi_switch_site.view.switch_site_rv
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
|
||||
class SwitchSiteView : WindowRelativeLayout, SwtichSiteModel.SiteSwtichViewCallback {
|
||||
|
||||
|
||||
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 = "${M_BUS}SwitchSiteView"
|
||||
}
|
||||
|
||||
private var viewModel: SwtichSiteModel? = null
|
||||
private var viewModelSwitch: ItinerarySwitchModel? = null
|
||||
|
||||
private lateinit var mAdapter: SwitchSiteAdapter
|
||||
|
||||
private lateinit var linearLayoutManager: WrapContentLinearLayoutManager
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_switch_site, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
linearLayoutManager = WrapContentLinearLayoutManager(context)
|
||||
switch_site_rv.setLayoutManager(linearLayoutManager)
|
||||
mAdapter = SwitchSiteAdapter(context, null, mutableListOf())
|
||||
switch_site_rv.addItemDecoration(
|
||||
TaskBottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 174f),
|
||||
AutoSizeUtils.dp2px(context, 20f),
|
||||
)
|
||||
)
|
||||
switch_site_rv.setAdapter(mAdapter)
|
||||
//设置item 点击事件
|
||||
mAdapter.setOnLineItemClickListener(object : SwitchSiteAdapter.LineItemClickListener {
|
||||
override fun onItemClick(data: StartStationBean?) {
|
||||
CallerLogger.d(TAG, "选择站点 站点信息:${data}")
|
||||
}
|
||||
})
|
||||
|
||||
include_errorview.reloadLIstener = object : ErrorView.ReloadLIstener {
|
||||
override fun reload() {
|
||||
loadingDatas()
|
||||
}
|
||||
}
|
||||
|
||||
cl_submit_task.onClick {
|
||||
CallerLogger.d(TAG, "确定站点 站点信息:${mAdapter.checkStationBean}")
|
||||
if (mAdapter.checkStationBean == null) {
|
||||
ToastUtils.showShort("请选择新的标定单")
|
||||
return@onClick
|
||||
}
|
||||
viewModel?.selectNewSite(mAdapter.checkStationBean!!)
|
||||
}
|
||||
actv_cancle_task.onClick {
|
||||
viewModelSwitch?.showItinerary()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if (isVisible) {
|
||||
// 加载数据
|
||||
loadingDatas()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
private fun loadingDatas() {
|
||||
CallerLogger.d(TAG, "加载站点去")
|
||||
showLoadingView()
|
||||
viewModel?.querySiteList(true)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(SwtichSiteModel::class.java)
|
||||
}
|
||||
viewModel?.setSwitchSiteCallback(this)
|
||||
viewModelSwitch = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(ItinerarySwitchModel::class.java)
|
||||
}
|
||||
CallerLogger.d(TAG, "onAttachedToWindow")
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerLogger.d(TAG, "onDetachedFromWindow")
|
||||
}
|
||||
|
||||
var startLoading = System.currentTimeMillis()
|
||||
|
||||
/**
|
||||
* 展示loading页面
|
||||
*/
|
||||
private fun showLoadingView() {
|
||||
startLoading = System.currentTimeMillis()
|
||||
CallerLogger.d(TAG, "开始展示 lading 时间:${startLoading}")
|
||||
BizLoopManager.runInMainThread {
|
||||
// 加载中view
|
||||
site_switch_loading_biz.visibility = VISIBLE
|
||||
// 站点列表
|
||||
switch_site_rv.visibility = GONE
|
||||
// 确认站点
|
||||
cl_submit_task.visibility = GONE
|
||||
// 有站点不更改返回
|
||||
actv_cancle_task.visibility = GONE
|
||||
// 底部背景
|
||||
aciv_bottom_shadow.visibility = GONE
|
||||
// 空view
|
||||
include_empty.visibility = GONE
|
||||
// 没有站点不更改返回
|
||||
actv_cancle_task_nodata.visibility = GONE
|
||||
// 错误页面
|
||||
include_errorview.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 展示空数据
|
||||
*/
|
||||
private fun showNoData() {
|
||||
val endLoading = System.currentTimeMillis()
|
||||
val dex = (100 - (endLoading - startLoading)).takeIf { it >= 0 } ?: 0
|
||||
CallerLogger.d(TAG, "展示展示站点空数据 lading 展示了 ${dex}毫秒")
|
||||
BizLoopManager.runInMainThreadDelay(dex) {
|
||||
// 加载中view
|
||||
site_switch_loading_biz.visibility = GONE
|
||||
// 站点列表
|
||||
switch_site_rv.visibility = GONE
|
||||
// 确认站点
|
||||
cl_submit_task.visibility = GONE
|
||||
// 有站点不更改返回
|
||||
actv_cancle_task.visibility = GONE
|
||||
// 底部背景
|
||||
aciv_bottom_shadow.visibility = VISIBLE
|
||||
// 空view
|
||||
include_empty.visibility = VISIBLE
|
||||
// 没有站点不更改返回
|
||||
actv_cancle_task_nodata.visibility = VISIBLE
|
||||
// 错误页面
|
||||
include_errorview.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示错误类型
|
||||
*/
|
||||
private fun showErrorData() {
|
||||
val endLoading = System.currentTimeMillis()
|
||||
val dex = (100 - (endLoading - startLoading)).takeIf { it >= 0 } ?: 0
|
||||
CallerLogger.d(TAG, "展示展示站点错误数据 lading 展示了 ${dex}毫秒")
|
||||
BizLoopManager.runInMainThreadDelay(dex) {
|
||||
// 加载中view
|
||||
site_switch_loading_biz.visibility = GONE
|
||||
// 站点列表
|
||||
switch_site_rv.visibility = GONE
|
||||
// 确认站点
|
||||
cl_submit_task.visibility = GONE
|
||||
// 有站点不更改返回
|
||||
actv_cancle_task.visibility = GONE
|
||||
// 底部背景
|
||||
aciv_bottom_shadow.visibility = VISIBLE
|
||||
// 空view
|
||||
include_empty.visibility = GONE
|
||||
// 没有站点不更改返回
|
||||
actv_cancle_task_nodata.visibility = VISIBLE
|
||||
// 错误页面
|
||||
include_errorview.visibility = VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
private fun showSitesView() {
|
||||
val endLoading = System.currentTimeMillis()
|
||||
val dex = (100 - (endLoading - startLoading)).takeIf { it >= 0 } ?: 0
|
||||
CallerLogger.d(TAG, "展示展示站点数据 lading 展示了 ${dex}毫秒")
|
||||
BizLoopManager.runInMainThreadDelay(dex) {
|
||||
// 加载中view
|
||||
site_switch_loading_biz.visibility = GONE
|
||||
// 站点列表
|
||||
switch_site_rv.visibility = VISIBLE
|
||||
// 确认站点
|
||||
cl_submit_task.visibility = VISIBLE
|
||||
// 有站点不更改返回
|
||||
actv_cancle_task.visibility = VISIBLE
|
||||
// 底部背景
|
||||
aciv_bottom_shadow.visibility = VISIBLE
|
||||
// 空view
|
||||
include_empty.visibility = GONE
|
||||
// 没有站点不更改返回
|
||||
actv_cancle_task_nodata.visibility = GONE
|
||||
// 错误页面
|
||||
include_errorview.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun setData(startList: List<StartStationBean>) {
|
||||
if (startList.isEmpty()) {
|
||||
showNoData()
|
||||
} else {
|
||||
BizLoopManager.runInMainThread{
|
||||
mAdapter.setDataList(startList)
|
||||
}
|
||||
showSitesView()
|
||||
}
|
||||
}
|
||||
|
||||
override fun showErrorView() {
|
||||
showErrorData()
|
||||
}
|
||||
|
||||
override fun showCalibrationSite() {
|
||||
viewModelSwitch?.showItinerary()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.mogo.och.unmanned.taxi.ui.task.siteswitch
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.och.bridge.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.unmanned.taxi.bean.StartServiceRespBeans
|
||||
import com.mogo.och.unmanned.taxi.bean.StartStationBean
|
||||
import com.mogo.och.unmanned.taxi.network.TaxiTaskWithOrderServiceManager
|
||||
import com.mogo.och.unmanned.taxi.ui.debug.DebugView
|
||||
import com.mogo.och.unmanned.taxi.ui.task.TaxiTaskModel
|
||||
|
||||
|
||||
class SwtichSiteModel : ViewModel() {
|
||||
|
||||
private val TAG = M_BUS+SwtichSiteModel::class.java.simpleName
|
||||
|
||||
private var viewCallback:SiteSwtichViewCallback?=null
|
||||
|
||||
|
||||
override fun onCleared() {
|
||||
d(TAG,"onCleared")
|
||||
}
|
||||
|
||||
fun setSwitchSiteCallback(viewCallback:SiteSwtichViewCallback){
|
||||
this.viewCallback = viewCallback
|
||||
}
|
||||
|
||||
fun querySiteList(loading:Boolean) {
|
||||
DebugView.printInfoMsg("[查询标定点] 准备发送请求")
|
||||
TaxiTaskWithOrderServiceManager.queryStartSiteListBySn(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
object : OchCommonServiceCallback<StartServiceRespBeans> {
|
||||
override fun onSuccess(data: StartServiceRespBeans?) {
|
||||
DebugView.printInfoMsg("[查询标定点] 请求success")
|
||||
data?.data?.let {
|
||||
calculateDistance(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
DebugView.printInfoMsg("[查询标定点] 请求fail, code=$code, msg=$msg")
|
||||
d(TAG, "journeyCompleted onFail: code=$code, msg=$msg")
|
||||
viewCallback?.showErrorView()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun calculateDistance(startList: List<StartStationBean>) {
|
||||
OchLocationManager.getGCJ02Location().let {currentLocation->
|
||||
if (currentLocation.latitude == 0.0 && currentLocation.longitude == 0.0) {
|
||||
DebugView.printInfoMsg("[查询标定点] 当前无定位坐标")
|
||||
this.viewCallback?.setData(startList)
|
||||
return
|
||||
}
|
||||
startList.forEach {
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
currentLocation.longitude,
|
||||
currentLocation.latitude,
|
||||
it.gcjLon,
|
||||
it.gcjLat
|
||||
)
|
||||
it.distance2Current = distance
|
||||
}
|
||||
val finalData = startList.toMutableList().sortedBy { it.distance2Current }
|
||||
DebugView.printInfoMsg("[查询标定点] ${finalData}")
|
||||
this.viewCallback?.setData(finalData)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun selectNewSite(checkStationBean: StartStationBean) {
|
||||
TaxiTaskModel.setCalibrationSite( checkStationBean.toResult())
|
||||
this.viewCallback?.showCalibrationSite()
|
||||
}
|
||||
|
||||
interface SiteSwtichViewCallback{
|
||||
fun setData(startList: List<StartStationBean>)
|
||||
fun showErrorView()
|
||||
fun showCalibrationSite()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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/common_2EACFF" android:state_pressed="true"/>
|
||||
<item android:color="@color/white" android:state_pressed="false"/>
|
||||
<item android:color="@color/white"/>
|
||||
</selector>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 610 B |
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@drawable/taxi_ic_autopilot_bg_pressed"/>
|
||||
<item android:state_pressed="false" android:drawable="@drawable/taxi_ic_autopilot_bg" />
|
||||
<item android:drawable="@drawable/taxi_ic_autopilot_bg"/>
|
||||
</selector>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20dp" android:bottomRightRadius="50dp" android:topLeftRadius="50dp" android:topRightRadius="20dp" />
|
||||
<gradient android:angle="315" android:endColor="#2B6EFF" android:startColor="#2B6EFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20dp" android:bottomRightRadius="50dp" android:topLeftRadius="50dp" android:topRightRadius="20dp" />
|
||||
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20dp" android:bottomRightRadius="50dp" android:topLeftRadius="50dp" android:topRightRadius="20dp" />
|
||||
<gradient android:angle="315" android:endColor="#2B6EFF" android:startColor="#2B6EFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20dp" android:bottomRightRadius="50dp" android:topLeftRadius="50dp" android:topRightRadius="20dp" />
|
||||
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
|
||||
</shape>
|
||||
</item>
|
||||
</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/common_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/common_4D2EACFF"/>
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
</shape>
|
||||
@@ -1,6 +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"/>
|
||||
<item android:state_pressed="true" android:drawable="@drawable/taxi_switch_site_selected"/>
|
||||
<item android:state_pressed="false" android:drawable="@drawable/taxi_switch_site_normal"/>
|
||||
<item android:drawable="@drawable/taxi_switch_site_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/common_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/common_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/taxi_switch_site_submit_selected"/>
|
||||
<item android:state_pressed="false" android:drawable="@drawable/taxi_switch_site_submit_normal"/>
|
||||
<item android:state_checked="true" android:drawable="@drawable/taxi_switch_site_submit_selected"/>
|
||||
<item android:state_checked="false" android:drawable="@drawable/taxi_switch_site_submit_normal"/>
|
||||
<item android:drawable="@drawable/taxi_switch_site_submit_normal"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?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="wrap_content"
|
||||
android:background="@drawable/taxi_switch_site_selector">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_line_point"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_39"
|
||||
android:src="@drawable/site_item_head"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/switch_line_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
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_40"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_line_point"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_line_point"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_line_point"
|
||||
tools:text="@string/task_site_name" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/switch_line_end_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_28"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/switch_line_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/switch_line_name"
|
||||
tools:text="@string/task_site_distance_current" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_880"
|
||||
android:layout_height="match_parent"
|
||||
tools:layout_height="@dimen/dp_966"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/taxi_site_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:layout_marginLeft="@dimen/dp_54"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_37"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/task_switch_site"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/switch_site_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:layout_marginStart="@dimen/dp_54"
|
||||
android:layout_marginEnd="@dimen/dp_52"
|
||||
app:layout_constraintTop_toBottomOf="@+id/taxi_site_title"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_13" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.loading.LoadingViewBig
|
||||
android:id="@+id/site_switch_loading_biz"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.commonview.EmptyView
|
||||
android:id="@+id/include_empty"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
app:empty_title="暂无站点"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.commonview.ErrorView
|
||||
android:id="@+id/include_errorview"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_bottom_shadow"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:src="@drawable/taxi_switch_site_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/taxi_switch_site_submit"
|
||||
android:background="@drawable/taxi_switch_site_submit_selector"
|
||||
android:textColor="@color/taxi_switch_site_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.common.module.wigets.loading.LoadingViewSmall
|
||||
android:id="@+id/loading_start_line"
|
||||
android:src="@drawable/common_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/taxi_switch_site_submit_selector"
|
||||
android:gravity="center"
|
||||
android:text="@string/common_dialog_goback"
|
||||
android:textColor="@color/taxi_switch_site_submit_text_color_selector"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_cancle_task_nodata"
|
||||
android:layout_width="@dimen/dp_356"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginBottom="@dimen/dp_54"
|
||||
app:pressed_enabled="false"
|
||||
android:background="@drawable/taxi_switch_site_submit_selector"
|
||||
android:gravity="center"
|
||||
android:text="@string/common_dialog_goback"
|
||||
android:textColor="@color/taxi_switch_site_submit_text_color_selector"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -76,6 +76,17 @@
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_50"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_switch_site"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="@color/common_2eacff"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_task_type_exercise"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_task_type_exercise"
|
||||
app:layout_constraintEnd_toEndOf="@+id/v_bg_itinerary_info"
|
||||
android:text="@string/task_site_swtich"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/v_bg_itinerary_info"
|
||||
app:layout_constraintTop_toBottomOf="@+id/aciv_task_type_order"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
|
||||
<!--当前行程和待服务切换-->
|
||||
<com.mogo.och.unmanned.taxi.wigets.TaxiSelectViewGroup
|
||||
android:id="@+id/taxiServerSelector"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -15,6 +15,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<!-- 接单状态 -->
|
||||
<com.mogo.och.common.module.wigets.map.orderstatus.OrderStatusView
|
||||
android:id="@+id/order_operation_change"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -24,6 +25,7 @@
|
||||
android:layout_width="@dimen/dp_118"
|
||||
android:layout_height="@dimen/dp_50"/>
|
||||
|
||||
<!-- 当前行程 -->
|
||||
<com.mogo.och.unmanned.taxi.ui.task.itinerarycurrent.ItineraryCurrentView
|
||||
android:id="@+id/currentItinerary"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -34,7 +36,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/taxiServerSelector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<!-- 待服务 -->
|
||||
<com.mogo.och.unmanned.taxi.ui.task.itinerarynext.ItineraryNextView
|
||||
android:id="@+id/nextItinerary"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -46,4 +48,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<!--选择新的标定单-->
|
||||
<com.mogo.och.unmanned.taxi.ui.task.siteswitch.SwitchSiteView
|
||||
android:id="@+id/switch_site_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
</merge>
|
||||
@@ -59,6 +59,11 @@
|
||||
<string name="passenger_cancel_order">乘客已取消</string>
|
||||
|
||||
<string name="waiting_server">待服务</string>
|
||||
<string name="task_switch_site">切换站点</string>
|
||||
<string name="task_site_name">站点名称</string>
|
||||
<string name="task_site_distance_current">62m</string>
|
||||
<string name="task_site_swtich">切换</string>
|
||||
<string name="taxi_switch_site_submit">确认切换</string>
|
||||
|
||||
<string name="view_data">查看</string>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: ly.count.android.plugins.UploadSymbolsPlugin
|
||||
|
||||
apply from: rootProject.file('gradle/bytex/bytex.gradle')
|
||||
//apply from: rootProject.file('gradle/bytex/bytex.gradle')
|
||||
|
||||
Properties properties = new Properties()
|
||||
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
|
||||
|
||||
Reference in New Issue
Block a user