[5.0.0]
[包车Fragment转换为view]
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
package com.mogo.och.bus.passenger;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
|
||||
/**
|
||||
* 网约车抽象接口
|
||||
*
|
||||
* Created on 2022/3/29
|
||||
*/
|
||||
interface IMogoOCH extends IMoGoFunctionProvider {
|
||||
|
||||
/**
|
||||
* 初始化网约车容器
|
||||
*
|
||||
* @param activity
|
||||
* @param containerId 容器ID
|
||||
*/
|
||||
void createCoverage(FragmentActivity activity, @IdRes int containerId);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.stepInDayMode
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
@@ -18,11 +19,10 @@ import com.mogo.och.bus.passenger.ui.MainFragment
|
||||
* Created on 2022/3/29
|
||||
*/
|
||||
@Route(path = CharterPassengerConst.PATH)
|
||||
class MogoOCHBusPassenger : IMogoOCH {
|
||||
class MogoOCHBusPassenger : IMoGoFunctionProvider {
|
||||
private var mActivity: FragmentActivity? = null
|
||||
private var mContainerId = 0
|
||||
private var mPassengerFragment: MainFragment? = null
|
||||
override fun createCoverage(activity: FragmentActivity, containerId: Int) {}
|
||||
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||
mActivity = activity
|
||||
mContainerId = containerId!!
|
||||
@@ -42,15 +42,6 @@ class MogoOCHBusPassenger : IMogoOCH {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private fun stepIntoVrMode() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "进入vr模式")
|
||||
getMapUIController()?.stepInVrMode(true) // 白天模式
|
||||
stepInDayMode() //白天模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private fun showFragment() {
|
||||
val supportFragmentManager: FragmentManager? = mActivity?.supportFragmentManager
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.mogo.och.bus.passenger.callback
|
||||
|
||||
interface IClearViewCallback {
|
||||
fun goneAllView()
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1OrderLineFragment
|
||||
import com.mogo.och.bus.passenger.ui.selectline.M1OrderLineFragment
|
||||
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
|
||||
|
||||
@@ -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
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1SoftFragment
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.M1SoftFragment
|
||||
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorCallback
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorStatusManager
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1VideoFragment
|
||||
import com.mogo.och.bus.passenger.ui.video.M1VideoFragment
|
||||
|
||||
class BusPassengerFunctionVideoPresenter(view: M1VideoFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<M1VideoFragment?>(view)
|
||||
@@ -32,8 +32,8 @@ 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.view.MakerWithSiteName
|
||||
import com.mogo.och.bus.passenger.view.MakerWithSiteNamewithCheck
|
||||
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
|
||||
import com.mogo.och.common.module.manager.StopSideStatusManager
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorCallback
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
|
||||
import com.mogo.och.bus.passenger.callback.ITimeCallback
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.OrderInfoFragment
|
||||
import com.mogo.och.bus.passenger.ui.orderinfo.OrderInfoFragment
|
||||
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
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.och.bus.passenger.provider;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.och.bus.passenger.view.statusbar.StatusBarView;
|
||||
import com.mogo.och.bus.passenger.ui.statusbar.StatusBarView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
|
||||
@@ -22,14 +22,18 @@ import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.event.DebugView
|
||||
import com.mogo.och.bus.passenger.bean.event.EventLineSites
|
||||
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
|
||||
import com.mogo.och.bus.passenger.callback.IClearViewCallback
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerPresenter
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomBar
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
|
||||
import com.mogo.och.common.module.manager.debug.DebugViewWatchDogFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.M1CarUserNoOrderFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.M1ContainFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.NoviceGuidanceFragment
|
||||
import com.mogo.och.bus.passenger.view.statusbar.StatusBarView
|
||||
import com.mogo.och.bus.passenger.ui.statusbar.StatusBarView
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import kotlinx.android.synthetic.main.m1_contain_fragment.bb_bottom_bar
|
||||
import kotlinx.android.synthetic.main.m1_main_fragment.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
@@ -55,6 +59,12 @@ class MainFragment :
|
||||
BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources,
|
||||
R.drawable.charter_p_trajectory_line)
|
||||
|
||||
private val goneView = object : IClearViewCallback{
|
||||
override fun goneAllView() {
|
||||
bb_boorombar.setCheckIndex(BottomBar.SelectView.NONE)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.m1_main_fragment
|
||||
}
|
||||
@@ -89,23 +99,28 @@ class MainFragment :
|
||||
|
||||
})
|
||||
|
||||
bb_boorombar.setSettingClickListener{
|
||||
openSettingPage(M1ContainFragment.SETTINGSOFTTAB)
|
||||
}
|
||||
bb_boorombar.setOrderInfoClickListener{
|
||||
if (LoginStatusManager.isLogin()) {
|
||||
if(mPresenter?.haveOrder()==true){
|
||||
openSettingPage(M1ContainFragment.ORDERINFO)
|
||||
}else{
|
||||
ToastCharterUtils.showShort("请确认订单")
|
||||
bb_boorombar.setCheckChangeListener(object :BottomBar.ApplyClickLintener{
|
||||
override fun onApplyClick(selectItem: BottomBar.SelectView) {
|
||||
when (selectItem) {
|
||||
BottomBar.SelectView.ORDERINFO -> showBizView(orderinfo = true)
|
||||
BottomBar.SelectView.SETTING -> showBizView(softControl = true)
|
||||
BottomBar.SelectView.LINE -> showBizView(selectLine = true)
|
||||
//BottomBar.SelectView.VIDEO -> TODO()
|
||||
else ->{
|
||||
showBizView()
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ToastCharterUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
|
||||
}
|
||||
}
|
||||
bb_boorombar.setLineClickListener{
|
||||
openSettingPage(M1ContainFragment.SELECTLINE)
|
||||
}
|
||||
})
|
||||
bb_boorombar.setApplyClickListener(object : BottomClickView.ApplyClickLintener{
|
||||
override fun onApplyClick() {
|
||||
bb_boorombar.setCheckIndex(BottomBar.SelectView.NONE)
|
||||
}
|
||||
})
|
||||
biz_orderinfo.goneViewListener = goneView
|
||||
biz_softcontrol.goneViewListener = goneView
|
||||
biz_selectline.goneViewListener = goneView
|
||||
|
||||
aciv_enter_video.setOnClickListener{
|
||||
openSettingPage(M1ContainFragment.VIDEOTAB)
|
||||
}
|
||||
@@ -150,6 +165,24 @@ class MainFragment :
|
||||
}
|
||||
}
|
||||
|
||||
private fun showBizView(orderinfo:Boolean=false,softControl:Boolean=false,selectLine:Boolean=false){
|
||||
if(orderinfo){
|
||||
biz_orderinfo.visibility = View.VISIBLE
|
||||
}else{
|
||||
biz_orderinfo.visibility = View.GONE
|
||||
}
|
||||
if(softControl){
|
||||
biz_softcontrol.visibility = View.VISIBLE
|
||||
}else{
|
||||
biz_softcontrol.visibility = View.GONE
|
||||
}
|
||||
if(selectLine){
|
||||
biz_selectline.visibility = View.VISIBLE
|
||||
}else{
|
||||
biz_selectline.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun openSettingPage(tab: String) {
|
||||
if (bpFunctionGroupDialogFragment?.get() == null) {
|
||||
bpFunctionGroupDialogFragment = WeakReference(M1ContainFragment.newInstance())
|
||||
@@ -318,6 +351,7 @@ class MainFragment :
|
||||
}
|
||||
|
||||
companion object {
|
||||
public const val TAG = "BusPassengerRouteFragment"
|
||||
const val TAG = "BusPassengerRouteFragment"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom
|
||||
package com.mogo.och.bus.passenger.ui.bottom
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import kotlinx.android.synthetic.main.m1_bottom_bar.view.*
|
||||
|
||||
@@ -18,33 +19,40 @@ class BottomBar @JvmOverloads constructor(
|
||||
setBackgroundResource(R.drawable.charter_p_bottom_bar_bg)
|
||||
}
|
||||
|
||||
private var checkIndex = SelectView.VIDEO
|
||||
private var checkIndex = SelectView.NONE
|
||||
|
||||
private var overMapViewApply:ApplyClickLintener?=null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
cl_order_time.onClick {
|
||||
setCheckIndex(SelectView.ORDERINFO)
|
||||
}
|
||||
actv_setting.onClick {
|
||||
setCheckIndex(SelectView.SETTING)
|
||||
}
|
||||
actv_line.onClick {
|
||||
setCheckIndex(SelectView.LINE)
|
||||
}
|
||||
}
|
||||
fun setOrderInfoClickListener(click:OnClickListener){
|
||||
cl_order_time.setOnClickListener(click)
|
||||
}
|
||||
fun setSettingClickListener(click:OnClickListener){
|
||||
actv_setting.setOnClickListener(click)
|
||||
}
|
||||
fun setLineClickListener(click:OnClickListener){
|
||||
actv_line.setOnClickListener(click)
|
||||
fun setCheckChangeListener(overMapViewApply:ApplyClickLintener){
|
||||
this.overMapViewApply = overMapViewApply
|
||||
}
|
||||
|
||||
fun setApplyClickListener(click:BottomClickView.ApplyClickLintener){
|
||||
fun setApplyClickListener(click: BottomClickView.ApplyClickLintener){
|
||||
aciv_center_image.applyClickListener=click
|
||||
actv_stop_site.applyClickListener=click
|
||||
actv_close_door.applyClickListener=click
|
||||
actv_open_door.applyClickListener=click
|
||||
}
|
||||
|
||||
fun setCheckIndex(index:SelectView){
|
||||
fun setCheckIndex(index: SelectView){
|
||||
if(checkIndex==index){
|
||||
return
|
||||
checkIndex = SelectView.NONE
|
||||
}else{
|
||||
checkIndex = index
|
||||
}
|
||||
checkIndex = index
|
||||
overMapViewApply?.onApplyClick(checkIndex)
|
||||
if(checkIndex == SelectView.ORDERINFO){
|
||||
cl_order_time_press.visibility = VISIBLE
|
||||
cl_order_time.setCheck(true)
|
||||
@@ -66,7 +74,11 @@ class BottomBar @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
enum class SelectView{
|
||||
ORDERINFO,SETTING,LINE,VIDEO
|
||||
NONE,ORDERINFO,SETTING,LINE,VIDEO
|
||||
}
|
||||
|
||||
interface ApplyClickLintener{
|
||||
fun onApplyClick(selectItem:SelectView)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom
|
||||
package com.mogo.och.bus.passenger.ui.bottom
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom
|
||||
package com.mogo.och.bus.passenger.ui.bottom
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
@@ -28,7 +28,7 @@ open class BottomClickView @JvmOverloads constructor(
|
||||
private var normalDrawable: Int = -1
|
||||
private var backageView: View? = null
|
||||
|
||||
var applyClickListener:ApplyClickLintener?=null
|
||||
var applyClickListener: ApplyClickLintener?=null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_bottom_stop_site, this, true)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom
|
||||
package com.mogo.och.bus.passenger.ui.bottom
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -16,7 +16,6 @@ import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import kotlinx.android.synthetic.main.m1_bottom_orderinfo.view.*
|
||||
import java.util.UUID
|
||||
import kotlin.random.Random
|
||||
|
||||
open class BottomOrderInfoView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom.impl
|
||||
package com.mogo.och.bus.passenger.ui.bottom.impl
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorManager
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom.impl
|
||||
package com.mogo.och.bus.passenger.ui.bottom.impl
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
@@ -6,7 +6,6 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
@@ -20,7 +19,7 @@ import com.mogo.och.bus.passenger.utils.ToastCharterUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.callback.ICharterPassengerAutoStatusChangeCallback
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorStatusManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom.impl
|
||||
package com.mogo.och.bus.passenger.ui.bottom.impl
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorManager
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.view.bottom.impl
|
||||
package com.mogo.och.bus.passenger.ui.bottom.impl
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
|
||||
class StopSiteView @JvmOverloads constructor(
|
||||
@@ -17,12 +17,12 @@ import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.event.EventLineSites
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionPresenter
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1OrderLineFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1SoftFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1VideoFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.OrderInfoFragment
|
||||
import com.mogo.och.bus.passenger.ui.view.bottom.BottomBar
|
||||
import com.mogo.och.bus.passenger.ui.view.bottom.BottomClickView
|
||||
import com.mogo.och.bus.passenger.ui.selectline.M1OrderLineFragment
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.M1SoftFragment
|
||||
import com.mogo.och.bus.passenger.ui.video.M1VideoFragment
|
||||
import com.mogo.och.bus.passenger.ui.orderinfo.OrderInfoFragment
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomBar
|
||||
import com.mogo.och.bus.passenger.ui.bottom.BottomClickView
|
||||
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.debug.DebugViewWatchDogFragment
|
||||
@@ -114,45 +114,45 @@ class M1ContainFragment :
|
||||
cl_container.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
bb_bottom_bar.setSettingClickListener{
|
||||
CallerLogger.d(M_BUS_P+ TAG, "initViews---$tab")
|
||||
if(tab==SETTINGSOFTTAB) {
|
||||
dismissAllowingStateLoss()
|
||||
}else{
|
||||
tab = SETTINGSOFTTAB
|
||||
setCheckView()
|
||||
}
|
||||
}
|
||||
bb_bottom_bar.setLineClickListener{
|
||||
CallerLogger.d(M_BUS_P+ TAG, "initViews---$tab")
|
||||
if(tab==SELECTLINE) {
|
||||
dismissAllowingStateLoss()
|
||||
}else{
|
||||
tab = SELECTLINE
|
||||
setCheckView()
|
||||
}
|
||||
}
|
||||
bb_bottom_bar.setOrderInfoClickListener{
|
||||
if (LoginStatusManager.isLogin()) {
|
||||
if(mPresenter?.haveOrder()==true){
|
||||
|
||||
}else{
|
||||
ToastCharterUtils.showShort("请确认订单")
|
||||
return@setOrderInfoClickListener
|
||||
}
|
||||
}else{
|
||||
ToastCharterUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
|
||||
return@setOrderInfoClickListener
|
||||
}
|
||||
|
||||
CallerLogger.d(M_BUS_P+ TAG, "initViews---$tab")
|
||||
if(tab==ORDERINFO) {
|
||||
dismissAllowingStateLoss()
|
||||
}else{
|
||||
tab = ORDERINFO
|
||||
setCheckView()
|
||||
}
|
||||
}
|
||||
// bb_bottom_bar.setSettingClickListener{
|
||||
// CallerLogger.d(M_BUS_P+ TAG, "initViews---$tab")
|
||||
// if(tab==SETTINGSOFTTAB) {
|
||||
// dismissAllowingStateLoss()
|
||||
// }else{
|
||||
// tab = SETTINGSOFTTAB
|
||||
// setCheckView()
|
||||
// }
|
||||
// }
|
||||
// bb_bottom_bar.setLineClickListener{
|
||||
// CallerLogger.d(M_BUS_P+ TAG, "initViews---$tab")
|
||||
// if(tab==SELECTLINE) {
|
||||
// dismissAllowingStateLoss()
|
||||
// }else{
|
||||
// tab = SELECTLINE
|
||||
// setCheckView()
|
||||
// }
|
||||
// }
|
||||
// bb_bottom_bar.setOrderInfoClickListener{
|
||||
// if (LoginStatusManager.isLogin()) {
|
||||
// if(mPresenter?.haveOrder()==true){
|
||||
//
|
||||
// }else{
|
||||
// ToastCharterUtils.showShort("请确认订单")
|
||||
// return@setOrderInfoClickListener
|
||||
// }
|
||||
// }else{
|
||||
// ToastCharterUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
|
||||
// return@setOrderInfoClickListener
|
||||
// }
|
||||
//
|
||||
// CallerLogger.d(M_BUS_P+ TAG, "initViews---$tab")
|
||||
// if(tab==ORDERINFO) {
|
||||
// dismissAllowingStateLoss()
|
||||
// }else{
|
||||
// tab = ORDERINFO
|
||||
// setCheckView()
|
||||
// }
|
||||
// }
|
||||
bb_bottom_bar.setApplyClickListener(object : BottomClickView.ApplyClickLintener{
|
||||
override fun onApplyClick() {
|
||||
dismissAllowingStateLoss()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.dialogfragment.fragment
|
||||
package com.mogo.och.bus.passenger.ui.orderinfo
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.mogo.och.bus.passenger.ui.orderinfo
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.callback.IClearViewCallback
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_contain_order
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_end_order
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_end_order_submit
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_left_time
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_order_phone
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_order_times
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.cl_order_info
|
||||
import kotlinx.android.synthetic.main.m1_devices_fragment.view.cl_order_info_endorder_comfit
|
||||
|
||||
class OrderInfoView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback {
|
||||
|
||||
private val TAG = "OrderInfoView"
|
||||
|
||||
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){
|
||||
initView()
|
||||
}
|
||||
|
||||
var goneViewListener: IClearViewCallback?=null
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_devices_fragment, this, true)
|
||||
onClick {
|
||||
setViewGone()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
|
||||
val viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(OrderInfoViewModel::class.java)
|
||||
}
|
||||
|
||||
viewModel?.setDistanceCallback(this)
|
||||
|
||||
actv_end_order_submit.setOnClickListener {
|
||||
viewModel?.endOrder()
|
||||
}
|
||||
|
||||
actv_contain_order.setOnClickListener {
|
||||
setViewGone()
|
||||
}
|
||||
|
||||
actv_end_order.setOnClickListener {
|
||||
cl_order_info.visibility = View.GONE
|
||||
cl_order_info_endorder_comfit.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
override fun setViewGone(){
|
||||
goneViewListener?.goneAllView()
|
||||
}
|
||||
|
||||
override fun setLeftTime(leftTime:String){
|
||||
actv_left_time.text = "剩余时间 $leftTime"
|
||||
}
|
||||
|
||||
override fun setStartTimeAndEndTime(startTime:String,endTime:String){
|
||||
actv_order_times.text = "$startTime-$endTime"
|
||||
}
|
||||
|
||||
override fun setPhone(phone:String){
|
||||
if(phone.length>8) {
|
||||
//截取电话号码前三位
|
||||
val phoneNumPre = phone.substring(0, 3);
|
||||
//截取电话号码后四位
|
||||
val phoneNumFix = phone.substring(7);
|
||||
actv_order_phone.text = "$phoneNumPre****$phoneNumFix"
|
||||
}else{
|
||||
actv_order_phone.text = phone
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.mogo.och.bus.passenger.ui.orderinfo
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.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.bean.dpmsg.BaseDPMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.EndOrderMsg
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
|
||||
class OrderInfoViewModel: ViewModel(), ITimeCallback {
|
||||
|
||||
private val TAG = OrderInfoViewModel::class.java.simpleName
|
||||
|
||||
private var viewCallback:ItineraryViewCallback?=null
|
||||
|
||||
|
||||
init {
|
||||
CharterPassengerModel.setOrderLeftTimeListeners(TAG,this)
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
this.viewCallback = null
|
||||
CharterPassengerModel.setOrderLeftTimeListeners(TAG,null)
|
||||
}
|
||||
|
||||
fun setDistanceCallback(viewCallback:ItineraryViewCallback){
|
||||
this.viewCallback = viewCallback
|
||||
getDataInfo()
|
||||
}
|
||||
|
||||
private fun getDataInfo() {
|
||||
val currentOrderInfo = CharterPassengerModel.getCurrentOrderInfo()
|
||||
currentOrderInfo?.let {
|
||||
viewCallback?.setPhone(it.passengerPhone?:"")
|
||||
try {
|
||||
viewCallback?.setStartTimeAndEndTime(
|
||||
DateTimeUtil.formatLongToString(it.startTime!!, DateTimeUtil.HH_mm),
|
||||
DateTimeUtil.formatLongToString(it.endTime!!, DateTimeUtil.HH_mm))
|
||||
}catch (e:Exception){
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun setOrderTimeCallBack(timeInSecond: Long) {
|
||||
val leftTime = DateTimeUtil.second2Time(timeInSecond)
|
||||
viewCallback?.setLeftTime(leftTime)
|
||||
}
|
||||
|
||||
|
||||
fun endOrder() {
|
||||
CharterPassengerModel.endOrder(object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (null != data && 0 == data.code) {
|
||||
ToastCharterUtils.showShort("结束成功")
|
||||
CharterPassengerModel.setEndOrderStatus()
|
||||
viewCallback?.setViewGone()
|
||||
val msg = EndOrderMsg(
|
||||
CharterPassengerModel.getCurrentOrderInfo()?.orderNo?:"",
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + BaseDPMsg.TAG, "发送数据:结束订单${msg}")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastCharterUtils.showShort("$code:$msg")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
interface ItineraryViewCallback{
|
||||
fun setPhone(phone:String)
|
||||
fun setViewGone()
|
||||
fun setLeftTime(leftTime:String)
|
||||
fun setStartTimeAndEndTime(startTime:String,endTime:String)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view
|
||||
package com.mogo.och.bus.passenger.ui.overmapview
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
@@ -8,6 +8,9 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import kotlinx.android.synthetic.main.view_maker_sitename.view.*
|
||||
|
||||
/**
|
||||
* 全览地图中使用的view
|
||||
*/
|
||||
class MakerWithSiteName @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
@@ -28,4 +31,4 @@ class MakerWithSiteName @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
data class MakerWithSiteNamewithCheck(var isCheck: Boolean,val makerWithSiteName:MakerWithSiteName,var bitmapView: Bitmap)
|
||||
data class MakerWithSiteNamewithCheck(var isCheck: Boolean, val makerWithSiteName: MakerWithSiteName, var bitmapView: Bitmap)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.dialogfragment.fragment
|
||||
package com.mogo.och.bus.passenger.ui.selectline
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.graphics.drawable.AnimationDrawable
|
||||
@@ -16,12 +16,11 @@ import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionOrderPresenter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderLineItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderSiteItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.selectline.adapter.OrderLineItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.selectline.adapter.OrderSiteItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.M1ContainFragment
|
||||
import com.mogo.och.bus.passenger.view.BottomDecoration
|
||||
import com.mogo.och.bus.passenger.ui.selectline.layoutmanage.BottomDecoration
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.*
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.mogo.och.bus.passenger.ui.selectline
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.AnimationDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.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
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.g_lines_sites_data
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.g_loading_group
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.g_side_cancle_submit_group
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.group_driver_agrenn_line
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.iv_loading_wait_driver
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.lsv_line_site
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.m1_order_loading
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.m1_order_neterror
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.m1_order_noorder
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.rlv_line_list
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.rv_site_list
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.tv_site_cancle
|
||||
import kotlinx.android.synthetic.main.m1_order_fragment.view.tv_site_submit
|
||||
import kotlinx.android.synthetic.main.m1_order_loading.view.iv_loading_wait_ent
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class SelectLineView : ConstraintLayout, SelectLineViewModel.SelectLineViewCallback {
|
||||
|
||||
private val TAG = "OrderInfoView"
|
||||
|
||||
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)
|
||||
|
||||
|
||||
var goneViewListener: IClearViewCallback?=null
|
||||
|
||||
private lateinit var lineAdapter: OrderLineItemAdapter
|
||||
private lateinit var siteAdapter: OrderSiteItemAdapter
|
||||
|
||||
private val lineList = mutableListOf<LineInfoResponse.LineInfo>()
|
||||
private val siteList = mutableListOf<SiteInfoResponse.SiteInfo>()
|
||||
|
||||
private var subscribeDirverAgree: Disposable? = null
|
||||
private var subscribeDirverRefuse: Disposable? = null
|
||||
|
||||
private val loadingAni =
|
||||
ObjectAnimator.ofFloat(iv_loading_wait_ent, "rotation", 0f, 90f, 180f, 270f, 360f)
|
||||
.apply {
|
||||
repeatCount = -1
|
||||
interpolator = LinearInterpolator()
|
||||
duration = 1000
|
||||
}
|
||||
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_order_fragment, this, true)
|
||||
|
||||
onClick {
|
||||
setViewGone()
|
||||
}
|
||||
|
||||
lineAdapter = OrderLineItemAdapter(context, lineList)
|
||||
siteAdapter = OrderSiteItemAdapter(context, siteList)
|
||||
loadingAni.target = iv_loading_wait_ent
|
||||
rlv_line_list.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rlv_line_list.addItemDecoration(
|
||||
BottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 60f)
|
||||
)
|
||||
)
|
||||
rlv_line_list.adapter = lineAdapter
|
||||
|
||||
rv_site_list.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rv_site_list.addItemDecoration(
|
||||
BottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 90f)
|
||||
)
|
||||
)
|
||||
rv_site_list.adapter = siteAdapter
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(SelectLineViewModel::class.java)
|
||||
}
|
||||
|
||||
viewModel?.setVIewCallback(this)
|
||||
|
||||
lineAdapter.checkChangeListener = object : OrderLineItemAdapter.CheckListener {
|
||||
override fun canSwitchLine(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onCheckListener(lineInfo: LineInfoResponse.LineInfo) {
|
||||
viewModel?.checkLineClick(lineInfo)
|
||||
siteAdapter.clearCheck()
|
||||
}
|
||||
}
|
||||
siteAdapter.checkChangeListener = object : OrderSiteItemAdapter.CheckListener {
|
||||
override fun canSwitchLine(): Boolean {
|
||||
return viewModel?.canSwitchLine()?:true
|
||||
}
|
||||
|
||||
override fun onCheckListener(siteInfo: SiteInfoResponse.SiteInfo?) {
|
||||
// 设置临时选中的
|
||||
viewModel?.checkSiteClick(siteInfo)
|
||||
}
|
||||
|
||||
}
|
||||
tv_site_cancle.onClick {
|
||||
viewModel?.resetData()
|
||||
}
|
||||
tv_site_submit.onClick {
|
||||
CharterPassengerModel.switchLine5minWait?.let {
|
||||
if (!it.isDisposed) {
|
||||
ToastCharterUtils.showShort("选择线路后5分钟内不可用选")
|
||||
return@onClick
|
||||
}
|
||||
}
|
||||
viewModel?.changeSites(siteList)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun showSelectData() {
|
||||
UiThreadHandler.post {
|
||||
g_lines_sites_data?.visibility = View.VISIBLE
|
||||
g_loading_group?.visibility = View.GONE
|
||||
group_driver_agrenn_line?.visibility = View.GONE
|
||||
aciv_driver_refuse_group?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun hideDataWaitDriverMsg() {
|
||||
g_lines_sites_data?.visibility = View.GONE
|
||||
g_loading_group?.visibility = View.VISIBLE
|
||||
iv_loading_wait_driver?.let {
|
||||
val animationDrawable = it.drawable as AnimationDrawable
|
||||
animationDrawable.start()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setVisableByTrun(
|
||||
showBiz: Boolean,
|
||||
showNetError: Boolean,
|
||||
showNorOrder: Boolean,
|
||||
showLoading: Boolean
|
||||
) {
|
||||
if(showBiz){
|
||||
// 选择线路页面
|
||||
m1_order_noorder?.visibility = View.GONE
|
||||
m1_order_neterror?.visibility = View.GONE
|
||||
lsv_line_site?.visibility = View.VISIBLE
|
||||
m1_order_loading?.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
if(showNetError){
|
||||
m1_order_noorder?.visibility = View.GONE
|
||||
m1_order_neterror?.visibility = View.VISIBLE
|
||||
lsv_line_site?.visibility = View.GONE
|
||||
m1_order_loading?.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
if(showNorOrder){
|
||||
m1_order_noorder?.visibility = View.VISIBLE
|
||||
m1_order_neterror?.visibility = View.GONE
|
||||
lsv_line_site?.visibility = View.GONE
|
||||
m1_order_loading?.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
if(showLoading){
|
||||
m1_order_noorder?.visibility = View.GONE
|
||||
m1_order_neterror?.visibility = View.GONE
|
||||
lsv_line_site?.visibility = View.GONE
|
||||
m1_order_loading?.visibility = View.VISIBLE
|
||||
if (!loadingAni.isRunning) {
|
||||
loadingAni.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun hideDataDriverAgree() {
|
||||
group_driver_agrenn_line?.visibility = View.VISIBLE
|
||||
aciv_driver_refuse_group?.visibility = View.GONE
|
||||
g_loading_group?.visibility = View.GONE
|
||||
g_lines_sites_data?.let {
|
||||
it.visibility = View.GONE
|
||||
subscribeDirverAgree = RxUtils.createSubscribe(3_000) {
|
||||
setViewGone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun setEnableSiteStatus(cancleAndSubmit: Boolean) {
|
||||
if (cancleAndSubmit) {
|
||||
g_side_cancle_submit_group?.visibility = View.VISIBLE
|
||||
} else {
|
||||
g_side_cancle_submit_group?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun lineAdapterSubmit(lineInfo: LineInfoResponse.LineInfo) {
|
||||
lineAdapter.submitLine(lineInfo)
|
||||
}
|
||||
|
||||
override fun hideDataDriverRefuse() {
|
||||
group_driver_agrenn_line?.visibility = View.GONE
|
||||
aciv_driver_refuse_group?.visibility = View.VISIBLE
|
||||
g_loading_group?.visibility = View.GONE
|
||||
g_lines_sites_data?.let {
|
||||
it.visibility = View.GONE
|
||||
subscribeDirverRefuse = RxUtils.createSubscribe(3_000) {
|
||||
showSelectData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun lineAdapterSetData(
|
||||
lineInfo: List<LineInfoResponse.LineInfo>,
|
||||
checkLine: LineInfoResponse.LineInfo?
|
||||
) {
|
||||
lineAdapter.setDataList(lineInfo,checkLine)
|
||||
}
|
||||
|
||||
override fun siteAdapterEnableIndex(index: Int) {
|
||||
siteAdapter.setEnableIndex(index)
|
||||
}
|
||||
|
||||
override fun siteAdapterSetData(siteInfo: List<SiteInfoResponse.SiteInfo>) {
|
||||
siteAdapter.setDataList(siteInfo)
|
||||
}
|
||||
|
||||
private fun setViewGone(){
|
||||
goneViewListener?.goneAllView()
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,419 @@
|
||||
package com.mogo.och.bus.passenger.ui.selectline
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.bus.passenger.bean.event.EventLineSites
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoListResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.callback.ITimeCallback
|
||||
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.presenter.BusPassengerFunctionOrderPresenter
|
||||
import com.mogo.och.bus.passenger.utils.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
|
||||
import com.mogo.och.common.module.bean.dpmsg.EndOrderMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.LineSite
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.StopSideStatusManager
|
||||
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loopmanager.LoopInfo
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
|
||||
|
||||
private val TAG = SelectLineViewModel::class.java.simpleName
|
||||
|
||||
private val TAGLINELOOP = "LineSiteViewLineLoop"
|
||||
|
||||
private var viewCallback: SelectLineViewCallback? = null
|
||||
|
||||
|
||||
// 成功提交给后台得线路
|
||||
private var checkLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 成功提交给后台得终点站点
|
||||
private var checkSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 下一个站点
|
||||
private var currentSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 向司机端端提交的临时线路
|
||||
private var tempCheckLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 向司机端临时提交的终点站点
|
||||
private var tempCheckSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
|
||||
private var subscribeSelectLine: Disposable? = null
|
||||
private var subscribeSelectSite: Disposable? = null
|
||||
|
||||
/**
|
||||
* 接收司机屏反馈信息
|
||||
*/
|
||||
private val msgReceived = object : IReceivedMsgListener {
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
UiThreadHandler.post {
|
||||
if (type == OchCommonConst.BUSINESS_STRING) {
|
||||
val msg = GsonUtils.fromJson(
|
||||
String(byteArray),
|
||||
BaseDPMsg::class.java
|
||||
) as BaseDPMsg
|
||||
if (msg.type == DPMsgType.TYPE_CHANGE_DEST.type) {
|
||||
val msg = GsonUtils.fromJson(
|
||||
String(byteArray),
|
||||
ChangeDestMsg::class.java
|
||||
) as ChangeDestMsg
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS_P + BaseDPMsg.TAG,
|
||||
"接受数据:切换站点${msg}"
|
||||
)
|
||||
if (msg.isConfirmed) {
|
||||
if (msg.arriveStatus == 2) {
|
||||
return@post
|
||||
}
|
||||
ToastCharterUtils.showShort("站点确定")
|
||||
viewCallback?.setEnableSiteStatus(true)
|
||||
checkLine = tempCheckLine
|
||||
checkSite = tempCheckSite
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
checkLine?.let {
|
||||
viewCallback?.lineAdapterSubmit(it)
|
||||
}
|
||||
viewCallback?.hideDataDriverAgree()
|
||||
CharterPassengerModel.cleanbroadcastListInfo(checkSite)
|
||||
CharterPassengerModel.queryOrder()
|
||||
} else {
|
||||
ToastCharterUtils.showShort("司机端拒绝请重新选择")
|
||||
viewCallback?.hideDataDriverRefuse()
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
BizLoopManager.removeLoopFunction(BusPassengerFunctionOrderPresenter.TAGLINELOOP)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
CharterPassengerModel.setStatusChangeListener(TAG, this)
|
||||
CallerTelematicListenerManager.addListener(TAG, msgReceived)
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
this.viewCallback = null
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
BizLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG, null)
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onStatusChange(currentStatus: OrderStatusEnum) {
|
||||
UiThreadHandler.post {
|
||||
needRunUI(currentStatus)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun setVIewCallback(viewCallback: SelectLineViewCallback) {
|
||||
this.viewCallback = viewCallback
|
||||
val currentOrderStatus = CharterPassengerModel.getCurrentOrderStatus()
|
||||
needRunUI(currentOrderStatus)
|
||||
extracted()
|
||||
}
|
||||
|
||||
fun checkLineClick(lineInfo: LineInfoResponse.LineInfo) {
|
||||
checkLine4View()
|
||||
tempCheckLine = lineInfo
|
||||
querySitesByLineId(lineInfo)
|
||||
}
|
||||
|
||||
private fun checkLine4View() {
|
||||
tempCheckSite = null
|
||||
viewCallback?.setEnableSiteStatus(false)
|
||||
}
|
||||
|
||||
private fun extracted() {
|
||||
val currentOrderStatus = CharterPassengerModel.getCurrentOrderStatus()
|
||||
if (currentOrderStatus == OrderStatusEnum.OrderNoLine || currentOrderStatus == OrderStatusEnum.OrdersWithLine) {
|
||||
val hasSetLineAndSite = CharterPassengerModel.hasSetLineAndSite()
|
||||
if (hasSetLineAndSite != null) {// 已经设置了线路和站点
|
||||
checkLine = hasSetLineAndSite.first
|
||||
checkSite = hasSetLineAndSite.second
|
||||
}
|
||||
viewCallback?.setEnableSiteStatus(false)
|
||||
queryLineList()
|
||||
}
|
||||
}
|
||||
|
||||
private fun needRunUI(currentStatus: OrderStatusEnum) {
|
||||
when (currentStatus) {
|
||||
OrderStatusEnum.OrderNoLine -> {
|
||||
viewCallback?.setVisableByTrun(showBiz = true)
|
||||
extracted()
|
||||
}
|
||||
|
||||
OrderStatusEnum.OrdersWithLine -> {
|
||||
viewCallback?.setVisableByTrun(showBiz = true)
|
||||
}
|
||||
|
||||
else -> {
|
||||
viewCallback?.setVisableByTrun(showNorOrder = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun queryLineList() {
|
||||
viewCallback?.setVisableByTrun(showLoading = true)
|
||||
BusPassengerServiceManager.queryLineList(AbsMogoApplication.getApp(), object :
|
||||
OchCommonServiceCallback<LineInfoListResponse> {
|
||||
override fun onSuccess(data: LineInfoListResponse?) {
|
||||
if (data?.data == null) return
|
||||
viewCallback?.setVisableByTrun(showBiz = true)
|
||||
viewCallback?.lineAdapterSetData(data.data, checkLine)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastCharterUtils.showShort("查询线路失败")
|
||||
viewCallback?.setVisableByTrun(showNetError = true)
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
viewCallback?.setVisableByTrun(showNetError = true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun changeSites(siteList: MutableList<SiteInfoResponse.SiteInfo>) {
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastCharterUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return
|
||||
}
|
||||
val sentDataSite: MutableList<LineSite> = mutableListOf()
|
||||
siteList.forEach {
|
||||
sentDataSite.add(it.copy2Mas())
|
||||
}
|
||||
|
||||
tempCheckSite?.let { siteInfo ->
|
||||
val orderNo = CharterPassengerModel.getCurrentOrderInfo()?.orderNo ?: ""
|
||||
val msg = ChangeDestMsg(
|
||||
orderNo,
|
||||
siteInfo.lineId!!.toInt(),
|
||||
siteInfo.lineName!!,
|
||||
currentSite!!.siteId!!.toInt(),
|
||||
currentSite!!.siteName!!,
|
||||
siteInfo.siteId!!.toInt(),
|
||||
siteInfo.siteName!!,
|
||||
false,
|
||||
1,
|
||||
0,
|
||||
sentDataSite
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + BaseDPMsg.TAG, "发送数据:切换站点${msg}")
|
||||
}
|
||||
viewCallback?.hideDataWaitDriverMsg()
|
||||
// 启动查看和司机端链接
|
||||
BizLoopManager.setLoopFunction(
|
||||
BusPassengerFunctionOrderPresenter.TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000) {
|
||||
ToastCharterUtils.showShort("请联系安全员确认")
|
||||
viewCallback?.hideDataDriverRefuse()
|
||||
}
|
||||
}
|
||||
|
||||
private fun querySitesByLineId(checkLine: LineInfoResponse.LineInfo) {
|
||||
BusPassengerServiceManager.queryLineSiteList(
|
||||
AbsMogoApplication.getApp(),
|
||||
checkLine.lineId.toString(),
|
||||
object : OchCommonServiceCallback<SiteInfoResponse> {
|
||||
override fun onSuccess(data: SiteInfoResponse?) {
|
||||
if (data?.data == null) return
|
||||
val siteInfos = data.data
|
||||
EventBus.getDefault().post(EventLineSites(checkLine, siteInfos, false))
|
||||
if (siteInfos.isNotEmpty()) {
|
||||
// 计算当前站点是那个
|
||||
val calculateCurrentSite =
|
||||
CharterPassengerModel.calculateCurrentSite(siteInfos)
|
||||
val first = calculateCurrentSite.first// 可用站点
|
||||
if (first < 0) {
|
||||
// 所有站点不可用
|
||||
currentSite = siteInfos[siteInfos.size - 1]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
viewCallback?.siteAdapterEnableIndex(siteInfos.size - 1)
|
||||
} else {
|
||||
//
|
||||
val index = if (first == 0) {
|
||||
0
|
||||
} else if (first <= siteInfos.size - 1) {
|
||||
first - 1
|
||||
} else {
|
||||
siteInfos.size - 1
|
||||
}
|
||||
currentSite = siteInfos[index]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
viewCallback?.siteAdapterEnableIndex(index)
|
||||
}
|
||||
siteInfos.forEach {
|
||||
if (it.siteId == checkSite?.siteId) {
|
||||
it.isCheck = true
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
}
|
||||
viewCallback?.siteAdapterSetData(siteInfos)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
ToastCharterUtils.showShort("查询站点失败")
|
||||
viewCallback?.setVisableByTrun(showNetError = true)
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
ToastCharterUtils.showShort("查询站点失败")
|
||||
viewCallback?.setVisableByTrun(showNetError = true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun checkServerStatus() {
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastCharterUtils.showShort("断开和司机端连接、请联系安全员")
|
||||
BizLoopManager.removeLoopFunction(BusPassengerFunctionOrderPresenter.TAGLINELOOP)
|
||||
viewCallback?.hideDataDriverRefuse()
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS_P + BusPassengerFunctionOrderPresenter.TAG,
|
||||
"endAni666"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据
|
||||
*/
|
||||
fun resetData() {
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
if(checkLine==null){// 没有提交线路
|
||||
queryLineList()
|
||||
viewCallback?.setEnableSiteStatus(true)
|
||||
}else{
|
||||
checkLine?.let {
|
||||
viewCallback?.setEnableSiteStatus(false)
|
||||
viewCallback?.lineAdapterSubmit(it)
|
||||
querySitesByLineId(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun checkSiteClick(siteInfo: SiteInfoResponse.SiteInfo?) {
|
||||
tempCheckSite = siteInfo
|
||||
if(checkSite!=null){
|
||||
checkSite?.let {
|
||||
if (it.siteId == siteInfo?.siteId) {// 站点相同 隐藏所有提交按钮
|
||||
viewCallback?.setEnableSiteStatus(false)
|
||||
} else {
|
||||
if(it.lineId == siteInfo?.lineId){// 线路相同显示单独提交
|
||||
viewCallback?.setEnableSiteStatus(true)
|
||||
}else{
|
||||
if(siteInfo==null){//没有选站点隐藏所有提交
|
||||
viewCallback?.setEnableSiteStatus(false)
|
||||
}else {
|
||||
viewCallback?.setEnableSiteStatus(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
viewCallback?.setEnableSiteStatus(true)
|
||||
}
|
||||
}
|
||||
fun canSwitchLine():Boolean {
|
||||
val gnssSpeed =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed
|
||||
if (gnssSpeed < 0.5) {
|
||||
when (CallerAutoPilotStatusListenerManager.getState()) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
return true
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
return true
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 自动驾驶中
|
||||
return when (StopSideStatusManager.stopSiteStatus) {
|
||||
StopSideStatusManager.Status.EndingSuccess -> {
|
||||
true
|
||||
}
|
||||
else ->{
|
||||
ToastCharterUtils.showShort("自动驾驶中无法切换线路")
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastCharterUtils.showShort("因车辆正在平行驾驶中无法切换线路")
|
||||
return false
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
} else {
|
||||
ToastCharterUtils.showShort("请停车后再修改目的地~")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
interface SelectLineViewCallback {
|
||||
fun hideDataWaitDriverMsg()
|
||||
fun setVisableByTrun(
|
||||
showBiz: Boolean = false,
|
||||
showNetError: Boolean = false,
|
||||
showNorOrder: Boolean = false,
|
||||
showLoading: Boolean = false
|
||||
)
|
||||
|
||||
fun hideDataDriverAgree()
|
||||
fun setEnableSiteStatus(cancleAndSubmit: Boolean)
|
||||
fun lineAdapterSubmit(lineInfo: LineInfoResponse.LineInfo)
|
||||
fun hideDataDriverRefuse()
|
||||
fun lineAdapterSetData(
|
||||
lineInfo: List<LineInfoResponse.LineInfo>,
|
||||
checkLine: LineInfoResponse.LineInfo?
|
||||
)
|
||||
fun siteAdapterEnableIndex(index: Int)
|
||||
fun siteAdapterSetData(siteInfo: List<SiteInfoResponse.SiteInfo>)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.adapter
|
||||
package com.mogo.och.bus.passenger.ui.selectline.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.adapter
|
||||
package com.mogo.och.bus.passenger.ui.selectline.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
@@ -11,7 +11,6 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.och.bus.passenger.utils.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.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view;
|
||||
package com.mogo.och.bus.passenger.ui.selectline.layoutmanage;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view;
|
||||
package com.mogo.och.bus.passenger.ui.selectline.layoutmanage;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.DisplayMetrics;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.dialogfragment.fragment
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
@@ -27,10 +27,10 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.Temperature
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionSoftPresenter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.TemperatureAdapter
|
||||
import com.mogo.och.bus.passenger.ui.layoutmanage.PagerCenterSnapHelper
|
||||
import com.mogo.och.bus.passenger.view.HorizontalDecoration
|
||||
import com.mogo.och.bus.passenger.view.PickerLayoutManager
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.adapter.TemperatureAdapter
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage.PagerCenterSnapHelper
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage.HorizontalDecoration
|
||||
import com.mogo.och.bus.passenger.ui.selectline.layoutmanage.PickerLayoutManager
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import com.mogo.och.common.module.wigets.MineGradientDrawable
|
||||
import io.reactivex.Observable
|
||||
@@ -239,11 +239,7 @@ class M1SoftFragment :
|
||||
pickerLayoutManager.scaleDownDistance = 0.8f
|
||||
|
||||
val data = getData()
|
||||
val adapter = TemperatureAdapter(
|
||||
requireContext(),
|
||||
data,
|
||||
rv_aircondition_temperature
|
||||
)
|
||||
val adapter = TemperatureAdapter(requireContext(), data, rv_aircondition_temperature)
|
||||
val snapHelper = PagerCenterSnapHelper()
|
||||
snapHelper.attachToRecyclerView(rv_aircondition_temperature)
|
||||
rv_aircondition_temperature.layoutManager = pickerLayoutManager
|
||||
@@ -0,0 +1,762 @@
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.drawable.ClipDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.media.AudioManager
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.RadioButton
|
||||
import android.widget.SeekBar
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
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
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.Temperature
|
||||
import com.mogo.och.bus.passenger.callback.IClearViewCallback
|
||||
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.utils.RxUtils
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import com.mogo.och.common.module.wigets.MineGradientDrawable
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.dbv_wind
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.g_aircondition_setting
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.g_light_setting
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.g_voice_setting
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.iv_bottom_light_setting
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.iv_end_voice
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.iv_loading
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.iv_temperature_select
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.iv_top_light_setting
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.iv_voice
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rb_pattern_automatic
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rb_pattern_heating
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rb_pattern_refrigeration
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rb_pattern_ventilate
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rb_wind_speed_high
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rb_wind_speed_low
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rb_wind_speed_middle
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rg_select_function
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rg_setting_pattern
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rg_setting_windspeed
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.rv_aircondition_temperature
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.sb_voice_bar
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_aircondition_switch
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_current_voice_value
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_light_atmosphere
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_light_top_01
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_light_top_02
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_setting_aircondition
|
||||
import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_temperature_title
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallback {
|
||||
|
||||
private val TAG = "OrderInfoView"
|
||||
|
||||
private var viewModel:SoftControlViewModel?=null
|
||||
|
||||
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)
|
||||
|
||||
var goneViewListener: IClearViewCallback?=null
|
||||
|
||||
private var currentTemperature: Temperature? = null
|
||||
|
||||
private var subscribeAir: Disposable? = null
|
||||
private var subscribeLightTop1: Disposable? = null
|
||||
private var subscribeLightTop2: Disposable? = null
|
||||
private var subscribeAtmosphere: Disposable? = null
|
||||
private var subscribeAnimator: Disposable? = null
|
||||
|
||||
private var animator1: ObjectAnimator? = null
|
||||
|
||||
private val loadingAni = ObjectAnimator.ofFloat(iv_loading, "rotation", 0f, 90f ,180f, 270f, 360f).apply {
|
||||
repeatCount = -1
|
||||
interpolator = LinearInterpolator()
|
||||
duration = 1000
|
||||
}
|
||||
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_soft_fragment, this, true)
|
||||
onClick {
|
||||
setViewGone()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setViewGone(){
|
||||
goneViewListener?.goneAllView()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(SoftControlViewModel::class.java)
|
||||
}
|
||||
|
||||
rg_select_function.setOnCheckedChangeListener { _, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.tv_setting_aircondition -> {
|
||||
g_light_setting.visibility = View.GONE
|
||||
g_voice_setting.visibility = View.GONE
|
||||
if(loadingAni.isRunning){
|
||||
iv_loading.visibility = View.VISIBLE
|
||||
g_aircondition_setting.visibility = View.GONE
|
||||
}else{
|
||||
g_aircondition_setting.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
R.id.tv_setting_lighting -> {
|
||||
g_light_setting.visibility = View.VISIBLE
|
||||
g_voice_setting.visibility = View.GONE
|
||||
g_aircondition_setting.visibility = View.GONE
|
||||
iv_loading.visibility = View.GONE
|
||||
}
|
||||
R.id.tv_setting_voice -> {
|
||||
g_voice_setting.visibility = View.VISIBLE
|
||||
g_aircondition_setting.visibility = View.GONE
|
||||
g_light_setting.visibility = View.GONE
|
||||
iv_loading.visibility = View.GONE
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
if(rb_pattern_heating.isChecked){
|
||||
iv_temperature_select.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
rg_select_function.check(R.id.tv_setting_aircondition)
|
||||
setAirconditionListener(viewModel)
|
||||
setAirConditionAni()
|
||||
setLightListener(viewModel)
|
||||
setVoiceInfo()
|
||||
}
|
||||
|
||||
|
||||
fun setWind(check: RadioButton, resource:Int){
|
||||
check.isChecked = true
|
||||
dbv_wind.setDrawableImage(BitmapFactory.decodeResource(resources,resource))
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭暖风机
|
||||
*/
|
||||
private fun closeHeater() {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + M1SoftFragment.TAG, "关闭暖风")
|
||||
heaterAirEnable(true)
|
||||
viewModel?.closeHeader()
|
||||
}
|
||||
|
||||
private fun heaterAirEnable(enable: Boolean) {
|
||||
tv_temperature_title.isEnabled = enable
|
||||
rv_aircondition_temperature.isEnabled = enable
|
||||
val layoutManager = rv_aircondition_temperature.layoutManager
|
||||
if (layoutManager is PickerLayoutManager) {
|
||||
layoutManager.setHorizontallyScroll(enable)
|
||||
}
|
||||
val adapter = rv_aircondition_temperature.adapter as TemperatureAdapter
|
||||
if(enable){
|
||||
adapter.setEnable(true)
|
||||
if(tv_setting_aircondition.isChecked) {
|
||||
if(iv_loading.visibility==View.GONE){
|
||||
iv_temperature_select.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
rb_wind_speed_low.setTextColor(ContextCompat.getColorStateList(context,R.color.bus_p_function_airconditon_pattern_text_color_selector))
|
||||
}else{
|
||||
adapter.setEnable(false)
|
||||
iv_temperature_select.visibility = View.GONE
|
||||
rb_wind_speed_low.setTextColor(ContextCompat.getColor(context,R.color.bus_p_m1_6647576e))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启暖风机
|
||||
*/
|
||||
private fun openHeater() {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + M1SoftFragment.TAG, "打开暖风")
|
||||
heaterAirEnable(false)
|
||||
closeAircondition()//关闭空调
|
||||
val switch: Int
|
||||
when (rg_setting_windspeed.checkedRadioButtonId) {
|
||||
R.id.rb_wind_speed_low -> {
|
||||
rb_wind_speed_middle.tag = M1SoftFragment.touchTag
|
||||
rb_wind_speed_middle.toggle()
|
||||
switch = 1
|
||||
}
|
||||
R.id.rb_wind_speed_middle -> {
|
||||
switch = 1
|
||||
}
|
||||
R.id.rb_wind_speed_high -> {
|
||||
switch = 2
|
||||
}
|
||||
else -> {
|
||||
rb_wind_speed_middle.tag = M1SoftFragment.touchTag
|
||||
rb_wind_speed_middle.toggle()
|
||||
switch = 1
|
||||
}
|
||||
}
|
||||
if (!tv_aircondition_switch.isChecked) {
|
||||
return
|
||||
}
|
||||
viewModel?.openAndSetHeader(switch)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭空调
|
||||
*/
|
||||
private fun closeAircondition() {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + M1SoftFragment.TAG, "关闭空调")
|
||||
var modeCmd = 0
|
||||
var windSpeedCmd = 0
|
||||
val temperatureCmd = currentTemperature?.value ?: 26
|
||||
closeHeater()//关闭暖风
|
||||
when (rg_setting_pattern.checkedRadioButtonId) {
|
||||
R.id.rb_pattern_automatic -> modeCmd = 1 // 自动
|
||||
R.id.rb_pattern_refrigeration -> modeCmd = 2 // 制冷
|
||||
R.id.rb_pattern_ventilate -> modeCmd = 3 // 通风
|
||||
else -> {}
|
||||
}
|
||||
when (rg_setting_windspeed.checkedRadioButtonId) {
|
||||
R.id.rb_wind_speed_low -> windSpeedCmd = 1 // 1档
|
||||
R.id.rb_wind_speed_middle -> windSpeedCmd = 2 // 2档
|
||||
R.id.rb_wind_speed_high -> windSpeedCmd = 3 // 3档
|
||||
else -> {}
|
||||
}
|
||||
viewModel?.closeAircondition(modeCmd, windSpeedCmd, temperatureCmd)
|
||||
}
|
||||
|
||||
fun showAni(){
|
||||
iv_loading.visibility = View.VISIBLE
|
||||
loadingAni.target = iv_loading
|
||||
loadingAni.start()
|
||||
g_aircondition_setting.visibility = View.GONE
|
||||
subscribeAnimator = Observable.timer(10000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
loadingAni.cancel()
|
||||
iv_loading.visibility = View.GONE
|
||||
if(tv_setting_aircondition.isChecked){
|
||||
g_aircondition_setting.visibility = View.VISIBLE
|
||||
if(rb_pattern_heating.isChecked){
|
||||
iv_temperature_select.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启空调
|
||||
*/
|
||||
private fun openAircondition() {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + M1SoftFragment.TAG, "打开空调")
|
||||
var modeCmd = 0
|
||||
var windSpeedCmd = 0
|
||||
val temperatureCmd = currentTemperature?.value ?: 26
|
||||
closeHeater()//关闭暖风
|
||||
when (rg_setting_pattern.checkedRadioButtonId) {
|
||||
R.id.rb_pattern_automatic -> modeCmd = 1 // 自动
|
||||
R.id.rb_pattern_refrigeration -> modeCmd = 2 // 制冷
|
||||
R.id.rb_pattern_ventilate -> modeCmd = 3 // 通风
|
||||
else -> {}
|
||||
}
|
||||
when (rg_setting_windspeed.checkedRadioButtonId) {
|
||||
R.id.rb_wind_speed_low -> windSpeedCmd = 1 // 1档
|
||||
R.id.rb_wind_speed_middle -> windSpeedCmd = 2 // 2档
|
||||
R.id.rb_wind_speed_high -> windSpeedCmd = 3 // 3档
|
||||
else -> {}
|
||||
}
|
||||
if (!tv_aircondition_switch.isChecked) {
|
||||
return
|
||||
}
|
||||
viewModel?.openAndSetAircondition(modeCmd, windSpeedCmd, temperatureCmd)
|
||||
}
|
||||
|
||||
private fun setCheckAir(adapter: TemperatureAdapter, tag:Temperature){
|
||||
adapter.setCheckIndex(tag.index)
|
||||
currentTemperature = tag
|
||||
if (rv_aircondition_temperature.tag == M1SoftFragment.touchTag) {
|
||||
rv_aircondition_temperature.tag = null
|
||||
return
|
||||
} else {
|
||||
SoundPoolHelper.getSoundPoolHelper()
|
||||
.playSoundWithRedId(context, R.raw.bus_di)
|
||||
}
|
||||
openAircondition()
|
||||
}
|
||||
|
||||
|
||||
// region 灯
|
||||
private fun setLightListener(viewModel: SoftControlViewModel?) {
|
||||
tv_light_top_01.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(!buttonView.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
tv_light_top_01.isEnabled = false
|
||||
subscribeLightTop1 = Observable.timer(2000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
tv_light_top_01.isEnabled = true
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
viewModel?.setLightData1(isChecked)
|
||||
setLightTop1View(isChecked,true)
|
||||
setLightView(isChecked,tv_light_top_02.isChecked)
|
||||
}
|
||||
tv_light_top_02.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(!buttonView.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
tv_light_top_02.isEnabled = false
|
||||
subscribeLightTop2 = Observable.timer(2000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
tv_light_top_02.isEnabled = true
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
viewModel?.setLightData2(isChecked)
|
||||
setLightTop2View(isChecked,true)
|
||||
setLightView(tv_light_top_01.isChecked,isChecked)
|
||||
}
|
||||
tv_light_atmosphere.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(!buttonView.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
tv_light_atmosphere.isEnabled = false
|
||||
subscribeAtmosphere = Observable.timer(2000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
tv_light_atmosphere.isEnabled = true
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
viewModel?.setAtmosphereLightData2(isChecked)
|
||||
setLightAtmosphereView(isChecked,true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setLightTop1View(leftLight: Boolean, isFirst: Boolean){
|
||||
tv_light_top_01?.let {
|
||||
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")
|
||||
} 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")
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun setLightTop2View(rightLight: Boolean, isFirst: Boolean){
|
||||
tv_light_top_02?.let {
|
||||
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")
|
||||
} 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")
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun setLightAtmosphereView(atmosphereLight: Boolean, isFirst: Boolean){
|
||||
tv_light_atmosphere?.let {
|
||||
if (atmosphereLight) {
|
||||
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("打开氛围灯")
|
||||
} 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("关闭氛围灯")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 灯的UI发生变化
|
||||
*/
|
||||
override fun setLightView(leftLight: Boolean, rightLight: Boolean) {
|
||||
iv_top_light_setting?.let {
|
||||
if (leftLight && rightLight) {
|
||||
iv_top_light_setting.setImageResource(R.drawable.bus_p_function_light_middle_selected)// 都打开
|
||||
} else if (!leftLight && !rightLight) {
|
||||
iv_top_light_setting.setImageResource(R.drawable.bus_p_function_light_nor)// 都关闭
|
||||
} else {
|
||||
if (leftLight) {
|
||||
iv_top_light_setting.setImageResource(R.drawable.bus_p_function_light_select_left)// 左面开
|
||||
}
|
||||
if (rightLight) {
|
||||
iv_top_light_setting.setImageResource(R.drawable.bus_p_function_light_select_right)// 左面开
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region 声音
|
||||
private var mAudioManager: AudioManager? = null
|
||||
private var mMaxVolume: Int? = 100
|
||||
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private fun setVoiceInfo() {
|
||||
val dp2px = AutoSizeUtils.dp2px(context, 26f)//进度条高度
|
||||
val color2CBFFC = ContextCompat.getColor(context, R.color.bus_p_m1_2cbffc)
|
||||
val color1060FF = ContextCompat.getColor(context, R.color.bus_p_m1_1060ff)
|
||||
val color96A5C2 = ContextCompat.getColor(context, R.color.bus_p_m1_96a5c2)
|
||||
val temp03 = MineGradientDrawable(color2CBFFC, color1060FF, dp2px)
|
||||
val scaleDrawable3 = ClipDrawable(temp03, Gravity.START, ClipDrawable.HORIZONTAL)
|
||||
val temp01 = MineGradientDrawable(color96A5C2, color96A5C2, dp2px)
|
||||
val arr = arrayOf(temp01, scaleDrawable3)
|
||||
val ld = LayerDrawable(arr)
|
||||
ld.setDrawableByLayerId(android.R.id.background, temp01)
|
||||
ld.setDrawableByLayerId(android.R.id.progress, scaleDrawable3)
|
||||
sb_voice_bar.setProgressDrawableTiled(ld)
|
||||
sb_voice_bar.max = 100
|
||||
sb_voice_bar.min = 5
|
||||
sb_voice_bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
||||
tv_current_voice_value.text = "$progress%"
|
||||
if (fromUser) {
|
||||
mMaxVolume?.let {
|
||||
var currnetValue = ((progress.toFloat() / 100) * it).toInt()
|
||||
if (currnetValue <= 0) {
|
||||
currnetValue = 1
|
||||
}
|
||||
mAudioManager?.setStreamVolume(
|
||||
AudioManager.STREAM_MUSIC,
|
||||
currnetValue,
|
||||
AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
|
||||
)
|
||||
}
|
||||
}
|
||||
if (progress == 0) {
|
||||
iv_voice.setImageResource(R.drawable.bus_p_function_voice_middle_select)
|
||||
iv_end_voice.setImageResource(R.drawable.bus_p_function_voice_min)
|
||||
} else {
|
||||
iv_voice.setImageResource(R.drawable.bus_p_function_voice_middle_selected)
|
||||
iv_end_voice.setImageResource(R.drawable.bus_p_function_voice_max)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar?) {}
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar?) {}
|
||||
})
|
||||
|
||||
context?.let {
|
||||
mAudioManager = it.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
mMaxVolume = mAudioManager?.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
|
||||
val mCurrentVolume = mAudioManager?.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||
mMaxVolume?.let { max ->
|
||||
mCurrentVolume?.let { current ->
|
||||
if (current == 1) {
|
||||
sb_voice_bar.progress = 5
|
||||
tv_current_voice_value.text = "5%"
|
||||
} else {
|
||||
val fl = current.toFloat() / max * 100
|
||||
sb_voice_bar.progress = fl.toInt()
|
||||
tv_current_voice_value.text = "${fl.toInt()}%"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// endregion
|
||||
|
||||
|
||||
|
||||
private fun setAirConditionAni() {
|
||||
dbv_wind.post {
|
||||
dbv_wind?.let {
|
||||
val measuredHeight = it.measuredHeight
|
||||
animator1 = ObjectAnimator.ofInt(it, "showHeight", 0, measuredHeight).apply {
|
||||
duration = 1000
|
||||
repeatCount = ValueAnimator.INFINITE
|
||||
if(rg_setting_windspeed.checkedRadioButtonId!=0&&tv_aircondition_switch.isChecked){
|
||||
start()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setAirconditionListener(viewModel: SoftControlViewModel?) {
|
||||
// 开关空调或暖风机
|
||||
tv_aircondition_switch.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(!buttonView.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
if(isChecked){//打开
|
||||
tv_aircondition_switch.setText("关闭空调")
|
||||
if (rg_setting_pattern.checkedRadioButtonId == R.id.rb_pattern_heating) {
|
||||
openHeater()// 打开暖风机
|
||||
} else {
|
||||
openAircondition()// 打开空调
|
||||
}
|
||||
showAni()
|
||||
}else{// 关闭
|
||||
tv_aircondition_switch.setText("打开空调")
|
||||
closeHeater()// 关闭暖风机
|
||||
closeAircondition()//关闭空调
|
||||
}
|
||||
}
|
||||
// 模式调节
|
||||
rg_setting_pattern.setOnCheckedChangeListener { group, checkedId ->
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + M1SoftFragment.TAG, "调节模式")
|
||||
when (checkedId) {
|
||||
R.id.rb_pattern_heating -> {
|
||||
if(!rb_pattern_heating.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
openHeater()
|
||||
}
|
||||
R.id.rb_pattern_automatic->{
|
||||
if(!rb_pattern_automatic.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
openAircondition()
|
||||
}
|
||||
R.id.rb_pattern_refrigeration->{
|
||||
if(!rb_pattern_refrigeration.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
openAircondition()
|
||||
}
|
||||
R.id.rb_pattern_ventilate->{
|
||||
if(!rb_pattern_ventilate.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
openAircondition()
|
||||
}
|
||||
else -> {
|
||||
openAircondition()
|
||||
}
|
||||
}
|
||||
if(tv_aircondition_switch.isChecked) {
|
||||
showAni()
|
||||
}
|
||||
}
|
||||
|
||||
// 风速调节
|
||||
rg_setting_windspeed.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rb_wind_speed_low-> {
|
||||
if(!rb_wind_speed_low.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
}
|
||||
R.id.rb_wind_speed_middle-> {
|
||||
if(!rb_wind_speed_middle.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
}
|
||||
R.id.rb_wind_speed_high-> {
|
||||
if(!rb_wind_speed_high.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
if (rg_setting_pattern.checkedRadioButtonId == R.id.rb_pattern_heating) {//暖风机
|
||||
openHeater()
|
||||
} else {
|
||||
openAircondition()
|
||||
}
|
||||
}
|
||||
val pickerLayoutManager =
|
||||
PickerLayoutManager(
|
||||
context,
|
||||
PickerLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
pickerLayoutManager.isChangeAlpha = true
|
||||
pickerLayoutManager.scaleDownBy = 0.29f
|
||||
pickerLayoutManager.scaleDownDistance = 0.8f
|
||||
|
||||
val data = getData()
|
||||
val adapter = TemperatureAdapter(context, data, rv_aircondition_temperature)
|
||||
val snapHelper = PagerCenterSnapHelper()
|
||||
snapHelper.attachToRecyclerView(rv_aircondition_temperature)
|
||||
rv_aircondition_temperature.layoutManager = pickerLayoutManager
|
||||
rv_aircondition_temperature.adapter = adapter
|
||||
HorizontalDecoration.distance = SharedPrefsMgr.getInstance(context).getInt(
|
||||
HorizontalDecoration.distancekey,0)
|
||||
val space = AutoSizeUtils.dp2px(context, 15f)
|
||||
rv_aircondition_temperature.addItemDecoration(
|
||||
HorizontalDecoration(
|
||||
space,
|
||||
data.size - 1
|
||||
)
|
||||
)
|
||||
|
||||
pickerLayoutManager.setOnScrollStopListener { view ->
|
||||
if (view is TextView) {
|
||||
// 未拖到中点、自动滚动到中点会短时间触发两次
|
||||
val tag = view.tag
|
||||
if (tag is Temperature) {
|
||||
RxUtils.disposeSubscribe(subscribeAir)
|
||||
if(tag.index==0||tag.index==adapter.data.size-1){
|
||||
subscribeAir = Observable.timer(200, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
setCheckAir(adapter,tag)
|
||||
}
|
||||
}else {
|
||||
if (ClickUtils.isClickTooFrequent(rv_aircondition_temperature)) {
|
||||
return@setOnScrollStopListener
|
||||
}
|
||||
setCheckAir(adapter,tag)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(HorizontalDecoration.distance!=0){
|
||||
rv_aircondition_temperature.scrollToPosition(data.size-1)
|
||||
adapter.setCheckIndex(data.size-1)
|
||||
}
|
||||
}
|
||||
|
||||
fun getData(): MutableList<Temperature> {
|
||||
val mutableListOf = mutableListOf<Temperature>()
|
||||
mutableListOf.add(Temperature(0, 16, "16°"))
|
||||
mutableListOf.add(Temperature(1, 17, "17°"))
|
||||
mutableListOf.add(Temperature(2, 18, "18°"))
|
||||
mutableListOf.add(Temperature(3, 19, "19°"))
|
||||
mutableListOf.add(Temperature(4, 20, "20°"))
|
||||
mutableListOf.add(Temperature(5, 21, "21°"))
|
||||
mutableListOf.add(Temperature(6, 22, "22°"))
|
||||
mutableListOf.add(Temperature(7, 23, "23°"))
|
||||
mutableListOf.add(Temperature(8, 24, "24°"))
|
||||
mutableListOf.add(Temperature(9, 25, "25°"))
|
||||
mutableListOf.add(Temperature(10, 26, "26°"))
|
||||
return mutableListOf
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据车的状态会写页面状态
|
||||
*/
|
||||
override fun setAirconditionHeaterView(
|
||||
airIsOpen: Boolean,
|
||||
heaterIsOpen: Boolean,
|
||||
temperatureCmd: Int,
|
||||
pattern: Int,
|
||||
windSpeed: Int
|
||||
) {
|
||||
tv_aircondition_switch?.let {
|
||||
if (!airIsOpen && !heaterIsOpen) {
|
||||
tv_aircondition_switch.text = "打开空调"
|
||||
tv_aircondition_switch.isChecked = false
|
||||
dbv_wind.visibility = View.GONE
|
||||
} else {
|
||||
tv_aircondition_switch.text = "关闭空调"
|
||||
tv_aircondition_switch.isChecked = true
|
||||
dbv_wind.visibility = View.VISIBLE
|
||||
}
|
||||
if (airIsOpen) {
|
||||
val adapter = rv_aircondition_temperature.adapter
|
||||
if (adapter is TemperatureAdapter) {
|
||||
adapter.data.forEach {
|
||||
if (it.value == temperatureCmd) {
|
||||
rv_aircondition_temperature.tag = M1SoftFragment.touchTag
|
||||
UiThreadHandler.postDelayed({
|
||||
rv_aircondition_temperature?.smoothScrollToPosition(it.index)
|
||||
},500)
|
||||
}
|
||||
}
|
||||
}
|
||||
when (pattern) {//1: 自动模式, 2: 制冷模式, 3: 通风模式(仅送风,无温度)
|
||||
1 -> {rb_pattern_automatic.isChecked = true}
|
||||
2 -> {rb_pattern_refrigeration.isChecked = true}
|
||||
3 -> {rb_pattern_ventilate.isChecked = true}
|
||||
else -> {}
|
||||
}
|
||||
heaterAirEnable(true)
|
||||
when (windSpeed) {//1: 1档,2: 2档,3:3档
|
||||
1 -> {
|
||||
setWind(rb_wind_speed_low,R.drawable.bus_pm1_aircondition_wind_low)
|
||||
}
|
||||
2 -> {
|
||||
setWind(rb_wind_speed_middle,R.drawable.bus_pm1_aircondition_wind_middle)
|
||||
}
|
||||
3 -> {
|
||||
setWind(rb_wind_speed_high,R.drawable.bus_pm1_aircondition_wind_high)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
if (heaterIsOpen) {
|
||||
rb_pattern_heating.isChecked = true
|
||||
heaterAirEnable(false)
|
||||
when (windSpeed) {//1: 1档,2: 2档
|
||||
1 -> {
|
||||
setWind(rb_wind_speed_middle,R.drawable.bus_pm1_warm_wind_middle)
|
||||
}
|
||||
2 -> {
|
||||
setWind(rb_wind_speed_high,R.drawable.bus_pm1_warm_wind_high)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
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.manager.devicemanage.LightAirconditionDoorCallback
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorStatusManager
|
||||
import com.mogo.och.common.module.manager.devicemanage.data.AirconditionStatus
|
||||
import com.mogo.och.common.module.manager.devicemanage.data.HeaterStatue
|
||||
import com.mogo.och.common.module.manager.devicemanage.data.LightStatus
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
class SoftControlViewModel: ViewModel(), LightAirconditionDoorCallback {
|
||||
|
||||
private val TAG = SoftControlViewModel::class.java.simpleName
|
||||
|
||||
private var viewCallback:SoftControlCallback?=null
|
||||
|
||||
private var subscribeLightTop1: Disposable?=null
|
||||
private var subscribeLightTop2: Disposable?=null
|
||||
private var subscribeLightAtmosphere: Disposable?=null
|
||||
|
||||
private var airconditionDisposable: Disposable?=null
|
||||
private var heaterDisposable: Disposable?=null
|
||||
|
||||
|
||||
init {
|
||||
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
this.viewCallback = null
|
||||
LightAirconditionDoorStatusManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
fun setViewCallback(viewCallback:SoftControlCallback){
|
||||
this.viewCallback = viewCallback
|
||||
LightAirconditionDoorStatusManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 空调状态变化
|
||||
*/
|
||||
override fun onAirconditionStatusCallback(heaterIsOpen: Boolean, airconditionStatus: AirconditionStatus, isFirst: Boolean) {
|
||||
CallerLogger.d(M_BUS_P + TAG,
|
||||
"回写--空调开关:${LightAirconditionDoorStatusManager.airconditionStatus.isOpen}、" +
|
||||
"空调温度:${LightAirconditionDoorStatusManager.airconditionStatus.temperature}" +
|
||||
"空调模式:${LightAirconditionDoorStatusManager.airconditionStatus.pattert}" +
|
||||
"空调风速:${LightAirconditionDoorStatusManager.airconditionStatus.windSpeed}")
|
||||
UiThreadHandler.post {
|
||||
if(airconditionStatus.isOpen){
|
||||
viewCallback?.setAirconditionHeaterView(
|
||||
airconditionStatus.isOpen,
|
||||
heaterIsOpen,
|
||||
airconditionStatus.temperature,
|
||||
airconditionStatus.pattert,
|
||||
airconditionStatus.windSpeed
|
||||
)
|
||||
}else{
|
||||
viewCallback?.setAirconditionHeaterView(
|
||||
airconditionStatus.isOpen,
|
||||
heaterIsOpen,
|
||||
airconditionStatus.temperature,
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 暖风机状态变化
|
||||
*/
|
||||
override fun onHeaterStatusCallback(airconditionIsOpen:Boolean, heaterStatue: HeaterStatue, isFirst: Boolean) {
|
||||
CallerLogger.d(M_BUS_P + TAG,
|
||||
"回写--暖风机开关:${heaterStatue.isOpen}、" +
|
||||
"风速:${heaterStatue.windSpeed}")
|
||||
UiThreadHandler.post {
|
||||
if(heaterStatue.isOpen) {
|
||||
viewCallback?.setAirconditionHeaterView(
|
||||
airconditionIsOpen,
|
||||
heaterStatue.isOpen,
|
||||
0,
|
||||
0,
|
||||
heaterStatue.windSpeed
|
||||
)
|
||||
}else{
|
||||
viewCallback?.setAirconditionHeaterView(
|
||||
airconditionIsOpen,
|
||||
heaterStatue.isOpen,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 灯状态变化
|
||||
*/
|
||||
override fun onLightTop1Callback(lightStatus: LightStatus, isFirst: Boolean) {
|
||||
CallerLogger.d(M_BUS_P + TAG,
|
||||
"回写--顶灯1开关:${lightStatus.isOpenLight1}、" +
|
||||
"顶灯2开关:${lightStatus.isOpenLight2}、" +
|
||||
"氛围灯开关:${lightStatus.isOpenatmosphere}、")
|
||||
UiThreadHandler.post {
|
||||
viewCallback?.setLightTop1View(lightStatus.isOpenLight1,isFirst)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 灯状态变化
|
||||
*/
|
||||
override fun onLightTop2Callback(lightStatus: LightStatus, isFirst: Boolean) {
|
||||
CallerLogger.d(M_BUS_P + TAG,
|
||||
"回写--顶灯1开关:${lightStatus.isOpenLight1}、" +
|
||||
"顶灯2开关:${lightStatus.isOpenLight2}、" +
|
||||
"氛围灯开关:${lightStatus.isOpenatmosphere}、")
|
||||
UiThreadHandler.post {
|
||||
viewCallback?.setLightTop2View(lightStatus.isOpenLight2,isFirst)
|
||||
viewCallback?.setLightView(lightStatus.isOpenLight1,lightStatus.isOpenLight2)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 灯状态变化
|
||||
*/
|
||||
override fun onLightAtmosphereCallback(lightStatus: LightStatus, isFirst: Boolean) {
|
||||
CallerLogger.d(M_BUS_P + TAG,
|
||||
"回写--顶灯1开关:${lightStatus.isOpenLight1}、" +
|
||||
"顶灯2开关:${lightStatus.isOpenLight2}、" +
|
||||
"氛围灯开关:${lightStatus.isOpenatmosphere}、")
|
||||
UiThreadHandler.post {
|
||||
viewCallback?.setLightAtmosphereView(lightStatus.isOpenatmosphere,isFirst)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置空调
|
||||
*/
|
||||
fun openAndSetAircondition(modeCmd: Int, windSpeedCmd: Int, temperatureCmd: Int) {
|
||||
CallerLogger.d(M_BUS_P + TAG, "" +
|
||||
"打开空调,模式$modeCmd--档位${windSpeedCmd}--温度:$temperatureCmd")
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1AirConditionerCmd(1,modeCmd,windSpeedCmd,temperatureCmd)
|
||||
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("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
}
|
||||
fun closeAircondition(modeCmd: Int, windSpeedCmd: Int, temperatureCmd: Int) {
|
||||
CallerLogger.d(M_BUS_P + TAG, "关闭空调")
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1AirConditionerCmd(2,modeCmd,windSpeedCmd,temperatureCmd)
|
||||
RxUtils.disposeSubscribe(airconditionDisposable)
|
||||
airconditionDisposable = RxUtils.createSubscribe(10000){
|
||||
if (LightAirconditionDoorStatusManager.airconditionStatus.isOpen) {
|
||||
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 设置暖风
|
||||
*/
|
||||
fun openAndSetHeader(windSpeedCmd: Int) {
|
||||
CallerLogger.d(M_BUS_P + TAG, "打开暖风机、档位${windSpeedCmd}")
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1HeaderCmd(1,windSpeedCmd)
|
||||
RxUtils.disposeSubscribe(heaterDisposable)
|
||||
heaterDisposable = RxUtils.createSubscribe(10000){
|
||||
if (!LightAirconditionDoorStatusManager.heaterStatue.isOpen&&
|
||||
LightAirconditionDoorStatusManager.heaterStatue.windSpeed!=windSpeedCmd) {
|
||||
ToastCharterUtils.showShort("暖风机操作未生效,请稍后重试吧~")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun closeHeader(){
|
||||
CallerLogger.d(M_BUS_P + TAG, "关闭暖风机")
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1HeaderCmd(2,0)
|
||||
RxUtils.disposeSubscribe(heaterDisposable)
|
||||
heaterDisposable = RxUtils.createSubscribe(10000){
|
||||
if (LightAirconditionDoorStatusManager.heaterStatue.isOpen) {
|
||||
ToastCharterUtils.showShort("暖风机操作未生效,请稍后重试吧~")//还是开着的
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setLightData1(leftLight: Boolean){
|
||||
CallerLogger.d(M_BUS_P + TAG, "顶灯2:$leftLight")
|
||||
RxUtils.disposeSubscribe(subscribeLightTop1)
|
||||
subscribeLightTop1 = if(leftLight){
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp1Cmd(1)
|
||||
RxUtils.createSubscribe{
|
||||
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenLight1) {
|
||||
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
}else{
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp1Cmd(2)
|
||||
RxUtils.createSubscribe{
|
||||
if (LightAirconditionDoorStatusManager.lightStatus.isOpenLight1) {
|
||||
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fun setLightData2(rightLight: Boolean){
|
||||
CallerLogger.d(M_BUS_P + TAG, "顶灯1:$rightLight")
|
||||
RxUtils.disposeSubscribe(subscribeLightTop2)
|
||||
subscribeLightTop2 = if(rightLight){
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp2Cmd(1)
|
||||
RxUtils.createSubscribe{
|
||||
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenLight2) {
|
||||
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
}else{
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1MainLamp2Cmd(2)
|
||||
RxUtils.createSubscribe{
|
||||
if (LightAirconditionDoorStatusManager.lightStatus.isOpenLight2) {
|
||||
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fun setAtmosphereLightData2(atmosphereLight: Boolean){
|
||||
CallerLogger.d(M_BUS_P + TAG, "氛围灯:$atmosphereLight")
|
||||
RxUtils.disposeSubscribe(subscribeLightAtmosphere)
|
||||
subscribeLightAtmosphere = if (atmosphereLight) {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1SmallLampCmd(1)
|
||||
RxUtils.createSubscribe{
|
||||
if (!LightAirconditionDoorStatusManager.lightStatus.isOpenatmosphere) {
|
||||
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1SmallLampCmd(2)
|
||||
RxUtils.createSubscribe{
|
||||
if (LightAirconditionDoorStatusManager.lightStatus.isOpenatmosphere) {
|
||||
ToastCharterUtils.showShort("控制系统繁忙,请稍后再试")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
interface SoftControlCallback{
|
||||
/**
|
||||
* 根据车的状态会写页面状态
|
||||
*/
|
||||
fun setAirconditionHeaterView(
|
||||
airIsOpen: Boolean,
|
||||
heaterIsOpen: Boolean,
|
||||
temperatureCmd: Int,
|
||||
pattern: Int,
|
||||
windSpeed: Int
|
||||
)
|
||||
fun setLightTop1View(leftLight: Boolean, isFirst: Boolean)
|
||||
fun setLightTop2View(rightLight: Boolean, isFirst: Boolean)
|
||||
fun setLightView(leftLight: Boolean, rightLight: Boolean)
|
||||
fun setLightAtmosphereView(atmosphereLight: Boolean, isFirst: Boolean)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.adapter;
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.layoutmanage;
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage;
|
||||
|
||||
import android.graphics.PointF;
|
||||
import android.os.Build;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.layoutmanage;
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.layoutmanage;
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view;
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
@@ -8,7 +8,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.och.bus.passenger.ui.adapter.TemperatureAdapter;
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.adapter.TemperatureAdapter;
|
||||
|
||||
public class HorizontalDecoration extends RecyclerView.ItemDecoration {
|
||||
private int space = 0;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.layoutmanage;
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage;
|
||||
|
||||
public class ItemTransformation {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.layoutmanage
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.OrientationHelper
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view;
|
||||
package com.mogo.och.bus.passenger.ui.softcontrol.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -18,27 +18,15 @@ import java.lang.ref.WeakReference;
|
||||
public class DrawableCheckBox extends androidx.appcompat.widget.AppCompatCheckBox {
|
||||
|
||||
public DrawableCheckBox(Context context, AttributeSet attrs, int defStyle) {
|
||||
|
||||
super(context, attrs, defStyle);
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
public DrawableCheckBox(Context context, AttributeSet attrs) {
|
||||
|
||||
super(context, attrs);
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
public DrawableCheckBox(Context context) {
|
||||
|
||||
super(context);
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,11 +47,8 @@ public class DrawableCheckBox extends androidx.appcompat.widget.AppCompatCheckBo
|
||||
int y = getWidth();
|
||||
canvas.translate((getWidth() - bodyWidth) / 2, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
super.onDraw(canvas);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view.statusbar
|
||||
package com.mogo.och.bus.passenger.ui.statusbar
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view.statusbar
|
||||
package com.mogo.och.bus.passenger.ui.statusbar
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view
|
||||
package com.mogo.och.bus.passenger.ui.toast
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.view
|
||||
package com.mogo.och.bus.passenger.ui.video
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
@@ -47,8 +47,8 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
private lateinit var layoutBottom: ConstraintLayout
|
||||
private lateinit var vPpenLeft: View
|
||||
|
||||
private var fullVideoPlayer:ConsultVideoPlayer?=null
|
||||
var smalllPlayer:ConsultVideoPlayer?=null
|
||||
private var fullVideoPlayer: ConsultVideoPlayer?=null
|
||||
var smalllPlayer: ConsultVideoPlayer?=null
|
||||
|
||||
private var currentTime = 0
|
||||
|
||||
@@ -457,7 +457,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
return Math.ceil((25 * context.resources.displayMetrics.density).toDouble()).toInt()
|
||||
}
|
||||
|
||||
fun clearFullscreenLayout(gsyVideoPlayer:ConsultVideoPlayer) {
|
||||
fun clearFullscreenLayout(gsyVideoPlayer: ConsultVideoPlayer) {
|
||||
mIfCurrentIsFullscreen = false
|
||||
val delay = 100
|
||||
gsyVideoPlayer.smalllPlayer = null
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.dialogfragment.fragment
|
||||
package com.mogo.och.bus.passenger.ui.video
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
@@ -7,11 +7,10 @@ import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.TaxiPassengerVideoPlay
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionVideoPresenter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.RecyclerVideoAdapter
|
||||
import com.mogo.och.bus.passenger.ui.layoutmanage.CarouselLayoutManager
|
||||
import com.mogo.och.bus.passenger.ui.layoutmanage.CarouselZoomPostLayoutListener
|
||||
import com.mogo.och.bus.passenger.ui.layoutmanage.CenterScrollListener
|
||||
import com.mogo.och.bus.passenger.view.ConsultVideoPlayer
|
||||
import com.mogo.och.bus.passenger.ui.video.adapter.RecyclerVideoAdapter
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage.CarouselLayoutManager
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage.CarouselZoomPostLayoutListener
|
||||
import com.mogo.och.bus.passenger.ui.softcontrol.layoutmanage.CenterScrollListener
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
import kotlinx.android.synthetic.main.m1_video_fragment.*
|
||||
import kotlin.math.floor
|
||||
@@ -67,7 +66,7 @@ class M1VideoFragment :
|
||||
}
|
||||
|
||||
override fun pageStop() {
|
||||
val (_: kotlin.Int, player) = getPlayer(carouselLayoutManager)
|
||||
val (_, player) = getPlayer(carouselLayoutManager)
|
||||
if (player is ConsultVideoPlayer) {
|
||||
player.onVideoPause()
|
||||
}
|
||||
@@ -92,7 +91,7 @@ class M1VideoFragment :
|
||||
rvVideoPlaylist
|
||||
)
|
||||
recyclerVideoAdapter.setOnThumbImageClilckListener {
|
||||
val (_: kotlin.Int, player) = getPlayer(carouselLayoutManager)
|
||||
val (_, player) = getPlayer(carouselLayoutManager)
|
||||
if (player is ConsultVideoPlayer) {
|
||||
player.onVideoReset()
|
||||
player.thumbImageViewLayout.visibility = View.VISIBLE
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.adapter;
|
||||
package com.mogo.och.bus.passenger.ui.video.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
@@ -6,7 +6,7 @@ import android.view.View;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.view.ConsultVideoPlayer;
|
||||
import com.mogo.och.bus.passenger.ui.video.ConsultVideoPlayer;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
|
||||
public class RecyclerItemVideoHolder extends RecyclerView.ViewHolder {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.passenger.ui.adapter;
|
||||
package com.mogo.och.bus.passenger.ui.video.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui.view
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
|
||||
import com.mogo.och.bus.passenger.R
|
||||
|
||||
class EndOrderView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_order_end, this, true)
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,9 @@ package com.mogo.och.bus.passenger.utils
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import com.mogo.och.bus.passenger.view.ConsultVideoPlayer
|
||||
import com.mogo.och.bus.passenger.ui.video.ConsultVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import java.lang.Exception
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ 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.view.ToastCharterView
|
||||
import com.mogo.och.bus.passenger.ui.toast.ToastCharterView
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
object ToastCharterUtils {
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.view;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Region;
|
||||
import android.os.Build;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 为RecyclerView设置圆角
|
||||
*/
|
||||
public class RecyclerViewCornerRadius extends RecyclerView.ItemDecoration {
|
||||
public static final String TAG = "RecyclerViewCornerRadius";
|
||||
|
||||
private RectF rectF;
|
||||
private Path path;
|
||||
|
||||
private int topLeftRadius = 0;
|
||||
private int topRightRadius = 0;
|
||||
private int bottomLeftRadius = 0;
|
||||
private int bottomRightRadius = 0;
|
||||
|
||||
public RecyclerViewCornerRadius(final RecyclerView recyclerView) {
|
||||
recyclerView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
rectF = new RectF(0, 0, recyclerView.getMeasuredWidth(), recyclerView.getMeasuredHeight());
|
||||
|
||||
path = new Path();
|
||||
path.reset();
|
||||
path.addRoundRect(rectF, new float[]{
|
||||
topLeftRadius, topLeftRadius,
|
||||
topRightRadius, topRightRadius,
|
||||
bottomLeftRadius, bottomLeftRadius,
|
||||
bottomRightRadius, bottomRightRadius
|
||||
}, Path.Direction.CCW);
|
||||
|
||||
recyclerView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setCornerRadius(int radius) {
|
||||
this.topLeftRadius = radius;
|
||||
this.topRightRadius = radius;
|
||||
this.bottomLeftRadius = radius;
|
||||
this.bottomRightRadius = radius;
|
||||
}
|
||||
|
||||
public void setCornerRadius(int topLeftRadius, int topRightRadius, int bottomLeftRadius, int bottomRightRadius) {
|
||||
this.topLeftRadius = topLeftRadius;
|
||||
this.topRightRadius = topRightRadius;
|
||||
this.bottomLeftRadius = bottomLeftRadius;
|
||||
this.bottomRightRadius = bottomRightRadius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
c.clipRect(rectF);
|
||||
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
c.clipPath(path);
|
||||
} else {
|
||||
c.clipPath(path, Region.Op.REPLACE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.impl.GoViewWithArrive
|
||||
<com.mogo.och.bus.passenger.ui.bottom.impl.GoViewWithArrive
|
||||
android:id="@+id/aciv_center_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -26,7 +26,7 @@
|
||||
android:layout_height="@dimen/dp_107"/>
|
||||
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.impl.StopSiteView
|
||||
<com.mogo.och.bus.passenger.ui.bottom.impl.StopSiteView
|
||||
android:id="@+id/actv_stop_site"
|
||||
app:backageViewId="@+id/actv_stop_site_press"
|
||||
app:selectedDrawable="@drawable/charter_p_bottom_stopsite_press"
|
||||
@@ -48,7 +48,7 @@
|
||||
android:layout_width="@dimen/dp_359"
|
||||
android:layout_height="@dimen/dp_107"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.impl.CloseDoorView
|
||||
<com.mogo.och.bus.passenger.ui.bottom.impl.CloseDoorView
|
||||
android:id="@+id/actv_close_door"
|
||||
app:backageViewId="@+id/actv_close_door_press"
|
||||
app:selectedDrawable="@drawable/charter_p_bottom_closedoor_press"
|
||||
@@ -70,7 +70,7 @@
|
||||
android:layout_width="@dimen/dp_359"
|
||||
android:layout_height="@dimen/dp_107"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.impl.OpenDoorView
|
||||
<com.mogo.och.bus.passenger.ui.bottom.impl.OpenDoorView
|
||||
android:id="@+id/actv_open_door"
|
||||
android:gravity="center"
|
||||
app:backageViewId="@+id/actv_open_door_press"
|
||||
@@ -93,7 +93,7 @@
|
||||
android:layout_width="@dimen/dp_359"
|
||||
android:layout_height="@dimen/dp_107"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.BottomOrderInfoView
|
||||
<com.mogo.och.bus.passenger.ui.bottom.BottomOrderInfoView
|
||||
android:id="@+id/cl_order_time"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actv_setting"
|
||||
@@ -112,7 +112,7 @@
|
||||
android:layout_width="@dimen/dp_359"
|
||||
android:layout_height="@dimen/dp_107"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.BottomCheckView
|
||||
<com.mogo.och.bus.passenger.ui.bottom.BottomCheckView
|
||||
android:id="@+id/actv_setting"
|
||||
app:backageViewId="@+id/actv_setting_press"
|
||||
app:selectedDrawable="@drawable/charter_p_bottom_softsettiing_press"
|
||||
@@ -135,7 +135,7 @@
|
||||
android:layout_width="@dimen/dp_359"
|
||||
android:layout_height="@dimen/dp_107"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.BottomCheckView
|
||||
<com.mogo.och.bus.passenger.ui.bottom.BottomCheckView
|
||||
android:id="@+id/actv_line"
|
||||
app:backageViewId="@+id/actv_line_press"
|
||||
app:selectedDrawable="@drawable/charter_p_bottom_line_press"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.BottomBar
|
||||
<com.mogo.och.bus.passenger.ui.bottom.BottomBar
|
||||
android:id="@+id/bb_bottom_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -196,7 +196,38 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.BottomBar
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.orderinfo.OrderInfoView
|
||||
android:id="@+id/biz_orderinfo"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="0dp"
|
||||
android:paddingBottom="@dimen/dp_34_5"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bb_boorombar" />
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.softcontrol.SoftControlView
|
||||
android:id="@+id/biz_softcontrol"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:paddingBottom="@dimen/dp_34_5"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bb_boorombar"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.selectline.SelectLineView
|
||||
android:id="@+id/biz_selectline"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="gone"
|
||||
android:paddingBottom="@dimen/dp_34_5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bb_boorombar"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.bottom.BottomBar
|
||||
android:id="@+id/bb_boorombar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
<!-- 订单主页面 -->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="@dimen/dp_936"
|
||||
android:layout_height="@dimen/dp_500"
|
||||
android:layout_marginStart="@dimen/dp_286"
|
||||
android:background="@drawable/charter_p_select_line_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="936:500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.4875">
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/lsv_line_site"
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/gl_left"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.bus.passenger.view.DrawBitmapView
|
||||
<com.mogo.och.bus.passenger.ui.softcontrol.view.DrawBitmapView
|
||||
android:id="@+id/dbv_wind"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
@@ -91,7 +91,7 @@
|
||||
app:layout_constraintHeight_percent="0.5"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_aircondition" />
|
||||
|
||||
<com.mogo.och.bus.passenger.view.DrawableCheckBox
|
||||
<com.mogo.och.bus.passenger.ui.softcontrol.view.DrawableCheckBox
|
||||
android:id="@+id/tv_aircondition_switch"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
android:layout_marginStart="@dimen/dp_80" />
|
||||
|
||||
<!--魔方连接状态-->
|
||||
<com.mogo.och.bus.passenger.view.statusbar.M1BlueToothView
|
||||
<com.mogo.och.bus.passenger.ui.statusbar.M1BlueToothView
|
||||
android:id="@+id/blueToothView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:layout_width="@dimen/dp_1300"
|
||||
android:layout_height="@dimen/dp_731">
|
||||
|
||||
<com.mogo.och.bus.passenger.view.ConsultVideoPlayer
|
||||
<com.mogo.och.bus.passenger.ui.video.ConsultVideoPlayer
|
||||
android:id="@+id/video_item_player"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="@dimen/dp_1300"
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.bottom.BottomBar
|
||||
<com.mogo.och.bus.passenger.ui.bottom.BottomBar
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user