[charter]
[包车乘客屏业务吐司定制]
This commit is contained in:
yangyakun
2023-08-24 15:13:51 +08:00
parent 2b75fa4f16
commit d6ac2ad37d
32 changed files with 269 additions and 215 deletions

View File

@@ -16,6 +16,10 @@ import com.mogo.och.common.module.utils.DateTimeUtil
*/
object DriverM1ServiceManager {
init {
}
private val mDriverM1ServiceApi: IDriverM1Service =
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
IDriverM1Service::class.java

View File

@@ -12,7 +12,6 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLi
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
@@ -31,7 +30,7 @@ import com.mogo.och.bus.passenger.callback.*
import com.mogo.och.bus.passenger.constant.CharterPassengerConst
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.bus.passenger.utils.VoiceFocusManager
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
@@ -196,7 +195,7 @@ object CharterPassengerModel {
super.onAutopilotGuardian(guardianInfo)
guardianInfo?.let {
if (it.code=="IMAP_TRA_LOADED") {
ToastCharterUtils.showShort("请等待车辆完成掉头后再出发吧~")
ToastCharterUtils.showToastShort("请等待车辆完成掉头后再出发吧~")
}
}
}
@@ -349,7 +348,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
ToastCharterUtils.showToastShort("$code:$msg")
}
})
}
@@ -478,7 +477,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
ToastCharterUtils.showToastShort("$code:$msg")
}
})
}
@@ -585,7 +584,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
ToastCharterUtils.showToastShort("$code:$msg")
}
})
}
@@ -609,7 +608,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
ToastCharterUtils.showToastShort("$code:$msg")
}
})
}
@@ -890,7 +889,7 @@ object CharterPassengerModel {
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
ToastCharterUtils.showToastShort("$code:$msg")
broadcastList[requestIngSign] = false
}
@@ -1027,7 +1026,7 @@ object CharterPassengerModel {
*/
fun startAutopilot() {
if (!OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
ToastCharterUtils.showLong(
ToastCharterUtils.showToastLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
)
@@ -1035,19 +1034,19 @@ object CharterPassengerModel {
}
orderInfo?.let {
if (it.arriveStatus == OrderInfoResponse.ARRIVED) {
ToastCharterUtils.showLong("已到达目的地请重新选择线路")
ToastCharterUtils.showToastLong("已到达目的地请重新选择线路")
return
}
val parameters = initAutopilotControlParameters()
if (null == parameters) {
ToastCharterUtils.showShort("请选择站点")
ToastCharterUtils.showToastShort("请选择站点")
e(
SceneConstant.M_BUS + TAG,
"行程日志-AutopilotControlParameters is empty."
)
return
}
ToastCharterUtils.showShort("启动自动驾驶中")
ToastCharterUtils.showToastShort("启动自动驾驶中")
cleanRoutePoints()
startAutoPilot(parameters)
d(

View File

@@ -7,7 +7,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.passenger.bean.request.ArriveDestRequest
import com.mogo.och.bus.passenger.bean.request.EndOrderRequest
import com.mogo.och.bus.passenger.bean.response.*
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
@@ -39,7 +39,7 @@ object BusPassengerServiceManager {
private fun beforeNet():Boolean{
if (draiverSn.isBlank()) {
ToastCharterUtils.showShort("已断开司机屏连接、请联系安全员")
ToastCharterUtils.showToastShort("已断开司机屏连接、请联系安全员")
return true
}
return false

View File

@@ -28,7 +28,6 @@ import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
import com.mogo.och.bus.passenger.model.OrderStatusEnum
import com.mogo.och.bus.passenger.receive.DriverMessage
import com.mogo.och.bus.passenger.ui.MainFragment
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.ui.overmapview.MakerWithSiteName
import com.mogo.och.bus.passenger.ui.overmapview.MakerWithSiteNamewithCheck
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
@@ -36,6 +35,7 @@ import com.mogo.och.common.module.manager.StopSideStatusManager
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorCallback
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.common.module.voice.VoiceNotice
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import me.jessyan.autosize.utils.AutoSizeUtils
import java.util.concurrent.ConcurrentHashMap
@@ -61,7 +61,6 @@ class BusPassengerPresenter(view: MainFragment?) :
CallerTelematicListenerManager.addListener(TAG, DriverMessage)
StopSideStatusManager.addListener(TAG, this)
setCarChangeListener(R.raw.m1)
}
override fun onDestroy(owner: LifecycleOwner) {
@@ -114,11 +113,11 @@ class BusPassengerPresenter(view: MainFragment?) :
OrderStatusEnum.NoOrderUse -> {
when (CallerAutoPilotStatusListenerManager.getState()) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
ToastCharterUtils.showShort("设备未就绪请稍等,请安全员主动停止车辆")
ToastCharterUtils.showToastShort("设备未就绪请稍等,请安全员主动停止车辆")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
ToastCharterUtils.showToastShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
@@ -127,7 +126,7 @@ class BusPassengerPresenter(view: MainFragment?) :
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请安全员主动停止车辆")
ToastCharterUtils.showToastShort("因车辆正在平行驾驶中无法靠边停车,请安全员主动停止车辆")
}
else -> {}
@@ -184,7 +183,7 @@ class BusPassengerPresenter(view: MainFragment?) :
UiThreadHandler.post {
when (actionStatus) {
StopSideStatusManager.Status.NOSTART -> {
ToastCharterUtils.showShort(errorInfo?:"")
ToastCharterUtils.showToastShort(errorInfo?:"")
}
StopSideStatusManager.Status.START -> {
@@ -199,7 +198,7 @@ class BusPassengerPresenter(view: MainFragment?) :
}
StopSideStatusManager.Status.EndingSuccess -> {
ToastCharterUtils.showShort("靠边停车成功")
ToastCharterUtils.showToastShort("靠边停车成功")
VoiceNotice.showNotice(
context.getString(R.string.m1_stop_site_success),
AIAssist.LEVEL0
@@ -207,7 +206,7 @@ class BusPassengerPresenter(view: MainFragment?) :
}
StopSideStatusManager.Status.EndingFaile -> {
ToastCharterUtils.showShort("车辆系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("车辆系统繁忙,请稍后再试")
}
}
}
@@ -216,9 +215,9 @@ class BusPassengerPresenter(view: MainFragment?) :
override fun onDoorStatusCallback(isOpen: Boolean, isFirst: Boolean) {
if (!isFirst) {
if (isOpen) {
ToastCharterUtils.showShort("已开启车门")
ToastCharterUtils.showToastShort("已开启车门")
} else {
ToastCharterUtils.showShort("已关门车门")
ToastCharterUtils.showToastShort("已关门车门")
}
}
}
@@ -247,7 +246,7 @@ class BusPassengerPresenter(view: MainFragment?) :
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
ToastCharterUtils.showToastShort("$code:$msg")
}
})

View File

@@ -30,7 +30,7 @@ import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
import com.mogo.och.bus.passenger.ui.dialogfragment.M1CarUserNoOrderFragment
import com.mogo.och.bus.passenger.ui.dialogfragment.NoviceGuidanceFragment
import com.mogo.och.bus.passenger.ui.statusbar.StatusBarView
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.common.module.biz.constant.LoginStatusManager
import kotlinx.android.synthetic.main.m1_main_fragment.*
import org.greenrobot.eventbus.EventBus
@@ -115,11 +115,11 @@ class MainFragment : MvpFragment<MainFragment?, BusPassengerPresenter?>(), IMogo
if (mPresenter?.haveOrder() == true) {
} else {
ToastCharterUtils.showShort("请确认订单")
ToastCharterUtils.showToastShort("请确认订单")
return true
}
} else {
ToastCharterUtils.showShort(requireContext().getString(R.string.m1_please_login_driver))
ToastCharterUtils.showToastShort(requireContext().getString(R.string.m1_please_login_driver))
return true
}
showBizView(orderinfo = true)

View File

@@ -15,7 +15,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.callback.ICharterPassengerAutoStatusChangeCallback
import com.mogo.och.bus.passenger.model.CharterPassengerModel
@@ -66,7 +66,7 @@ class GoViewWithArrive @JvmOverloads constructor(
})
setOnClickListener {
if (ClickUtils.isClickTooFrequent(this,3000)) {
ToastCharterUtils.showShort("请稍后点击")
ToastCharterUtils.showToastShort("请稍后点击")
return@setOnClickListener
}
startGo()
@@ -78,12 +78,12 @@ class GoViewWithArrive @JvmOverloads constructor(
if (LightAirconditionDoorStatusManager.doorStatus.isOpen) {
val string = AbsMogoApplication.getApp().getString(R.string.m1_close_door_and_startauto)
ToastCharterUtils.showShort(string)
ToastCharterUtils.showToastShort(string)
return
}
when (CallerAutoPilotStatusListenerManager.getState()) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
ToastCharterUtils.showShort("设备未就绪请稍等")
ToastCharterUtils.showToastShort("设备未就绪请稍等")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
onceRegisterAutoStatus()
@@ -94,7 +94,7 @@ class GoViewWithArrive @JvmOverloads constructor(
CharterPassengerModel.leaveStation()
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
ToastCharterUtils.showToastShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
}
else -> {}
}
@@ -123,7 +123,7 @@ class GoViewWithArrive @JvmOverloads constructor(
startAutoTimeOut = RxUtils.createSubscribe(20_000) {
if (CallerAutoPilotStatusListenerManager.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
val string = AbsMogoApplication.getApp().getString(R.string.m1_start_auto_fail)
ToastCharterUtils.showLong(string)
ToastCharterUtils.showToastLong(string)
}
CharterPassengerModel.setAutoStatusCallback(TAG, null)
}

View File

@@ -6,7 +6,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
import com.mogo.och.common.module.utils.SoundPoolHelper
@@ -31,17 +31,17 @@ class StopSiteView @JvmOverloads constructor(
private fun stopSite(){
when (CallerAutoPilotStatusListenerManager.getState()) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
ToastCharterUtils.showShort("设备未就绪请稍等,请稍后再试")
ToastCharterUtils.showToastShort("设备未就绪请稍等,请稍后再试")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请稍后再试")
ToastCharterUtils.showToastShort("因车辆正在人工驾驶中无法靠边停车,请稍后再试")
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
// 靠边停车
CallerAutoPilotControlManager.sendPlanningCmd(1)
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
ToastCharterUtils.showToastShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
}
else -> {}
}

View File

@@ -11,12 +11,11 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.ui.debugview.DebugView
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.ui.MainFragment
import com.mogo.och.bus.passenger.ui.statusbar.StatusBarView
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.common.module.manager.debug.DebugViewWatchDogFragment
import kotlinx.android.synthetic.main.m1_p_debug.view.debug_arrive_dest
import kotlinx.android.synthetic.main.m1_p_debug.view.debug_change_modle
@@ -66,7 +65,7 @@ class DebugView @JvmOverloads constructor(
fragment?.showNoviceGuidanceFragment()
}
debug_change_modle.setOnClickListener {
ToastCharterUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
ToastCharterUtils.showToastShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
when (HdMapBuildConfig.currentCarVrIconRes) {
R.raw.aiqinghao -> {
fragment?.setCarMode(OrderInfoResponse.M1_FAMILY)

View File

@@ -9,7 +9,7 @@ import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.callback.ITimeCallback
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.bean.dpmsg.EndOrderMsg
import com.mogo.och.common.module.biz.constant.OchCommonConst
@@ -68,7 +68,7 @@ class OrderInfoViewModel: ViewModel(), ITimeCallback {
CharterPassengerModel.endOrder(object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
if (null != data && 0 == data.code) {
ToastCharterUtils.showShort("结束成功")
ToastCharterUtils.showToastShort("结束成功")
CharterPassengerModel.setEndOrderStatus()
viewCallback?.setViewGone()
val msg = EndOrderMsg(
@@ -83,7 +83,7 @@ class OrderInfoViewModel: ViewModel(), ITimeCallback {
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("$code:$msg")
ToastCharterUtils.showToastShort("$code:$msg")
}
})
}

View File

@@ -18,11 +18,9 @@ import com.mogo.och.bus.passenger.bean.event.EventLineSites
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
import com.mogo.och.bus.passenger.callback.IClearViewCallback
import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.ui.selectline.adapter.OrderLineItemAdapter
import com.mogo.och.bus.passenger.ui.selectline.adapter.OrderSiteItemAdapter
import com.mogo.och.bus.passenger.ui.selectline.layoutmanage.BottomDecoration
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.m1_order_fragment.view.aciv_driver_refuse_group

View File

@@ -20,7 +20,7 @@ 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.BusPassengerServiceManager
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
@@ -85,7 +85,7 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
if (msg.arriveStatus == 2) {
return@post
}
ToastCharterUtils.showShort("站点确定")
ToastCharterUtils.showToastShort("站点确定")
viewCallback?.setEnableSiteStatus(true)
checkLine = tempCheckLine
checkSite = tempCheckSite
@@ -98,7 +98,7 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
CharterPassengerModel.cleanbroadcastListInfo(checkSite)
CharterPassengerModel.queryOrder()
} else {
ToastCharterUtils.showShort("司机端拒绝请重新选择")
ToastCharterUtils.showToastShort("司机端拒绝请重新选择")
viewCallback?.hideDataDriverRefuse()
}
RxUtils.disposeSubscribe(subscribeSelectSite)
@@ -201,7 +201,7 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
}
override fun onFail(code: Int, msg: String) {
ToastCharterUtils.showShort("查询线路失败")
ToastCharterUtils.showToastShort("查询线路失败")
viewCallback?.setVisableByTrun(showNetError = true)
}
@@ -214,7 +214,7 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
fun changeSites(siteList: MutableList<SiteInfoResponse.SiteInfo>) {
if (!CallerTelematicManager.getClientConnStatus()) {
ToastCharterUtils.showLong("乘客屏无法连接司机屏请联系安全员")
ToastCharterUtils.showToastLong("乘客屏无法连接司机屏请联系安全员")
return
}
val sentDataSite: MutableList<LineSite> = mutableListOf()
@@ -249,7 +249,7 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
RxUtils.disposeSubscribe(subscribeSelectSite)
subscribeSelectSite = RxUtils.createSubscribe(120_000) {
ToastCharterUtils.showShort("请联系安全员确认")
ToastCharterUtils.showToastShort("请联系安全员确认")
viewCallback?.hideDataDriverRefuse()
}
}
@@ -297,13 +297,13 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
}
override fun onFail(code: Int, msg: String?) {
ToastCharterUtils.showShort("查询站点失败")
ToastCharterUtils.showToastShort("查询站点失败")
viewCallback?.setVisableByTrun(showNetError = true)
}
override fun onError() {
super.onError()
ToastCharterUtils.showShort("查询站点失败")
ToastCharterUtils.showToastShort("查询站点失败")
viewCallback?.setVisableByTrun(showNetError = true)
}
})
@@ -311,7 +311,7 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
private fun checkServerStatus() {
if (!CallerTelematicManager.getClientConnStatus()) {
ToastCharterUtils.showShort("断开和司机端连接、请联系安全员")
ToastCharterUtils.showToastShort("断开和司机端连接、请联系安全员")
BizLoopManager.removeLoopFunction(TAGLINELOOP)
viewCallback?.hideDataDriverRefuse()
CallerLogger.d(
@@ -383,21 +383,21 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
}
else -> {
ToastCharterUtils.showShort("自动驾驶中无法切换线路")
ToastCharterUtils.showToastShort("自动驾驶中无法切换线路")
false
}
}
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法切换线路")
ToastCharterUtils.showToastShort("因车辆正在平行驾驶中无法切换线路")
return false
}
else -> {}
}
} else {
ToastCharterUtils.showShort("请停车后再修改目的地~")
ToastCharterUtils.showToastShort("请停车后再修改目的地~")
return false
}
return true

View File

@@ -8,7 +8,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.event.EventLineSites
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
@@ -95,9 +95,9 @@ class OrderSiteItemAdapter(
checkChangeListener?.onCheckListener(tempInfo)
} else {
if (siteInfo.isNear) {
ToastCharterUtils.showShort("您已在此站点附近")
ToastCharterUtils.showToastShort("您已在此站点附近")
} else {
ToastCharterUtils.showShort("站点已过,请选择返程路线")
ToastCharterUtils.showToastShort("站点已过,请选择返程路线")
}
}
}

View File

@@ -33,7 +33,7 @@ import com.mogo.och.bus.passenger.ui.selectline.layoutmanage.PickerLayoutManager
import com.mogo.och.bus.passenger.ui.softcontrol.adapter.TemperatureAdapter
import com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage.HorizontalDecoration
import com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage.PagerCenterSnapHelper
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.utils.SoundPoolHelper
import com.mogo.och.common.module.wigets.MineGradientDrawable
@@ -385,11 +385,11 @@ class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallba
if (leftLight) {
tv_light_top_01.text = context.getString(R.string.bus_p_m1_close_light1)
tv_light_top_01.isChecked = true
if (!isFirst) ToastCharterUtils.showShort("打开顶灯1")
if (!isFirst) ToastCharterUtils.showToastShort("打开顶灯1")
} else {
tv_light_top_01.text = context.getString(R.string.bus_p_m1_open_light1)
tv_light_top_01.isChecked = false
if (!isFirst) ToastCharterUtils.showShort("关闭顶灯1")
if (!isFirst) ToastCharterUtils.showToastShort("关闭顶灯1")
}
}
}
@@ -399,11 +399,11 @@ class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallba
if (rightLight) {
tv_light_top_02.text = context.getString(R.string.bus_p_m1_close_light2)
tv_light_top_02.isChecked = true
if (!isFirst) ToastCharterUtils.showShort("打开顶灯2")
if (!isFirst) ToastCharterUtils.showToastShort("打开顶灯2")
} else {
tv_light_top_02.text = context.getString(R.string.bus_p_m1_open_light2)
tv_light_top_02.isChecked = false
if (!isFirst) ToastCharterUtils.showShort("关闭顶灯2")
if (!isFirst) ToastCharterUtils.showToastShort("关闭顶灯2")
}
}
}
@@ -414,12 +414,12 @@ class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallba
tv_light_atmosphere.text = context.getString(R.string.bus_p_m1_close_atmosphere)
tv_light_atmosphere.isChecked = true
iv_bottom_light_setting.setImageResource(R.drawable.bus_p_function_atmosphere_select)
if (!isFirst) ToastCharterUtils.showShort("打开氛围灯")
if (!isFirst) ToastCharterUtils.showToastShort("打开氛围灯")
} else {
tv_light_atmosphere.text = context.getString(R.string.bus_p_m1_open_atmosphere)
tv_light_atmosphere.isChecked = false
iv_bottom_light_setting.setImageResource(R.drawable.bus_p_function_atmosphere_nor)
if (!isFirst) ToastCharterUtils.showShort("关闭氛围灯")
if (!isFirst) ToastCharterUtils.showToastShort("关闭氛围灯")
}
}
}

View File

@@ -5,7 +5,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorCallback
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorStatusManager
import com.mogo.och.common.module.manager.devicemanage.data.AirconditionStatus
@@ -146,7 +146,7 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
RxUtils.disposeSubscribe(airconditionDisposable)
airconditionDisposable = RxUtils.createSubscribe(10000) {
if (!LightAirconditionDoorStatusManager.airconditionStatus.isOpen && LightAirconditionDoorStatusManager.airconditionStatus.windSpeed != windSpeedCmd && LightAirconditionDoorStatusManager.airconditionStatus.temperature != temperatureCmd && LightAirconditionDoorStatusManager.airconditionStatus.pattert != modeCmd) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -159,7 +159,7 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
RxUtils.disposeSubscribe(airconditionDisposable)
airconditionDisposable = RxUtils.createSubscribe(10000) {
if (LightAirconditionDoorStatusManager.airconditionStatus.isOpen) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -173,7 +173,7 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
RxUtils.disposeSubscribe(heaterDisposable)
heaterDisposable = RxUtils.createSubscribe(10000) {
if (!LightAirconditionDoorStatusManager.heaterStatue.isOpen && LightAirconditionDoorStatusManager.heaterStatue.windSpeed != windSpeedCmd) {
ToastCharterUtils.showShort("暖风机操作未生效,请稍后重试吧~")
ToastCharterUtils.showToastShort("暖风机操作未生效,请稍后重试吧~")
}
}
}
@@ -184,7 +184,7 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
RxUtils.disposeSubscribe(heaterDisposable)
heaterDisposable = RxUtils.createSubscribe(10000) {
if (LightAirconditionDoorStatusManager.heaterStatue.isOpen) {
ToastCharterUtils.showShort("暖风机操作未生效,请稍后重试吧~")//还是开着的
ToastCharterUtils.showToastShort("暖风机操作未生效,请稍后重试吧~")//还是开着的
}
}
}
@@ -196,14 +196,14 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp1Cmd(1)
RxUtils.createSubscribe {
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenLight1) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
} else {
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp1Cmd(2)
RxUtils.createSubscribe {
if (LightAirconditionDoorStatusManager.lightStatus.isOpenLight1) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -216,14 +216,14 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp2Cmd(1)
RxUtils.createSubscribe {
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenLight2) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
} else {
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp2Cmd(2)
RxUtils.createSubscribe {
if (LightAirconditionDoorStatusManager.lightStatus.isOpenLight2) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
}
@@ -236,14 +236,14 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback {
CallerAutoPilotControlManager.sendRoboBusJinlvM1SmallLampCmd(1)
RxUtils.createSubscribe {
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenatmosphere) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
} else {
CallerAutoPilotControlManager.sendRoboBusJinlvM1SmallLampCmd(2)
RxUtils.createSubscribe {
if (LightAirconditionDoorStatusManager.lightStatus.isOpenatmosphere) {
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
ToastCharterUtils.showToastShort("控制系统繁忙,请稍后再试")
}
}
}

View File

@@ -18,7 +18,7 @@ import androidx.appcompat.widget.AppCompatImageView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.app.ActivityCompat
import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.utils.FullVideoUtils
@@ -141,7 +141,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
override fun setStateAndUi(state: Int) {
super.setStateAndUi(state)
if(state==CURRENT_STATE_PLAYING_BUFFERING_START){
ToastCharterUtils.showShort("加载中请稍等")
ToastCharterUtils.showToastShort("加载中请稍等")
}
}
@@ -267,7 +267,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
override fun onError(what: Int, extra: Int) {
super.onError(what, extra)
mThumbImageViewLayout?.visibility = View.VISIBLE
ToastCharterUtils.showLong("哎呀,出错了,看看其他视频吧")
ToastCharterUtils.showToastLong("哎呀,出错了,看看其他视频吧")
currentTime = -1
if(isIfCurrentIsFullscreen){
smalllPlayer?.clearFullscreenLayout(this)

View File

@@ -10,7 +10,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.mogo.och.bus.passenger.utils.ToastCharterUtils;
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.bean.TaxiPassengerVideoPlay;
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack;
@@ -102,12 +102,12 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
@Override
public void onPlayError(String url, Object... objects) {
ToastCharterUtils.INSTANCE.showLong("哎呀,出错了,看看其他视频吧");
ToastCharterUtils.INSTANCE.showCharterLongToast("哎呀,出错了,看看其他视频吧");
}
@Override
public void onClickStartError(String url, Object... objects) {
ToastCharterUtils.INSTANCE.showLong("哎呀,出错了,看看其他视频吧");
ToastCharterUtils.INSTANCE.showCharterLongToast("哎呀,出错了,看看其他视频吧");
}
});
}

View File

@@ -1,66 +0,0 @@
package com.mogo.och.bus.passenger.utils
import android.view.View
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.passenger.ui.toast.ToastCharterView
import me.jessyan.autosize.utils.AutoSizeUtils
object ToastCharterUtils {
const val TAG = "ToastCharterUtils"
fun showTaost(toastText: String) {
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 145f),
View.MeasureSpec.UNSPECIFIED
),
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 34f),
View.MeasureSpec.EXACTLY
)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showShort(marker)
}
fun showLong(toastText: String) {
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 145f),
View.MeasureSpec.UNSPECIFIED
),
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 34f),
View.MeasureSpec.EXACTLY
)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showLong(marker)
}
fun showShort(toastText: String?) {
toastText?.let {
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 145f),
View.MeasureSpec.UNSPECIFIED
),
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 34f),
View.MeasureSpec.EXACTLY
)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showShort(marker)
}
}
}

View File

@@ -16,6 +16,7 @@ import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonServiceManager
import com.mogo.och.common.module.utils.ToastUtilsOch
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
/**
* Created by pangfan on 2021/8/19
@@ -63,20 +64,20 @@ object OchCommonLoginModel {
override fun onSuccess(data: BaseData?) {
if (null != data && 0 == data.code) {
// 获取验证码成功
ToastUtils.showShort(mContext?.getString(R.string.module_och_taxi_login_get_code_success))
ToastCharterUtils.showToastShort(mContext?.getString(R.string.module_och_taxi_login_get_code_success))
iTaxiLoginCallback?.getPhoneCodeSuccess()
} else {
if (data != null) {
ToastUtils.showShort(data.code)
ToastCharterUtils.showToastShort(data.code.toString())
}
}
}
override fun onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort(mContext?.getString(R.string.network_error_tip))
ToastCharterUtils.showToastShort(mContext?.getString(R.string.network_error_tip))
} else {
ToastUtils.showShort(mContext?.getString(R.string.request_error_tip))
ToastCharterUtils.showToastShort(mContext?.getString(R.string.request_error_tip))
}
}
@@ -97,7 +98,7 @@ object OchCommonLoginModel {
override fun onSuccess(data: TaxiLoginRespBean?) {
if (null != data && 0 == data.code) {
// 获取验证码成功
ToastUtils.showShort(mContext?.getString(R.string.module_och_taxi_login_login_success))
ToastCharterUtils.showToastShort(mContext?.getString(R.string.module_och_taxi_login_login_success))
LoginStatusManager.setLoginStatus(TaxiLoginStatusEnum.Login)
mContext?.let {
SharedPrefs.getInstance(it).putString("och_account", phone)
@@ -105,16 +106,16 @@ object OchCommonLoginModel {
iTaxiLoginCallback?.loginSuccess()
} else {
if (data != null) {
ToastUtils.showShort(data.code)
ToastCharterUtils.showToastShort(data.code.toString())
}
}
}
override fun onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort(mContext?.getString(R.string.network_error_tip))
ToastCharterUtils.showToastShort(mContext?.getString(R.string.network_error_tip))
} else {
ToastUtils.showShort(mContext?.getString(R.string.request_error_tip))
ToastCharterUtils.showToastShort(mContext?.getString(R.string.request_error_tip))
}
}

View File

@@ -17,6 +17,7 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.biz.network.OchCommonServiceManager;
import com.mogo.och.common.module.utils.ToastUtilsOch;
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
import java.util.concurrent.TimeUnit;
@@ -67,9 +68,9 @@ public abstract class OchCommonLoginStatusModel {
@Override
public void onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
ToastCharterUtils.showToastShort(mContext.getString(R.string.network_error_tip));
} else {
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
ToastCharterUtils.showToastShort(mContext.getString(R.string.request_error_tip));
}
subscribe = Observable.timer(5, TimeUnit.SECONDS).subscribe(aLong -> {
queryCarStatus();
@@ -106,9 +107,9 @@ public abstract class OchCommonLoginStatusModel {
@Override
public void onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
ToastCharterUtils.showToastShort(mContext.getString(R.string.network_error_tip));
} else {
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
ToastCharterUtils.showToastShort(mContext.getString(R.string.request_error_tip));
}
}

View File

@@ -6,11 +6,11 @@ import com.mogo.commons.mvp.Presenter
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.RegexUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.biz.ui.TaxiLoginDialogFragment
import com.mogo.och.common.module.biz.callback.ITaxiLoginCallback
import com.mogo.och.common.module.biz.model.OchCommonLoginModel
import com.mogo.och.common.module.biz.ui.TaxiLoginDialogFragment
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
@@ -42,7 +42,7 @@ class OchCommonLoginPresenter(view: TaxiLoginDialogFragment?) :
initListeners()
}
if (!RegexUtils.isMobileExact(phone)) {
ToastUtils.showShort(R.string.module_och_taxi_login_phone_error)
ToastCharterUtils.showToastShort(R.string.module_och_taxi_login_phone_error)
mView?.inputPhoneError()
return
}
@@ -98,12 +98,12 @@ class OchCommonLoginPresenter(view: TaxiLoginDialogFragment?) :
initListeners()
}
if (!RegexUtils.isMobileExact(phone)) {
ToastUtils.showShort(R.string.module_och_taxi_login_phone_error)
ToastCharterUtils.showToastShort(R.string.module_och_taxi_login_phone_error)
mView?.inputPhoneError()
return
}
if(code.isBlank()||code.length<4){
ToastUtils.showShort(R.string.module_och_taxi_login_code_error)
ToastCharterUtils.showToastShort(R.string.module_och_taxi_login_code_error)
return
}
mView?.closeSoftInput()

View File

@@ -9,8 +9,8 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.utils.PermissionUtil
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
@@ -36,9 +36,9 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
return@observable
}
if (newValue) {
ToastUtils.showLong("长链接状态恢复")
ToastCharterUtils.showToastLong("长链接状态恢复")
} else {
ToastUtils.showLong("长链接异常,请开启相应权限或者查看网络")
ToastCharterUtils.showToastLong("长链接异常,请开启相应权限或者查看网络")
}
}
@@ -88,7 +88,7 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
i(TAG, "abnormal_factors_Str = $toastStr")
if (!FunctionBuildConfig.isDemoMode && toastStr !== "") {
ToastUtils.showLong(toastStr + "请开启相应权限或者查看网络")
ToastCharterUtils.showToastLong(toastStr + "请开启相应权限或者查看网络")
}
}

View File

@@ -17,8 +17,8 @@ import com.mogo.eagle.core.utilcode.util.AppStateManager
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.eagle.core.utilcode.util.KeyboardUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import kotlinx.android.synthetic.main.m1_debugview_pass.*
/**
@@ -43,7 +43,7 @@ class DebugViewWatchDogFragment :
actv_password_submit.setOnClickListener {
val text = acet_close.text
if(text==null||text.isEmpty()){
ToastUtils.showShort("请输入密码")
ToastCharterUtils.showToastShort("请输入密码")
}else{
if(text.toString() == "123987"){
dismissAllowingStateLoss()
@@ -52,7 +52,7 @@ class DebugViewWatchDogFragment :
}
ToggleDebugView.toggleDebugView.toggle(requireContext())
}else{
ToastUtils.showShort("请输入正确密码")
ToastCharterUtils.showToastShort("请输入正确密码")
}
}
}

View File

@@ -8,6 +8,7 @@ import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg
import com.mogo.och.common.module.manager.LanSocketManager
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.voice.VoiceNotice
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import io.reactivex.disposables.Disposable
object LightAirconditionDoorManager {
@@ -19,7 +20,7 @@ object LightAirconditionDoorManager {
fun go2OpenDoor(go2Open:Boolean){
val canOpenOrCloseDoor = canOpenOrCloseDoor()
if(!canOpenOrCloseDoor.isNullOrBlank()){
ToastUtils.showLong(canOpenOrCloseDoor)
ToastCharterUtils.showToastLong(canOpenOrCloseDoor)
return
}
RxUtils.disposeSubscribe(dooorSubscribe)
@@ -35,7 +36,7 @@ object LightAirconditionDoorManager {
doorStatusSubscribe = RxUtils.createSubscribe(6000) {
if (LightAirconditionDoorStatusManager.doorStatus.isOpen) {
if(!go2Open) {// 关门失败
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
ToastCharterUtils.showToastShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0
@@ -44,7 +45,7 @@ object LightAirconditionDoorManager {
}
}else{
if(go2Open) {//开门失败
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
ToastCharterUtils.showToastShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0

View File

@@ -24,8 +24,8 @@ import com.amap.api.navi.model.NaviInfo;
import com.amap.api.navi.model.NaviLatLng;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.common.module.utils.PermissionUtil;
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
import java.util.ArrayList;
import java.util.List;
@@ -47,6 +47,7 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
private ICommonNaviChangedCallback mNaviChangedCallback;
private AtomicInteger errorCount = new AtomicInteger(0);
private boolean isPlay;
public static AmapNaviToDestinationModel getInstance(Context context) {
mContext = context;
return SingletonHolder.INSTANCE;
@@ -55,25 +56,28 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
private static final class SingletonHolder {
private static final AmapNaviToDestinationModel INSTANCE = new AmapNaviToDestinationModel();
}
private AmapNaviToDestinationModel(){
private AmapNaviToDestinationModel() {
}
public void initAMapNavi(NaviLatLng startLatLng,NaviLatLng endLatLng) {
public void initAMapNavi(NaviLatLng startLatLng, NaviLatLng endLatLng) {
try {
mAMapNavi = AMapNavi.getInstance(mContext);
mAMapNavi.addAMapNaviListener(this);
mAMapNavi.setUseInnerVoice(true, true);
sList.add(startLatLng);
eList.add(endLatLng);
}catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
}
public void setVoiceIsMute(boolean isPlay){
public void setVoiceIsMute(boolean isPlay) {
if (mAMapNavi == null) return;
this.isPlay = isPlay;
if (isPlay){
if (isPlay) {
mAMapNavi.startSpeak();
}else {
} else {
mAMapNavi.stopSpeak();
}
}
@@ -82,8 +86,8 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
return mAMapNavi;
}
public void destroyAmaNavi(){
if (mAMapNavi != null){
public void destroyAmaNavi() {
if (mAMapNavi != null) {
isPlay = false;
sList.clear();
eList.clear();
@@ -94,9 +98,10 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
}
}
public void setOCHTaciNaviChangedCallback(ICommonNaviChangedCallback callback){
public void setOCHTaciNaviChangedCallback(ICommonNaviChangedCallback callback) {
this.mNaviChangedCallback = callback;
}
@Override
public void onInitNaviFailure() {
Toast.makeText(mContext, "init navi Failed", Toast.LENGTH_SHORT).show();
@@ -126,6 +131,7 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
}
mAMapNavi.calculateDriveRoute(sList, eList, mWayPointList, strategy);
}
@Override
public void onCalculateRouteSuccess(int[] ints) {
//多路径算路成功回调
@@ -135,9 +141,9 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
@Override
public void onNaviInfoUpdate(NaviInfo naviinfo) {
//导航过程中的信息更新请看NaviInfo的具体说明
if (null != mNaviChangedCallback){
if (null != mNaviChangedCallback) {
CallerLogger.i(M_TAXI + TAG, "距离=" + naviinfo.getPathRetainDistance() + ", 剩余时间 " + naviinfo.getPathRetainTime());
mNaviChangedCallback.onCurrentNaviDistAndTimeChanged(naviinfo.getPathRetainDistance(),naviinfo.getPathRetainTime());// 米、秒
mNaviChangedCallback.onCurrentNaviDistAndTimeChanged(naviinfo.getPathRetainDistance(), naviinfo.getPathRetainTime());// 米、秒
}
}
@@ -150,23 +156,23 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
public void onCalculateRouteFailure(AMapCalcRouteResult result) {
//路线计算失败
//多路径算路成功回调
if (errorCount.get() < 5){
if (errorCount.get() < 5) {
errorCount.getAndIncrement();
if (mNaviChangedCallback != null){
mNaviChangedCallback.reInitNaviAmap(isPlay,true);
if (mNaviChangedCallback != null) {
mNaviChangedCallback.reInitNaviAmap(isPlay, true);
}
}
if (!NetworkUtils.isConnected(mContext) || result.getErrorCode() == 2){
ToastUtils.showShort("网络异常,请重试");
if (mNaviChangedCallback != null){
mNaviChangedCallback.reInitNaviAmap(isPlay,false);
if (!NetworkUtils.isConnected(mContext) || result.getErrorCode() == 2) {
ToastCharterUtils.showToastShort("网络异常,请重试");
if (mNaviChangedCallback != null) {
mNaviChangedCallback.reInitNaviAmap(isPlay, false);
}
return;
}
if (!PermissionUtil.isLocServiceEnable(mContext) || !PermissionUtil.checkPermission(mContext,new String[]{Manifest.permission.ACCESS_FINE_LOCATION})){
ToastUtils.showShort("请开启车机定位后重试");
if (mNaviChangedCallback != null){
mNaviChangedCallback.reInitNaviAmap(isPlay,false);
if (!PermissionUtil.isLocServiceEnable(mContext) || !PermissionUtil.checkPermission(mContext, new String[]{Manifest.permission.ACCESS_FINE_LOCATION})) {
ToastCharterUtils.showToastShort("请开启车机定位后重试");
if (mNaviChangedCallback != null) {
mNaviChangedCallback.reInitNaviAmap(isPlay, false);
}
return;
}
@@ -174,6 +180,7 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
CallerLogger.i(M_TAXI + TAG, "路线计算失败:错误码=" + result.getErrorCode() + ",Error Message= " + result.getErrorDetail());
CallerLogger.i(M_TAXI + TAG, "错误码详细链接见http://lbs.amap.com/api/android-navi-sdk/guide/tools/errorcode/");
}
@Override
public void onStartNavi(int type) {
//开始导航回调
@@ -233,6 +240,7 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
public void onGpsOpenStatus(boolean enabled) {
//GPS开关状态回调
}
@Override
public void showModeCross(AMapModelCross aMapModelCross) {
}

View File

@@ -4,7 +4,7 @@ import android.content.Context;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
public class ToastUtilsOch {
@@ -17,9 +17,9 @@ public class ToastUtilsOch {
return;
}
if (DebugConfig.isDebug()) {
ToastUtils.showShort(code+","+message);
ToastCharterUtils.showToastShort(code+","+message);
}else {
ToastUtils.showShort(message);
ToastCharterUtils.showToastShort(message);
}
}
@@ -36,9 +36,9 @@ public class ToastUtilsOch {
public static void toastRequestError(Context context,String failMsg){
if (!NetworkUtils.isConnected(context)) {
ToastUtils.showShort("网络异常,请稍后重试");
ToastCharterUtils.showToastShort("网络异常,请稍后重试");
}else {
ToastUtils.showShort(failMsg);
ToastCharterUtils.showToastShort(failMsg);
}
}
}

View File

@@ -0,0 +1,91 @@
package com.mogo.och.common.module.wigets.toast
import android.view.Gravity
import android.view.View
import androidx.annotation.StringRes
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import me.jessyan.autosize.utils.AutoSizeUtils
object ToastCharterUtils {
const val TAG = "ToastCharterUtils"
private val toastUtils = ToastUtils().setGravity(Gravity.CENTER, 0, 0)
@JvmStatic
fun showToastLong(toastText: String){
if (AppIdentityModeUtils.isCharterPassenger(FunctionBuildConfig.appIdentityMode)) {
showCharterLongToast(toastText)
}else{
ToastUtils.showLong(toastText)
}
}
@JvmStatic
fun showToastShort(toastText: String?){
toastText?.let {
if (AppIdentityModeUtils.isCharterPassenger(FunctionBuildConfig.appIdentityMode)) {
showCharterShortToast(toastText)
}else{
ToastUtils.showShort(toastText)
}
}
}
@JvmStatic
fun showToastShort(@StringRes resId: Int, vararg args: Any?) {
val string = StringUtils.getString(resId, args)
string?.let {
showToastShort(it)
}
}
@JvmStatic
fun showToastShort(@StringRes resId: Int) {
val string = StringUtils.getString(resId)
string?.let {
showToastShort(it)
}
}
fun showCharterLongToast(toastText: String) {
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 145f),
View.MeasureSpec.UNSPECIFIED
),
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 34f),
View.MeasureSpec.EXACTLY
)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showLongWithmarker(marker, toastUtils)
}
private fun showCharterShortToast(toastText: String?) {
toastText?.let {
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)
marker.setText(toastText)
marker.measure(
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 145f),
View.MeasureSpec.UNSPECIFIED
),
View.MeasureSpec.makeMeasureSpec(
AutoSizeUtils.dp2px(context, 34f),
View.MeasureSpec.EXACTLY
)
)
marker.layout(0, 0, marker.measuredWidth, marker.measuredHeight)
ToastUtils.showShortWithmarker(marker, toastUtils)
}
}
}

View File

@@ -1,10 +1,10 @@
package com.mogo.och.bus.passenger.ui.toast
package com.mogo.och.common.module.wigets.toast
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.och.bus.passenger.R
import com.mogo.och.common.module.R
import kotlinx.android.synthetic.main.charter_p_view_toast.view.*
class ToastCharterView @JvmOverloads constructor(

View File

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

View File

@@ -17,9 +17,8 @@
android:paddingTop="@dimen/dp_16"
android:paddingEnd="@dimen/dp_31"
android:paddingBottom="@dimen/dp_16"
android:textColor="@color/bus_p_m1_203555"
android:textColor="@color/common_203555"
android:textSize="25dp"
android:layout_marginBottom="@dimen/dp_76"
tools:text="18" />
</LinearLayout>

View File

@@ -20,4 +20,6 @@
<color name="common_e0efff">#E0EFFF</color>
<color name="common_b8c2d7">#B8C2D7</color>
<color name="common_b8c2d8">#B8C2D8</color>
<color name="common_203555">#203555</color>
<color name="common_B3EFF6FF">#B3EFF6FF</color>
</resources>

View File

@@ -32,6 +32,7 @@ object AppIdentityModeUtils {
// 身份
private const val DRIVER = "Driver"
private const val PASSENGER = "Passenger"
// 业务
private const val TAXI = "Taxi"
private const val BUS = "Bus"
@@ -45,7 +46,6 @@ object AppIdentityModeUtils {
private const val JL = "JL"
private fun getInfo(appIdentityMode: String): Array<String> {
val split = appIdentityMode.split("_")
if (split.size == 3) {
@@ -56,7 +56,7 @@ object AppIdentityModeUtils {
fun getBuildCarType(appIdentityMode: String): String {
val (_, _, carType) = getInfo(appIdentityMode)
if(carType.isNotEmpty()){
if (carType.isNotEmpty()) {
return carType
}
return ""
@@ -121,6 +121,7 @@ object AppIdentityModeUtils {
}
return false
}
/**
* 是否是 接驳车(这里不细分具体是:司机、乘客等类型)
*
@@ -131,6 +132,7 @@ object AppIdentityModeUtils {
fun isShuttlePassenger(appIdentityMode: String): Boolean {
return isShuttle(appIdentityMode) && isPassenger(appIdentityMode)
}
@JvmStatic
fun isM2(appIdentityMode: String): Boolean {
val (_, _, model) = getInfo(appIdentityMode)
@@ -241,6 +243,12 @@ object AppIdentityModeUtils {
}
return false
}
@JvmStatic
fun isCharterPassenger(appIdentityMode: String): Boolean {
return isCharter(appIdentityMode) && isPassenger(appIdentityMode)
}
@JvmStatic
fun isM1(appIdentityMode: String): Boolean {
val (_, _, model) = getInfo(appIdentityMode)
@@ -262,8 +270,8 @@ object AppIdentityModeUtils {
}
}
enum class Product{
BUS,TAXI,SWEEPER,SHUTTLE,CHARTER
enum class Product {
BUS, TAXI, SWEEPER, SHUTTLE, CHARTER
}
}

View File

@@ -464,6 +464,13 @@ public final class ToastUtils {
}
}
public static void showShortWithmarker(@Nullable final View view,@Nullable final ToastUtils marker) {
if(view!=null){
show(view, Toast.LENGTH_SHORT, marker);
}else {
}
}
/**
* Show the toast for a short period of time.
*
@@ -471,6 +478,9 @@ public final class ToastUtils {
public static void showLong(@Nullable final View view) {
show(view, Toast.LENGTH_LONG, DEFAULT_MAKER);
}
public static void showLongWithmarker(@Nullable final View view,@Nullable final ToastUtils marker) {
show(view, Toast.LENGTH_LONG, marker);
}
/**