diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/LoopInfo.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/LoopInfo.kt index a6c0cccf5b..a987ec2d5c 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/LoopInfo.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/LoopInfo.kt @@ -2,4 +2,10 @@ package com.mogo.och.common.module.manager.loopmanager import io.reactivex.Scheduler +/** + * interval 轮训间隔 + * function 轮询执行的方法 + * immediately 是否立刻执行 + * scheduler 轮训执行的线程 + */ data class LoopInfo(val interval:Long,val function: () -> Unit,val immediately:Boolean=false,var scheduler: Scheduler? = null) \ No newline at end of file diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.kt index 4605a4ae5c..c1b148e1c0 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.kt +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.kt @@ -242,7 +242,7 @@ object TaxiPassengerModel { //1. 处理进行中订单 mInServiceList = data.data.servicing - if (data.data.servicing != null && !data.data.servicing.isEmpty()) { + if (data.data.servicing != null && data.data.servicing.isNotEmpty()) { // 1.1. 当存在进行中单时:对本地currentOrder进行更新 if (currentOCHOrder == null) { //1.1.1. 当本地无currentOrder(已经完成or取消),则更新currentOrder,并通知ui更新 diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java index 42c739cee9..98ba9732ff 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java @@ -58,8 +58,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment mArrivedEndView; @@ -68,12 +66,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment { - if (show) { - viewPassengerMsgBoxList.setVisibility(View.VISIBLE); - viewPassengerMsgBoxBubble.setVisibility(View.GONE); - viewPassengerMsgBoxBubble.isShowData(false); - } else { - viewPassengerMsgBoxList.setVisibility(View.GONE); - viewPassengerMsgBoxBubble.setVisibility(View.VISIBLE); - viewPassengerMsgBoxBubble.isShowData(true); - } - }); } @Override @@ -136,45 +109,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment { - IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController(); - if (controller != null) { - //切换地图的远近视图 - if (controller.getCurrentMapVisualAngle().isLongSight()) { - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); - controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); - mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium); - } else if (controller.getCurrentMapVisualAngle().isMediumSight()) { - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); - controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null); - mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_long); - } else { - controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); - mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium); - } - } - //OverlayLeftViewUtils.INSTANCE.dismissOverlayView(); - }); - findViewById(R.id.iv_temp).setOnClickListener(view -> { - OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(), 0, true, -1, true); - //showOrHideArrivedEndLayout(true, "北京北京北京", "1527481606997577728"); - //showOrHidePressengerCheckPager(true, "开始站点开", "开始站点开始站点开始", "2", "京A888888", "18811539480"); - //OCHFloatWindowManager.getInstance().ShowFloatWindow(getContext()); - }); } private void initArrivedView() { @@ -191,9 +126,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState()), 1000L); - } - @NonNull @Override protected BaseTaxiPassengerPresenter createPresenter() { diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/bottom/BottomBar.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/bottom/BottomBar.kt new file mode 100644 index 0000000000..ed6fc91156 --- /dev/null +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/bottom/BottomBar.kt @@ -0,0 +1,96 @@ +package com.mogo.och.taxi.passenger.ui.bottom + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.och.taxi.passenger.R +import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_overmapview +import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_roma +import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_setting +import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_video + +class BottomBar @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr) { + + private var checkIndex = SelectView.None + private var overMapViewApply:ApplyClickLintener?=null + private var videoApply:ApplyClickLintener?=null + private var romaApply:ApplyClickLintener?=null + private var settingApply:ApplyClickLintener?=null + init { + isClickable = true + LayoutInflater.from(context).inflate(R.layout.taxi_p_bottom_bar, this, true) + setBackgroundResource(R.drawable.taxi_p_bottom_bar_bg) + actv_overmapview.setOnClickListener { + setCheckIndex(SelectView.OVERMAPVIEW) + overMapViewApply?.onApplyClick() + } + actv_video.setOnClickListener { + setCheckIndex(SelectView.VIDEO) + videoApply?.onApplyClick() + } + actv_roma.setOnClickListener { + setCheckIndex(SelectView.ROMA) + romaApply?.onApplyClick() + } + actv_setting.setOnClickListener { + setCheckIndex(SelectView.SETTING) + settingApply?.onApplyClick() + } + } + + fun setOverMapApplyClick(overMapViewApply:ApplyClickLintener){ + this.overMapViewApply = overMapViewApply + } + fun setVideoApplyClick(overMapViewApply:ApplyClickLintener){ + this.videoApply = overMapViewApply + } + fun setRomaApplyClick(overMapViewApply:ApplyClickLintener){ + this.romaApply = overMapViewApply + } + fun setSettingApplyClick(overMapViewApply:ApplyClickLintener){ + this.settingApply = overMapViewApply + } + + fun setCheckIndex(index: SelectView){ + if(checkIndex==index){ + checkIndex = SelectView.None + }else{ + checkIndex = index + } + if(checkIndex == SelectView.OVERMAPVIEW){ + actv_overmapview.setCheckItem(true) + }else{ + actv_overmapview.setCheckItem(false) + } + if(checkIndex == SelectView.VIDEO){ + actv_video.setCheckItem(true) + }else{ + actv_video.setCheckItem(false) + } + if(checkIndex == SelectView.ROMA){ + actv_roma.setCheckItem(true) + }else{ + actv_roma.setCheckItem(false) + } + if(checkIndex == SelectView.SETTING){ + actv_setting.setCheckItem(true) + }else{ + actv_setting.setCheckItem(false) + } + + } + + enum class SelectView{ + None,OVERMAPVIEW,VIDEO,ROMA,SETTING + } + + interface ApplyClickLintener{ + fun onApplyClick() + } + +} \ No newline at end of file diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/bottom/BottomCheckView.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/bottom/BottomCheckView.kt new file mode 100644 index 0000000000..4d8d70e314 --- /dev/null +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/bottom/BottomCheckView.kt @@ -0,0 +1,92 @@ +package com.mogo.och.bus.passenger.ui.view.bottom + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.content.ContextCompat +import com.mogo.och.taxi.passenger.R +import kotlinx.android.synthetic.main.m1_bottom_check.view.aciv_center_image +import kotlinx.android.synthetic.main.m1_bottom_check.view.actv_title + +open class BottomCheckView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr) { + + companion object { + private const val TAG = "StopSiteView" + } + + private var backageViewId: Int = -1 + private var bottomTitle: String = "" + private var selectedDrawable: Int = -1 + private var normalDrawable: Int = -1 + private var bottomTitleNormalColor:Int = -1 + private var bottomTitleCheckedColor:Int = -1 + private var backageView: View? = null + + private var isCheck = false + + init { + LayoutInflater.from(context).inflate(R.layout.m1_bottom_check, this, true) + try { + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.BottomSelectView) + backageViewId = typedArray.getResourceId(R.styleable.BottomSelectView_backageViewId, -1) + bottomTitle = typedArray.getString(R.styleable.BottomSelectView_bottomTitle) ?: "" + selectedDrawable = typedArray.getResourceId(R.styleable.BottomSelectView_selectedDrawable, -1) + normalDrawable = typedArray.getResourceId(R.styleable.BottomSelectView_normalDrawable, -1) + bottomTitleNormalColor = typedArray.getColor(R.styleable.BottomSelectView_bottomTitleNormalColor, + ContextCompat.getColor(context,R.color.white)) + bottomTitleCheckedColor = typedArray.getColor(R.styleable.BottomSelectView_bottomTitleCheckedColor, + ContextCompat.getColor(context,R.color.white)) + typedArray.recycle() + initView(context) + } catch (e: Exception) { + e.printStackTrace() + } + + } + + private fun initView(context: Context) { + if (selectedDrawable > 0) { + aciv_center_image.setImageResource(normalDrawable) + } + actv_title.text = bottomTitle + } + + fun setCheckItem(isCheck: Boolean) { + if (isCheck != this.isCheck) { + this.isCheck = isCheck + notifiBackageView() + } + } + + private fun notifiBackageView() { + if (isCheck) { + backageView?.visibility = View.VISIBLE + aciv_center_image.setImageResource(selectedDrawable) + actv_title.setTextColor(bottomTitleNormalColor) + } else { + backageView?.visibility = View.GONE + aciv_center_image.setImageResource(normalDrawable) + actv_title.setTextColor(bottomTitleCheckedColor) + } + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + parent?.let { + if (parent is ConstraintLayout) { + if (backageViewId > 0) { + backageView = (parent as ConstraintLayout).findViewById(backageViewId) + } + } + } + if (isCheck) { + backageView?.visibility = View.VISIBLE + } + } +} \ No newline at end of file diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/orderinfo/ItineraryView.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/orderinfo/ItineraryView.kt new file mode 100644 index 0000000000..0effb501b0 --- /dev/null +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/orderinfo/ItineraryView.kt @@ -0,0 +1,70 @@ +package com.mogo.och.taxi.passenger.ui.orderinfo + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import androidx.appcompat.widget.AppCompatTextView +import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.och.taxi.passenger.R + +class ItineraryView(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : + ConstraintLayout(context, attrs, defStyleAttr, defStyleRes) { + + // 速度 + lateinit var actvSpeedValue: AppCompatTextView + // 速度单位 + lateinit var actvSpeedUnit: AppCompatTextView + // 终点站 + lateinit var actvEndstation: AppCompatTextView + // 距离终点距离 + lateinit var actvDistance: AppCompatTextView + // 距离终点距离单位 + lateinit var actvDistanceUnit: AppCompatTextView + // 剩余时间 + lateinit var actvSurplusTime: AppCompatTextView + // 剩余时间单位 + lateinit var actvSurplusTimeUnit: AppCompatTextView + // 到达时间 + lateinit var actvArrivedTime: AppCompatTextView + + private fun initView(context: Context?) { + LayoutInflater.from(context).inflate(R.layout.taxi_p_itinerary, this, true) + actvSpeedValue = findViewById(R.id.actv_speed_value) + actvSpeedUnit = findViewById(R.id.actv_speed_unit) + actvEndstation = findViewById(R.id.actv_endstation) + actvDistance = findViewById(R.id.actv_distance) + actvDistanceUnit = findViewById(R.id.actv_distance_unit) + actvSurplusTime = findViewById(R.id.actv_surplus_time) + actvSurplusTimeUnit = findViewById(R.id.actv_surplus_time_unit) + actvArrivedTime = findViewById(R.id.actv_arrived_time) + } + + fun setSpeed(speedValue:String,speedUnit:String){ + actvSpeedValue.text = speedValue + actvSpeedUnit.text = speedUnit + } + fun setEndStation(endStation:String){ + actvEndstation.text = endStation + } + + fun setDistanceInfo(distance:String,distanceUnit:String, + surplusTime:String,surplusTimeUnit:String, + arrivedTime:String + ){ + actvDistance.text = distance + actvDistanceUnit.text = distanceUnit + actvSurplusTime .text= surplusTime + actvSurplusTimeUnit.text = surplusTimeUnit + actvArrivedTime .text= arrivedTime + } + + init { + try { + initView(context) + } catch (e: Exception) { + e.printStackTrace() + } + } + + +} \ No newline at end of file diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/charter_p_bottom_softsettiing_normal.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/charter_p_bottom_softsettiing_normal.png new file mode 100644 index 0000000000..8d3c31d0d4 Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/charter_p_bottom_softsettiing_normal.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/charter_p_bottom_softsettiing_press.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/charter_p_bottom_softsettiing_press.png new file mode 100644 index 0000000000..07ab27a462 Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/charter_p_bottom_softsettiing_press.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/taxi_p_bottom_bar_bg.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/taxi_p_bottom_bar_bg.png new file mode 100644 index 0000000000..8cdac88f73 Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/taxi_p_bottom_bar_bg.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/taxi_p_bottom_bar_select_bg.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/taxi_p_bottom_bar_select_bg.png new file mode 100644 index 0000000000..d033e0a51c Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable-xhdpi/taxi_p_bottom_bar_select_bg.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/layout/m1_bottom_check.xml b/OCH/mogo-och-taxi-passenger/src/main/res/layout/m1_bottom_check.xml new file mode 100644 index 0000000000..b6cd6a1a9a --- /dev/null +++ b/OCH/mogo-och-taxi-passenger/src/main/res/layout/m1_bottom_check.xml @@ -0,0 +1,28 @@ + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml index a5533567ba..e9488c88d9 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml +++ b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml @@ -18,28 +18,6 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> - - - - - - - - - - - - - -