[Opt3.0]消息盒子
This commit is contained in:
@@ -29,6 +29,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
@@ -77,6 +80,11 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
private ImageView mSwitchMapModeImage;
|
||||
private LinearLayout mSwitchMapModeLayout;
|
||||
|
||||
//消息盒子
|
||||
private DriverMsgBoxButtonView viewDriverMsgBoxButton;
|
||||
private DriverMsgBoxListView viewDriverMsgBoxList;
|
||||
private DriverMsgBoxBubbleView viewDriverMsgBoxBubble;
|
||||
|
||||
private ObjectAnimator autopilotLoadingAnimator;
|
||||
|
||||
public boolean isAnimateRunning = false;
|
||||
@@ -194,6 +202,22 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
if (mAICollectBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
|
||||
}
|
||||
//消息盒子
|
||||
viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton);
|
||||
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList);
|
||||
viewDriverMsgBoxBubble = findViewById(R.id.viewDriverMsgBoxBubble);
|
||||
viewDriverMsgBoxButton.setClickListener(show -> {
|
||||
if(show){
|
||||
viewDriverMsgBoxList.setVisibility(View.VISIBLE);
|
||||
viewDriverMsgBoxList.notifyData();
|
||||
viewDriverMsgBoxBubble.setVisibility(View.GONE);
|
||||
viewDriverMsgBoxBubble.isShowData(false);
|
||||
}else{
|
||||
viewDriverMsgBoxList.setVisibility(View.GONE);
|
||||
viewDriverMsgBoxBubble.setVisibility(View.VISIBLE);
|
||||
viewDriverMsgBoxBubble.isShowData(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="SpeakableTextPresentCheck"
|
||||
@@ -63,6 +64,7 @@
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
@@ -77,6 +79,35 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
/>
|
||||
<!--消息盒子打开视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864dp"
|
||||
android:layout_height="746dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDriverMsgBoxButton" />
|
||||
<!--消息盒子气泡视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDriverMsgBoxButton" />
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.och.taxi.passenger.mulprocess.ICallback;
|
||||
interface ILeftMenuService {
|
||||
|
||||
/**
|
||||
* 向主进程传选中的item
|
||||
* Pass the selected item to the main process
|
||||
*/
|
||||
void transmissionIndex(int index);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
@@ -607,6 +608,26 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
};
|
||||
|
||||
private final IMsgBoxEventListener iMsgBoxEventListener = new IMsgBoxEventListener() {
|
||||
@Override
|
||||
public void onBubbleReportClickEvent(@NonNull MsgBoxBean msgBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBubbleV2XClickEvent(@NonNull MsgBoxBean msgBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBubbleOperationClickEvent(@NonNull MsgBoxBean msgBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTipEvent(boolean isShow) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSummaryClickEvent() {
|
||||
if (mCurrentOCHOrder == null){
|
||||
|
||||
@@ -21,6 +21,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView;
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
@@ -61,6 +64,10 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private WeakReference<TaxiPassengerCheckView> mArrivedCheckView;
|
||||
private WeakReference<TaxiPassengerStartAutopilotView> mStartAutopilotView;
|
||||
protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null;
|
||||
//消息盒子
|
||||
private PassengerMsgBoxButtonView viewPassengerMsgBoxButton;
|
||||
private PassengerMsgBoxBubbleView viewPassengerMsgBoxBubble;
|
||||
private PassengerMsgBoxListView viewPassengerMsgBoxList;
|
||||
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
@@ -100,6 +107,22 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
switchVRFlatMode(MogoStatusManager.getInstance().isVrMode());
|
||||
//预加载视频进程
|
||||
EmptyService.Companion.startService(getContext());
|
||||
|
||||
//消息盒子
|
||||
viewPassengerMsgBoxButton = findViewById(R.id.viewPassengerMsgBoxButton);
|
||||
viewPassengerMsgBoxBubble = findViewById(R.id.viewPassengerMsgBoxBubble);
|
||||
viewPassengerMsgBoxList = findViewById(R.id.viewPassengerMsgBoxList);
|
||||
viewPassengerMsgBoxButton.setClickListener(show -> {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon() {
|
||||
|
||||
@@ -50,6 +50,36 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--消息盒子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView
|
||||
android:id="@+id/viewPassengerMsgBoxButton"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="320dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
/>
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="650dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintRight_toRightOf="@id/viewPassengerMsgBoxButton" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
|
||||
android:id="@+id/viewPassengerMsgBoxList"
|
||||
android:layout_width="650dp"
|
||||
android:layout_height="750dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewPassengerMsgBoxButton"
|
||||
app:layout_constraintRight_toRightOf="@id/viewPassengerMsgBoxButton" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_temp"
|
||||
android:layout_width="300dp"
|
||||
|
||||
@@ -32,6 +32,9 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
@@ -74,6 +77,11 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected RelativeLayout mSettingBtn;
|
||||
protected LinearLayout mBadcaseBtn;
|
||||
protected LinearLayout mAICollectBtn;
|
||||
//消息盒子
|
||||
protected DriverMsgBoxButtonView driverMsgBoxButtonView;
|
||||
protected DriverMsgBoxListView viewDriverMsgBoxList;
|
||||
protected DriverMsgBoxBubbleView viewDriverMsgBoxBubble;
|
||||
|
||||
protected TaxiAmapNaviFragment ochAmapNaviFragment = null;
|
||||
protected TaxiRottingNaviFragment taxiRottingNaviFragment = null;
|
||||
// protected TaxiTrafficLightView mTrafficLightView;
|
||||
@@ -153,7 +161,9 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
mAnimFlowIv = findViewById(R.id.anim_flow_iv);
|
||||
mAutopilotTv = findViewById(R.id.module_och_autopilot_tv);
|
||||
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container);
|
||||
|
||||
driverMsgBoxButtonView = findViewById(R.id.viewDriverMsgBoxButton);
|
||||
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList);
|
||||
viewDriverMsgBoxBubble = findViewById(R.id.viewDriverMsgBoxBubble);
|
||||
// mTrafficLightView = findViewById(R.id.taxi_traffic_light_view);
|
||||
// CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
|
||||
|
||||
@@ -267,6 +277,19 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
showAmapNaviToStationFragment(false);
|
||||
showRottingToStationFragment(false);
|
||||
});
|
||||
|
||||
driverMsgBoxButtonView.setClickListener(show -> {
|
||||
if(show){
|
||||
viewDriverMsgBoxList.setVisibility(View.VISIBLE);
|
||||
viewDriverMsgBoxList.notifyData();
|
||||
viewDriverMsgBoxBubble.setVisibility(View.GONE);
|
||||
viewDriverMsgBoxBubble.isShowData(false);
|
||||
}else{
|
||||
viewDriverMsgBoxList.setVisibility(View.GONE);
|
||||
viewDriverMsgBoxBubble.setVisibility(View.VISIBLE);
|
||||
viewDriverMsgBoxBubble.isShowData(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void onChangeOperationStatus() {
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
@@ -135,6 +136,35 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
/>
|
||||
<!--消息盒子打开视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864dp"
|
||||
android:layout_height="746dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDriverMsgBoxButton" />
|
||||
<!--消息盒子气泡视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDriverMsgBoxButton" />
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
|
||||
@@ -98,16 +98,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
|
||||
}
|
||||
|
||||
// todo 新超
|
||||
override fun updateDriverMsgBoxTipView(show: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
// todo 新超
|
||||
override fun updatePassengerMsgBoxTipView(show: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
/** todo ----------------------------------------------**/
|
||||
/**
|
||||
* 设置 红绿灯 代理View
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxBubbleAdapter
|
||||
@@ -83,7 +84,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
if(isShowData){
|
||||
CallerHmiManager.updateDriverMsgBoxTipView(true)
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
if(category == MsgCategory.RECORD_BAG){
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
|
||||
@@ -98,16 +99,12 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
}
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
}
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,8 +3,13 @@ package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_driver_msg_box_button.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -15,19 +20,71 @@ class DriverMsgBoxButtonView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
):ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
):ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxEventListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "DriverMsgBoxButtonView"
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_driver_msg_box_button, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
clickListener?.showMsgBoxList(isChecked)
|
||||
msgBoxTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新新消息提醒红点
|
||||
* @param isShow true:展示;false:不展示
|
||||
*/
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
if(isShow){
|
||||
msgBoxTipView.visibility = View.VISIBLE
|
||||
}else{
|
||||
msgBoxTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxDriver.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxDriver.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxDriver.performClick()
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun showMsgBoxList(show: Boolean)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -7,16 +7,16 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxListAdapter
|
||||
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.layout_driver_msg_box_list.view.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
@@ -32,7 +32,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) , IMsgBoxListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) , IMsgBoxListener, IMsgBoxEventListener {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_list, this, true)
|
||||
@@ -43,11 +43,13 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
private var ipcReportList: ArrayList<MsgBoxBean> ?= null
|
||||
private var badCaseList: ArrayList<MsgBoxBean> ?= null
|
||||
private var driverMsgBoxListAdapter: DriverMsgBoxListAdapter ?=null
|
||||
private var linearLayoutManager: LinearLayoutManager ?= null
|
||||
|
||||
private fun initView() {
|
||||
driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity)
|
||||
rvMsgBoxList.adapter = driverMsgBoxListAdapter
|
||||
rvMsgBoxList.layoutManager = LinearLayoutManager(context)
|
||||
linearLayoutManager = LinearLayoutManager(context)
|
||||
rvMsgBoxList.layoutManager = linearLayoutManager
|
||||
|
||||
//获取通知消息列表
|
||||
noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList<MsgBoxBean>?
|
||||
@@ -193,18 +195,16 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -214,4 +214,36 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
it.remove(msgBoxList)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
MsgBoxConfig.setUserRecord(0)
|
||||
notifyData()
|
||||
noticeList?.let {
|
||||
rvMsgBoxList?.scrollToPosition(it.indexOf(msgBoxBean))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
MsgBoxConfig.setUserRecord(0)
|
||||
notifyData()
|
||||
noticeList?.let {
|
||||
rvMsgBoxList?.scrollToPosition(it.indexOf(msgBoxBean))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
MsgBoxConfig.setUserRecord(1)
|
||||
notifyData()
|
||||
ipcReportList?.let {
|
||||
linearLayoutManager?.scrollToPositionWithOffset(it.indexOf(msgBoxBean),0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxBubbleAdapter
|
||||
@@ -64,7 +65,7 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
|
||||
|| msgBoxList.type == MsgBoxType.OBU){
|
||||
MsgBoxConfig.noticeList.add(msgBoxList)
|
||||
if(isShowData){
|
||||
CallerHmiManager.updatePassengerMsgBoxTipView(true)
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
dataList.add(msgBoxList)
|
||||
passengerMsgBoxBubbleAdapter?.setData(dataList)
|
||||
}
|
||||
@@ -75,18 +76,12 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
}
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
}
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,8 +3,13 @@ package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_passenger_msg_box_button.view.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -15,19 +20,70 @@ class PassengerMsgBoxButtonView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
): ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
): ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxEventListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "PassengerMsgBoxButtonView"
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_passenger_msg_box_button, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||
clickListener?.showMsgBoxList(isChecked)
|
||||
msgBoxPTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新新消息提醒红点
|
||||
* @param isShow true:展示;false:不展示
|
||||
*/
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
if(isShow){
|
||||
msgBoxPTipView.visibility = View.VISIBLE
|
||||
}else{
|
||||
msgBoxPTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxPassenger.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxPassenger.performClick()
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
cbMsgBoxPassenger.performClick()
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun showMsgBoxList(show: Boolean)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,9 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -30,7 +32,7 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IMsgBoxEventListener {
|
||||
|
||||
private val TAG = "PassengerMsgBoxListView"
|
||||
var passengerMsgBoxListAdapter: PassengerMsgBoxListAdapter ?= null
|
||||
@@ -75,18 +77,36 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
}
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
|
||||
}
|
||||
|
||||
override fun onUpdateTipEvent(isShow: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
noticeList?.let {
|
||||
rvPassengerList.scrollToPosition(it.indexOf(msgBoxBean))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,12 +14,14 @@ import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -76,14 +78,19 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
when (holder) {
|
||||
is BubbleOperationHolder -> {
|
||||
data?.let {
|
||||
val operationMsg = it[position].bean as OperationMsg
|
||||
val msgBoxBean = it[position]
|
||||
val operationMsg = msgBoxBean.bean as OperationMsg
|
||||
holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvBubbleOperationContent.text = operationMsg.content
|
||||
holder.clBubbleOperationLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleOperationListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleReportHolder -> {
|
||||
data?.let {
|
||||
val reportEntity = it[position].bean as ReportEntity
|
||||
val msgBoxBean = it[position]
|
||||
val reportEntity = msgBoxBean.bean as ReportEntity
|
||||
holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
var resultStr = "类型:"
|
||||
@@ -91,6 +98,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
|
||||
}
|
||||
holder.tvBubbleReportType.text = resultStr
|
||||
holder.clReportLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleReportListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleNoticeHolder -> {
|
||||
@@ -140,6 +150,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.clV2XLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleSummaryHolder -> {
|
||||
@@ -191,12 +204,14 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
var tvBubbleReportTime: TextView = itemView.findViewById(R.id.tvBubbleReportTime)
|
||||
var tvBubbleReportType: TextView = itemView.findViewById(R.id.tvBubbleReportType)
|
||||
var tvBubbleReceiveTime: TextView = itemView.findViewById(R.id.tvBubbleReceiveTime)
|
||||
var clReportLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clReportLayout)
|
||||
}
|
||||
|
||||
//运营平台
|
||||
class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBubbleOperationTime: TextView = itemView.findViewById(R.id.tvBubbleOperationTime)
|
||||
var tvBubbleOperationContent: TextView = itemView.findViewById(R.id.tvBubbleOperationContent)
|
||||
var clBubbleOperationLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clBubbleOperationLayout)
|
||||
}
|
||||
|
||||
//Notice
|
||||
@@ -213,6 +228,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
var ivV2XImage: ImageView = itemView.findViewById(R.id.ivV2XImage)
|
||||
var tvV2XTime: TextView = itemView.findViewById(R.id.tvV2XTime)
|
||||
var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent)
|
||||
var clV2XLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clV2XLayout)
|
||||
}
|
||||
|
||||
//汇总消息
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -105,6 +106,9 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
holder.tvPassengerV2XContent.text = v2XMsg.content
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.clPassengerVeXLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleSummaryHolder -> {
|
||||
@@ -115,7 +119,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
holder.tvPassengerSummaryCheck.setOnClickListener {
|
||||
//跳转全览模式
|
||||
// CallerHmiManager.showSmallFragment()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
CallerMsgBoxEventListenerManager.invokeSummaryListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,6 +168,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
var ivPassengerV2XImage: ImageView = itemView.findViewById(R.id.ivPassengerV2XImage)
|
||||
var tvPassengerV2XTime: TextView = itemView.findViewById(R.id.tvPassengerV2XTime)
|
||||
var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent)
|
||||
var clPassengerVeXLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clPassengerVeXLayout)
|
||||
}
|
||||
|
||||
//汇总消息
|
||||
|
||||
@@ -107,7 +107,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
|
||||
holder.tvPassengerSummaryCheck.setOnClickListener {
|
||||
//跳转全览模式
|
||||
// CallerHmiManager.showSmallFragment()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
CallerMsgBoxEventListenerManager.invokeSummaryListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,99 +21,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="72dp">
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:button="@null"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<!-- todo 需要放入使用方 , view先gone掉方便重组 -->
|
||||
<!-- app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />-->
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<!--消息盒子乘客端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="320dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/selector_msg_box_p"
|
||||
android:button="@null"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--乘客端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxPTipView"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="50dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="746px"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
|
||||
android:id="@+id/viewPassengerMsgBoxList"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="750px"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
android:id="@+id/turnLightView"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clBubbleOperationLayout"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -7,7 +8,8 @@
|
||||
app:roundLayoutRadius="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp">
|
||||
android:layout_marginBottom="7dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBubbleOperationImage"
|
||||
@@ -61,4 +63,4 @@
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clReportLayout"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -72,4 +73,4 @@
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clV2XLayout"
|
||||
android:layout_width="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -44,4 +45,4 @@
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.eagle.core.widget.RoundCanClickConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clPassengerVeXLayout"
|
||||
android:layout_width="650dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -47,4 +48,4 @@
|
||||
android:layout_marginEnd="25dp"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
android:id="@+id/msgBoxTipView"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<!--乘客端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxPTipView"
|
||||
android:id="@+id/msgBoxPTipView"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
|
||||
@@ -229,16 +229,6 @@ interface IMoGoHmiProvider : IMoGoHmiViewProxy {
|
||||
*/
|
||||
fun updateMfStatus(tag: String, status: Boolean)
|
||||
|
||||
/**
|
||||
* 设置司机端消息盒子是否展示
|
||||
*/
|
||||
fun updateDriverMsgBoxTipView(show: Boolean)
|
||||
|
||||
/**
|
||||
* 设置乘客端消息盒子是否展示
|
||||
*/
|
||||
fun updatePassengerMsgBoxTipView(show: Boolean)
|
||||
|
||||
/**
|
||||
* 调度弹窗展示
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,25 @@
|
||||
package com.mogo.eagle.core.function.api.msgbox
|
||||
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @date 2023/1/16
|
||||
* 消息盒子事件监听回调
|
||||
*/
|
||||
interface IMsgBoxEventListener {
|
||||
//汇总事件点击监听
|
||||
fun onSummaryClickEvent()
|
||||
|
||||
//更新提示红点视图
|
||||
fun onUpdateTipEvent(isShow: Boolean)
|
||||
|
||||
//气泡态运营平台事件点击监听
|
||||
fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean)
|
||||
|
||||
//气泡态V2X消息事件点击监听
|
||||
fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean)
|
||||
|
||||
//气泡态上报消息事件点击监听
|
||||
fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean)
|
||||
}
|
||||
@@ -327,20 +327,6 @@ object CallerHmiManager {
|
||||
waringProviderApi?.updateStatusBarLeftView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置司机端消息盒子是否展示
|
||||
*/
|
||||
fun updateDriverMsgBoxTipView(show: Boolean = false) {
|
||||
waringProviderApi?.updateDriverMsgBoxTipView(show)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置乘客端消息盒子是否展示
|
||||
*/
|
||||
fun updatePassengerMsgBoxTipView(show: Boolean = false) {
|
||||
waringProviderApi?.updatePassengerMsgBoxTipView(show)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏右侧元素
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.call.msgbox
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -12,19 +13,60 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
*/
|
||||
object CallerMsgBoxEventListenerManager: CallerBase<IMsgBoxEventListener>() {
|
||||
|
||||
private val statusListeners: ConcurrentHashMap<String, IMsgBoxEventListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 触发监听
|
||||
* 触发汇总报告点击事件监听
|
||||
*/
|
||||
fun invokeListener(){
|
||||
statusListeners.forEach {
|
||||
fun invokeSummaryListener(){
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onSummaryClickEvent()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新消息提示View展示状态
|
||||
*/
|
||||
fun invokeUpdateTipListener(isShow: Boolean){
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onUpdateTipEvent(isShow)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 气泡态运营平台事件点击监听
|
||||
**/
|
||||
fun invokeBubbleOperationListener(msgBoxBean: MsgBoxBean){
|
||||
M_LISTENERS.forEach{
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onBubbleOperationClickEvent(msgBoxBean)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 气泡态V2X消息事件点击监听
|
||||
*/
|
||||
fun invokeBubbleV2XListener(msgBoxBean: MsgBoxBean){
|
||||
M_LISTENERS.forEach{
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onBubbleV2XClickEvent(msgBoxBean)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 气泡态上报消息事件点击监听
|
||||
*/
|
||||
fun invokeBubbleReportListener(msgBoxBean: MsgBoxBean){
|
||||
M_LISTENERS.forEach{
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onBubbleReportClickEvent(msgBoxBean)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.mogo.eagle.core.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
public class RoundCanClickConstraintLayout extends ConstraintLayout {
|
||||
|
||||
private float roundLayoutRadius = 14f;
|
||||
private Path roundPath;
|
||||
private RectF rectF;
|
||||
|
||||
public RoundCanClickConstraintLayout(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public RoundCanClickConstraintLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundLayout);
|
||||
roundLayoutRadius = typedArray.getDimensionPixelSize(R.styleable.RoundLayout_roundLayoutRadius, (int) roundLayoutRadius);
|
||||
typedArray.recycle();
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
public RoundCanClickConstraintLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setWillNotDraw(false);//如果你继承的是ViewGroup,注意此行,否则draw方法是不会回调的;
|
||||
roundPath = new Path();
|
||||
rectF = new RectF();
|
||||
}
|
||||
|
||||
private void setRoundPath() {
|
||||
//添加一个圆角矩形到path中, 如果要实现任意形状的View, 只需要手动添加path就行
|
||||
roundPath.reset();
|
||||
roundPath.addRoundRect(rectF, roundLayoutRadius, roundLayoutRadius, Path.Direction.CW);
|
||||
}
|
||||
|
||||
public void setRoundLayoutRadius(float roundLayoutRadius) {
|
||||
this.roundLayoutRadius = roundLayoutRadius;
|
||||
setRoundPath();
|
||||
postInvalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
super.onLayout(changed, l, t, r, b);
|
||||
rectF.set(0f, 0f, getMeasuredWidth(), getMeasuredHeight());
|
||||
setRoundPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
if (roundLayoutRadius > 0f) {
|
||||
canvas.clipPath(roundPath);
|
||||
}
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user