[2.12.0] local code style change
This commit is contained in:
@@ -15,6 +15,8 @@ import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
@@ -42,7 +44,6 @@ import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager;
|
||||
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
@@ -245,10 +246,7 @@ public class BusPassengerModel {
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getIntentManagerApi()
|
||||
.registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
|
||||
@@ -4,7 +4,6 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS
|
||||
import static com.mogo.och.bus.constant.BusConst.TIMER_START_AUTOPILOT_INTERVAL;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -20,12 +19,9 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
@@ -34,27 +30,21 @@ 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.hmi.ui.widget.TrafficDataView;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
import com.mogo.och.bus.util.BDRouteDataTestUtils;
|
||||
import com.mogo.och.bus.view.SlidePanelView;
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
@@ -66,7 +56,7 @@ import record_cache.RecordPanelOuterClass;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
|
||||
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
|
||||
|
||||
private static final String TAG = "BaseOchFragment";
|
||||
|
||||
@@ -157,19 +147,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
});
|
||||
|
||||
if (DebugConfig.isDebug()) {
|
||||
mTrafficDataView.setLongClickable(true);
|
||||
mTrafficDataView.setOnLongClickListener(v -> {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "长按显示状态工具栏");
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("oper", 52);
|
||||
MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
initListener();
|
||||
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener(){
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
@@ -198,7 +178,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
);
|
||||
|
||||
findViewById(R.id.btnAutopilotRoute).setOnClickListener(view -> debugArrivedRoute());
|
||||
|
||||
|
||||
tvArrived.setOnClickListener(view -> {
|
||||
onArriveStation();
|
||||
});
|
||||
@@ -220,7 +200,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
|
||||
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
|
||||
if (mAICollectBtn != null){
|
||||
if (mAICollectBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
|
||||
}
|
||||
}
|
||||
@@ -235,7 +215,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
protected abstract void onArriveStation();
|
||||
|
||||
private void updateSwitchMapIcon(){
|
||||
private void updateSwitchMapIcon() {
|
||||
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
|
||||
@@ -295,14 +275,15 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
/**
|
||||
* 设置进站按钮状态
|
||||
*
|
||||
* @param isClickable
|
||||
*/
|
||||
public void setArrivedClikable(boolean isClickable){
|
||||
public void setArrivedClikable(boolean isClickable) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable){
|
||||
if (isClickable) {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
|
||||
}else {
|
||||
} else {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
|
||||
}
|
||||
});
|
||||
@@ -317,9 +298,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
});
|
||||
}
|
||||
|
||||
public void playDI(){
|
||||
public void playDI() {
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(getContext(), R.raw.bus_di);
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
@@ -347,13 +329,13 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatus.setClickable(true);
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
}else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus){
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
|
||||
ctvAutopilotStatus.setSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateAutopilotStatus(int autopilotStatus){
|
||||
public void updateAutopilotStatus(int autopilotStatus) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
== autopilotStatus) {//2 running
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
|
||||
@@ -361,7 +343,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
}else {
|
||||
} else {
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
|
||||
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
|
||||
@@ -373,7 +355,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
public void run() {
|
||||
setAutopilotBtnStatus(autopilotStatus);
|
||||
}
|
||||
},1000);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
|
||||
@@ -384,10 +366,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
// 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return;
|
||||
}
|
||||
if (isAnimateRunning){
|
||||
if (isAnimateRunning) {
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(autopilotStatus);
|
||||
}else {
|
||||
} else {
|
||||
setAutopilotBtnStatus(autopilotStatus);
|
||||
}
|
||||
|
||||
@@ -457,19 +439,20 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
}
|
||||
|
||||
private void startingAutoApilotCountDown(){
|
||||
private void startingAutoApilotCountDown() {
|
||||
//10s 若自动驾驶没有开启,则结束动画
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() { //未启动成功做处理
|
||||
if (isAnimateRunning){// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
|
||||
}
|
||||
}
|
||||
},TIMER_START_AUTOPILOT_INTERVAL);
|
||||
}, TIMER_START_AUTOPILOT_INTERVAL);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止自动驾驶中间动画
|
||||
*/
|
||||
@@ -489,7 +472,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
if (mTrafficDataView != null){
|
||||
if (mTrafficDataView != null) {
|
||||
mTrafficDataView.updateSpeedWithValue(speed);
|
||||
}
|
||||
}
|
||||
@@ -524,7 +507,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
/**
|
||||
* Bus调试信息:线路、轨迹等信息
|
||||
*
|
||||
* <p>
|
||||
* START
|
||||
*/
|
||||
private View busTestBar;
|
||||
|
||||
@@ -15,6 +15,8 @@ import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
@@ -57,7 +59,6 @@ import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum;
|
||||
import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager;
|
||||
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.och.taxi.passenger.utils.TaxiPassengerAnalyticsManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
@@ -228,10 +229,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getIntentManagerApi()
|
||||
.registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
@@ -69,7 +71,6 @@ import com.mogo.och.taxi.utils.TaxiAnalyticsManager;
|
||||
import com.mogo.och.taxi.utils.OrderUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.och.taxi.utils.TaxiTrajectoryManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
@@ -215,10 +216,7 @@ public class TaxiModel {
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getIntentManagerApi()
|
||||
.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/module_push_recycler_item_background">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/module_push_item_app_icon"
|
||||
android:layout_width="@dimen/module_push_message_app_icon_size"
|
||||
android:layout_height="@dimen/module_push_message_app_icon_size"
|
||||
@@ -59,7 +59,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_push_item_title"
|
||||
tools:text="发现系统新版本,共140.3M。部分功能优化,建议下载升级。" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/module_push_item_image"
|
||||
android:layout_width="@dimen/module_push_item_image_width"
|
||||
android:layout_height="@dimen/module_push_item_image_height"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.mogo.eagle.core.function.chat.facade.analytics
|
||||
|
||||
import com.mogo.commons.analytics.AnalyticsUtils
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoAnalyticsFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
|
||||
object ChatAnalyticsFacade: IMoGoAnalyticsFacade {
|
||||
|
||||
override fun track(eventType: String, data: Map<String, Any>?) {
|
||||
BridgeApi.analytics()?.track(eventType, data)
|
||||
AnalyticsUtils.track(eventType, data)
|
||||
}
|
||||
}
|
||||
@@ -21,13 +21,7 @@ internal object BridgeApi {
|
||||
|
||||
internal fun context(): Context = contextHolder?.get() ?: Utils.getApp()
|
||||
|
||||
internal fun intentManager() = apis?.intentManagerApi
|
||||
|
||||
internal fun statusManager() = apis?.statusManagerApi
|
||||
|
||||
internal fun analytics() = apis?.analyticsApi
|
||||
|
||||
internal fun topViewManager() = apis?.topViewManager
|
||||
|
||||
internal fun floatViewManager() = apis?.windowManagerApi
|
||||
}
|
||||
@@ -30,8 +30,8 @@ import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.function.chat.facade.utils.log
|
||||
import com.mogo.eagle.core.function.chat.facade.voice.VoiceControlFacade.REQUEST_CLOUD_VOICE_CALL
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform.CornerType.LEFT
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform.CornerType.LEFT
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.channels.Channel.Factory.RENDEZVOUS
|
||||
|
||||
@@ -3,13 +3,14 @@ package com.mogo.eagle.core.function.chat.facade.voice
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade.IMoGoVoiceCallback
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.function.chat.facade.utils.log
|
||||
import com.mogo.service.intent.IMogoIntentListener
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
@@ -48,10 +49,6 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
|
||||
private var onSpeechFinish: WeakReference<onSpeedFinish>? = null
|
||||
|
||||
private val intentManager by lazy {
|
||||
BridgeApi.intentManager()
|
||||
}
|
||||
|
||||
override fun speak(context: Context, content: String, listener: IMoGoVoiceCallback) {
|
||||
listeners += WeakReference(listener)
|
||||
AIAssist.getInstance(context).speakTTSVoiceWithLevel(content,AIAssist.LEVEL3 ,this)
|
||||
@@ -123,10 +120,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
}
|
||||
hasRegister.set(true)
|
||||
AIAssist.getInstance(BridgeApi.context()).registerUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, customCancelCallArray, this)
|
||||
intentManager?.also {
|
||||
it.registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
it.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun registerInviteJoinTeam(context: Context, listener: IMoGoVoiceCallback) {
|
||||
@@ -156,13 +151,13 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
|
||||
override fun registerIntentInComingCall(listener: IMoGoVoiceCallback) {
|
||||
listeners += WeakReference(listener)
|
||||
intentManager?.registerIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
intentManager?.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun unRegisterIntentInComingCall(context: Context) {
|
||||
intentManager?.unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
intentManager?.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun speakAndRegisterCall(onCmdAgree: (Boolean) -> Unit, onSpeakFinish: () -> Unit, listener: IMoGoVoiceCallback) {
|
||||
@@ -204,10 +199,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
|
||||
hasRegister.set(false)
|
||||
listeners.clear()
|
||||
AIAssist.getInstance(BridgeApi.context()).unregisterUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, this)
|
||||
intentManager?.also {
|
||||
it.unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
it.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
|
||||
}
|
||||
|
||||
override fun onIntentReceived(cmd: String?, intent: Intent?) {
|
||||
|
||||
@@ -20,10 +20,10 @@ import androidx.core.view.*
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.kwai.koom.base.postOnMainThread
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.commons.mvp.BaseFragment
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.*
|
||||
@@ -45,7 +45,6 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
|
||||
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
|
||||
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy.IViewNotificationProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
|
||||
@@ -56,7 +55,6 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager
|
||||
@@ -86,6 +84,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.MaskView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
|
||||
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
@@ -108,7 +107,6 @@ import kotlinx.android.synthetic.main.view_auto_pilot_check.view.*
|
||||
import kotlinx.android.synthetic.main.view_och_bus_operation.view.*
|
||||
import kotlinx.coroutines.*
|
||||
import mogo_msg.MogoReportMsg
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.util.*
|
||||
|
||||
@@ -592,6 +590,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
return HmiPresenter(this)
|
||||
}
|
||||
|
||||
override fun displayEffects() {
|
||||
DisplayEffectsHelper.getInstance().display()
|
||||
}
|
||||
|
||||
override fun setSpeedChartViewVisibility(visibility: Int) {
|
||||
viewSpeedChart?.visibility = visibility
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst;
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
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.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
@@ -125,7 +125,9 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
pushImageView?.let {
|
||||
GlideApp.with(context).load(noticeNormal.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f, GlideRoundedCornersTransform.CornerType.ALL)
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(it)
|
||||
}
|
||||
|
||||
@@ -191,8 +193,12 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||
thumbnailImageView!!.visibility = View.VISIBLE
|
||||
GlideApp.with(context).load(firstbitmap).optionalTransform(GlideRoundedCornersTransform(
|
||||
20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImageView!!)
|
||||
GlideApp.with(context).load(firstbitmap).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(thumbnailImageView!!)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst;
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,14 +26,14 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.call.notice.CallerNoticeManager;
|
||||
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.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager;
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.kwai.koom.base.MonitorManager;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.commons.context.ContextHolderUtil;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.BaseFragment;
|
||||
@@ -60,7 +61,6 @@ import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.rousetime.android_startup.StartupManager;
|
||||
import com.rousetime.android_startup.model.LoggerLevel;
|
||||
@@ -85,7 +85,6 @@ import system_master.SystemStatusInfo;
|
||||
*/
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
FragmentStackTransactionListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
protected static final String TAG = "MainActivity";
|
||||
@@ -218,7 +217,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
properties.put("app_launch_hotStartTime", hotStartTime);
|
||||
}
|
||||
}
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("app_launch_time", properties);
|
||||
AnalyticsUtils.track("app_launch_time", properties);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,15 +285,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
loadFunctionMapView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransaction(int size) {
|
||||
if (size == 0) {
|
||||
showLayout();
|
||||
} else if (size == 1) {
|
||||
hideLayout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载其它模块
|
||||
*/
|
||||
@@ -431,7 +421,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
mPresenter.handleSchemeIntent(intent, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -502,7 +491,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy.");
|
||||
ContextHolderUtil.releaseContext();
|
||||
MogoModulesManager.getInstance().onDestroy();
|
||||
SchemeIntent.getInstance().clear();
|
||||
FloatingViewHandler.clear();
|
||||
ProcessUtils.killAllBackgroundProcesses();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -22,12 +21,13 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
|
||||
@@ -36,8 +36,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.rousetime.android_startup.model.CostTimesModel;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
@@ -48,7 +46,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
@@ -71,7 +68,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
private BluetoothMonitorReceiver mBluetoothReceiver = null;
|
||||
private BluetoothAdapter mBluetoothAdapter;
|
||||
// private List<BluetoothDevice> mAreadlyConnectedList = new ArrayList<>();//已连接设备集合
|
||||
// private List<BluetoothDevice> mAreadlyConnectedList = new ArrayList<>();//已连接设备集合
|
||||
private int numberA = 0;
|
||||
private boolean isLongPressA = false;
|
||||
private int numberB = 0;
|
||||
@@ -121,7 +118,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
getApis().getIntentManagerApi().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
IntentManager.getInstance().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this);
|
||||
//ActivityLifecycleManager.getInstance().setAppActive(true);
|
||||
@@ -136,7 +133,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
getApis().getIntentManagerApi().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
IntentManager.getInstance().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
//ActivityLifecycleManager.getInstance().setAppActive(false);
|
||||
}
|
||||
|
||||
@@ -379,7 +376,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
/**
|
||||
* 查找蓝牙连接过的蓝牙设备
|
||||
*
|
||||
*/
|
||||
private void showBondedDevice(BluetoothAdapter bluetoothAdapter) {
|
||||
// mAreadlyConnectedList.clear();
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants;
|
||||
import com.mogo.eagle.core.function.overview.OverviewDb;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
@@ -136,7 +135,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
|
||||
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder"));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
|
||||
//todo emArrow 此处业务调用放置map module MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
|
||||
// MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
|
||||
|
||||
// OBU 模块
|
||||
@@ -153,8 +152,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_MODULE, "V2XProvider"));
|
||||
// 自动驾驶系统检测模块
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CHECK, "CheckProvider"));
|
||||
// 推送模块
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, "PUSH_UI"));
|
||||
// 绑定车辆
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_BINDING_CAR, "IMoGoBindingcarProvider"));
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.main;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@@ -43,7 +42,6 @@ public class MainPresenter extends Presenter<MainView> {
|
||||
|
||||
public MainPresenter(MainView view) {
|
||||
super(view);
|
||||
SchemeIntent.getInstance().init(getContext(), mView.getApis());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +107,4 @@ public class MainPresenter extends Presenter<MainView> {
|
||||
mMsgHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
public void handleSchemeIntent(Intent intent, boolean isOnNewIntent) {
|
||||
SchemeIntent.getInstance().handle(intent, isOnNewIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.CommonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-20
|
||||
* <p>
|
||||
* scheme 意图处理
|
||||
* <p>
|
||||
* 导航:adb shell am start -d "mogo://launcher/main/switch2?type=navi'&'lon=116.327007'&'lat=39.977639"
|
||||
*/
|
||||
public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "SchemeIntent";
|
||||
|
||||
public static final String TYPE_NAVI = "navi";
|
||||
|
||||
public static final String TYPE_SEARCH_ROAD_CONDITION = "search-road-condition";
|
||||
|
||||
public static final String TYPE_LAUNCH = "launch";
|
||||
|
||||
public static final String TYPE_SHOW_ONLINE_CAR_PANEL = "showOnlineCarPanel";
|
||||
|
||||
public static final String TYPE_SHOW_SHARE_PANEL = "showSharePanel";
|
||||
public static final String TYPE_SHOW_HISTORY_PANEL = "showHistoryPanel";
|
||||
public static final String TYPE_SHOW_SURROUNDING_PANEL = "showSurroundingPanel";
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
private Context mContext;
|
||||
|
||||
private IntentWrapper mNextIntent;
|
||||
|
||||
private static class IntentWrapper {
|
||||
public Intent mIntent;
|
||||
public long mDelay;
|
||||
|
||||
public IntentWrapper(Intent intent, long delay) {
|
||||
this.mIntent = intent;
|
||||
this.mDelay = delay;
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile SchemeIntent sInstance;
|
||||
|
||||
private SchemeIntent() {
|
||||
}
|
||||
|
||||
public static SchemeIntent getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (SchemeIntent.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new SchemeIntent();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
public void init(Context context, IMogoServiceApis apis) {
|
||||
mContext = context;
|
||||
mApis = apis;
|
||||
mApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
mApis.getStatusManagerApi().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this);
|
||||
mContext = null;
|
||||
mApis = null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理scheme
|
||||
*
|
||||
* @param intent 跳转的intent
|
||||
* @param isOnNewIntent 根据这个参数判断是从onCreate过来还是从onNewIntent过来,从而可以在{@link #isDelay(Intent, boolean)}里面确定延时逻辑,如果是从onNewIntent过来是不需要延时的
|
||||
*/
|
||||
public void handle(Intent intent, boolean isOnNewIntent) {
|
||||
if (intent == null || intent.getData() == null) {
|
||||
return;
|
||||
}
|
||||
Uri target = intent.getData();
|
||||
String path = target.getPath();
|
||||
if (path == null || path.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mApis.getStatusManagerApi().isMainPageOnResume()) {
|
||||
long delay = 0L;
|
||||
if (isDelay(intent, isOnNewIntent)) {
|
||||
delay = 5_000L;
|
||||
}
|
||||
mNextIntent = new IntentWrapper(intent, delay);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (path) {
|
||||
case "/main/switch2":
|
||||
handleSwitch2Action(target);
|
||||
break;
|
||||
case "/main/share":
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "收到打开分享框的scheme,准备打开分享框");
|
||||
// Map<String, Object> properties = new HashMap<>();
|
||||
// properties.put("from", "1");
|
||||
// mApis.getAnalyticsApi().track("v2x_share_click", properties);
|
||||
// mApis.getShareManager().showShareDialog();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
mNextIntent = null;
|
||||
}
|
||||
|
||||
private boolean isDelay(Intent intent, boolean isOnNewIntent) {
|
||||
if (isOnNewIntent || intent == null || intent.getData() == null) {
|
||||
return false;
|
||||
}
|
||||
Uri target = intent.getData();
|
||||
String type = target.getQueryParameter("type");
|
||||
return TextUtils.equals(TYPE_NAVI, type) || TextUtils.equals(TYPE_SHOW_SHARE_PANEL, type);
|
||||
}
|
||||
|
||||
private void handleSwitch2Action(Uri target) {
|
||||
String type = target.getQueryParameter("type");
|
||||
if (TextUtils.isEmpty(type)) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + type);
|
||||
switch (type) {
|
||||
case TYPE_LAUNCH:
|
||||
handleLaunchIntent(target);
|
||||
break;
|
||||
case TYPE_SHOW_HISTORY_PANEL:
|
||||
handleShowEventPanel(0);
|
||||
break;
|
||||
case TYPE_SHOW_SURROUNDING_PANEL:
|
||||
handleShowEventPanel(1);
|
||||
break;
|
||||
case TYPE_SHOW_SHARE_PANEL:
|
||||
handleShowEventPanel(2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void handleLaunchIntent(Uri uri) {
|
||||
String type = uri.getQueryParameter("channelType");
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("appname", CommonUtils.getAppName(mContext));
|
||||
properties.put("appversion", CommonUtils.getVersionName(mContext));
|
||||
properties.put("from", type);
|
||||
mApis.getAnalyticsApi().track("appenterfront", properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* 语音打开事件面板
|
||||
*/
|
||||
private void handleShowEventPanel(int item) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + item);
|
||||
//mApis.getEventPanelManager().showPanelWithSelectedItem(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_RESUME) {
|
||||
if (mNextIntent == null) {
|
||||
return;
|
||||
}
|
||||
if (isTrue) {
|
||||
// 保证回到桌面后在开始该规划路线。
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
if (mNextIntent == null) {
|
||||
return;
|
||||
}
|
||||
handle(mNextIntent.mIntent, false);
|
||||
}, mNextIntent.mDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.service.v2x.DisplayEffectsInterface;
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/3/30 15:45
|
||||
* describe:
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_MAIN_DISPLAY_EFFECTS_MANAGER)
|
||||
public class DisplayEffectsManager implements DisplayEffectsInterface {
|
||||
private Context context;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayEffects(String type) {
|
||||
DisplayEffectsHelper.getInstance().display();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,7 +79,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_push_dialog_acc_title" />
|
||||
|
||||
<!--缩略图-->
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="@dimen/module_push_dialog_check_acc_image_width"
|
||||
android:layout_height="@dimen/module_push_dialog_check_acc_image__height"
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/notice_traffic_dialog_title" />
|
||||
<!---->
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
||||
@@ -4,7 +4,9 @@ import android.content.Context;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapService;
|
||||
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
|
||||
import com.mogo.eagle.core.function.marker.MogoMarkerServiceImpl;
|
||||
import com.mogo.map.MogoGeoSearch;
|
||||
import com.mogo.map.MogoLocationClient;
|
||||
import com.mogo.map.MogoMap;
|
||||
@@ -53,6 +55,11 @@ public class MogoMapService implements IMogoMapService {
|
||||
return MogoMarkerManager.getInstance(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerService getMarkerService() {
|
||||
return MogoMarkerServiceImpl.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getMapUIController() {
|
||||
return MogoMapUIController.getInstance();
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.mogo.eagle.core.function.impl.marker;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.marker.MapMarkerManager;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-05-27
|
||||
* <p>
|
||||
* 调用 #mogo-module-service# 模块的样式打点
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_MARKER_SERVICE )
|
||||
public class MogoMarkerServiceImpl implements IMogoMarkerService {
|
||||
|
||||
private static final String TAG = "MogoMarkerServiceImpl";
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IMogoMarker drawMarker( Object object ) {
|
||||
if ( object instanceof MarkerShowEntity ) {
|
||||
return MapMarkerManager.getInstance().drawMapMarker( ( ( MarkerShowEntity ) object ), MarkerDrawer.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getMapUIController() {
|
||||
return MogoMapUIController.getInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mogo.eagle.core.function.marker;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.marker.MapMarkerManager;
|
||||
|
||||
|
||||
public class MogoMarkerServiceImpl implements IMogoMarkerService {
|
||||
|
||||
private static volatile MogoMarkerServiceImpl sInstance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
|
||||
private MogoMarkerServiceImpl() {
|
||||
|
||||
}
|
||||
|
||||
public static MogoMarkerServiceImpl getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (obj) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoMarkerServiceImpl();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IMogoMarker drawMarker(Object object) {
|
||||
if (object instanceof MarkerShowEntity) {
|
||||
return MapMarkerManager.getInstance().drawMapMarker(((MarkerShowEntity) object), MarkerDrawer.MARKER_Z_INDEX_HIGH);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,11 +12,11 @@ import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.live.impl.ICameraWindow;
|
||||
import com.mogo.eagle.core.function.monitoring.R;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView;
|
||||
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo
|
||||
if (!TextUtils.isEmpty(entity.getRtmpUrl())) {
|
||||
CallerLogger.INSTANCE.w(M_MONITOR + TAG, "entity.getRtmpUrl() = " + entity.getRtmpUrl());
|
||||
mIvReportHead.setVisibility(INVISIBLE);
|
||||
MogoApisHandler.getInstance().getApis().getImageLoaderApi().displayImage(entity.getRtmpUrl(),
|
||||
GlideImageLoader.getInstance().displayImage(entity.getRtmpUrl(),
|
||||
mIvReportHead);
|
||||
mLiveGSYVideoView.startLive(entity.getRtmpUrl());
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_30" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivReportHead"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.function.notice.fragment.MessageHistoryFragment;
|
||||
import com.mogo.service.fragmentmanager.IFragmentProvider;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = PushUIConstants.Push_MESSAGE_ACTIVITY_PATH )
|
||||
class PushHistoryUiProvider implements IFragmentProvider {
|
||||
|
||||
@Override
|
||||
public Fragment createFragment( FragmentActivity activity, int containerId, Bundle date ) {
|
||||
Fragment fragment = new MessageHistoryFragment();
|
||||
activity.getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace( containerId, fragment, PushUIConstants.Push_MESSAGE_ACTIVITY_PATH )
|
||||
.show( fragment )
|
||||
.commitNowAllowingStateLoss();
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.function.notice.repository.PushRepository;
|
||||
import com.mogo.eagle.core.function.notice.utils.HandlerUtils;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
|
||||
@Route(path = PushUIConstants.PATH)
|
||||
public class PushModuleProvider implements IMogoModuleProvider {
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return " ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return " ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final Context context) {
|
||||
HandlerUtils.INSTANCE.getMBgHandler().post(() -> PushRepository.Companion.init(context));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice;
|
||||
|
||||
public class PushUIConstants {
|
||||
public static final String NAME = "PUSH_UI";
|
||||
public static final String PATH = "/push/ui";
|
||||
public static final String Push_MESSAGE_ACTIVITY_PATH = "/push/ui/message"; //消息列表activity
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.function.notice.R
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean
|
||||
import com.mogo.eagle.core.function.notice.utils.dealSchema
|
||||
import com.mogo.eagle.core.function.notice.utils.stringConverterBitmap
|
||||
import com.mogo.eagle.core.function.notice.view.getApis
|
||||
import com.mogo.service.imageloader.MogoImageView
|
||||
import kotlin.math.abs
|
||||
|
||||
class PushMessageAdapter : RecyclerView.Adapter<PushMessageAdapter.MessageViewHolder>() {
|
||||
interface PushAdapterListener {
|
||||
fun deleteBean(bean: PushBean, action: Boolean)
|
||||
|
||||
fun lastItemShow(show: Boolean)
|
||||
}
|
||||
|
||||
var onAttachStateChangeListener = object : View.OnAttachStateChangeListener {
|
||||
override fun onViewDetachedFromWindow(p0: View?) {
|
||||
deletePushBean.lastItemShow(false)
|
||||
}
|
||||
|
||||
override fun onViewAttachedToWindow(p0: View?) {
|
||||
deletePushBean.lastItemShow(true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lateinit var deletePushBean: PushAdapterListener
|
||||
|
||||
var datas: MutableList<PushBean>? = null
|
||||
set(value) {
|
||||
field = value
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun removeItem(bean: PushBean) {
|
||||
datas?.let {
|
||||
val position = it.indexOf(bean)
|
||||
if (position >= 0) {
|
||||
it.removeAt(position)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
if (itemCount == 0) {
|
||||
deletePushBean.lastItemShow(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MessageViewHolder {
|
||||
return MessageViewHolder(
|
||||
LayoutInflater.from(parent.context).inflate(
|
||||
R.layout.module_push_message_item,
|
||||
null
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return datas?.size ?: 0
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: MessageViewHolder, position: Int) {
|
||||
holder.setPushBean(datas!![position], position)
|
||||
}
|
||||
|
||||
|
||||
inner class MessageViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
private val pushAppIcon: MogoImageView = view.findViewById(R.id.module_push_item_app_icon)
|
||||
private val pushTitle: TextView = view.findViewById(R.id.module_push_item_title)
|
||||
private val pushContent: TextView = view.findViewById(R.id.module_push_item_content)
|
||||
private val pushImage: MogoImageView = view.findViewById(R.id.module_push_item_image)
|
||||
private val pushTimer: TextView = view.findViewById(R.id.module_push_item_time)
|
||||
private val pushDelete: TextView = view.findViewById(R.id.module_push_item_delete)
|
||||
private val pushClick: View = view.findViewById(R.id.module_push_item_click)
|
||||
|
||||
fun setPushBean(bean: PushBean, position: Int) {
|
||||
if (position == (datas?.size ?: 0) - 1) {
|
||||
itemView.addOnAttachStateChangeListener(onAttachStateChangeListener)
|
||||
} else {
|
||||
itemView.removeOnAttachStateChangeListener(onAttachStateChangeListener)
|
||||
}
|
||||
pushDelete.setOnClickListener {
|
||||
deletePushBean.deleteBean(bean, false)
|
||||
}
|
||||
if (bean.mainSchema.isNotEmpty()) {
|
||||
pushClick.setOnClickListener {
|
||||
dealSchema(bean.mainSchema, itemView.context)
|
||||
deletePushBean.deleteBean(bean, true)
|
||||
}
|
||||
} else {
|
||||
pushClick.setOnClickListener(null)
|
||||
}
|
||||
// getApis(itemView.context).imageLoaderApi.displayImage(bean.appIcon, pushAppIcon)
|
||||
pushTitle.text = bean.title
|
||||
pushContent.text = bean.content
|
||||
pushContent.visibility = if (bean.content.isEmpty()) View.GONE else View.VISIBLE
|
||||
if (bean.QRCode.isEmpty() && bean.imageUrl.isNotEmpty()) {
|
||||
getApis(itemView.context).imageLoaderApi.displayImage(bean.imageUrl, pushImage)
|
||||
}
|
||||
if (bean.QRCode.isNotEmpty()) {
|
||||
pushImage.setImageBitmap(
|
||||
stringConverterBitmap(
|
||||
bean.QRCode,
|
||||
pushImage.context.resources.getDimensionPixelSize(R.dimen.module_push_message_item_image_size),
|
||||
pushImage.context.resources.getDimensionPixelSize(R.dimen.module_push_message_item_image_size)
|
||||
)
|
||||
)
|
||||
}
|
||||
val diff = abs((System.currentTimeMillis() - bean.timestamp) / 1000).toInt()
|
||||
pushTimer.text = when {
|
||||
diff == 0 -> "现在"
|
||||
diff < 60 -> "${diff}秒前"
|
||||
diff < 60 * 60 -> "${diff / 60}分钟前"
|
||||
diff < 60 * 60 * 24 -> "${diff / 60 / 60}小时前"
|
||||
else -> "${diff / 60 / 60 / 24}天前"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.fragment;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.function.notice.R;
|
||||
import com.mogo.eagle.core.function.notice.adapter.PushMessageAdapter;
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean;
|
||||
import com.mogo.eagle.core.function.notice.repository.PushRepository;
|
||||
import com.mogo.eagle.core.function.notice.utils.AnimatorUtilsKt;
|
||||
import com.mogo.eagle.core.function.notice.utils.HandlerUtils;
|
||||
import com.mogo.eagle.core.function.notice.view.PushItemAnimator;
|
||||
import com.mogo.eagle.core.function.notice.view.SwipeItemLayout;
|
||||
import com.mogo.eagle.core.function.notice.viewmodel.MessageViewModel;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
public class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHistoryPresenter > implements MessageHistoryView {
|
||||
|
||||
private static final String TAG = "MessageHistoryFragment";
|
||||
|
||||
private View mClear;
|
||||
private RecyclerView mHistoryList;
|
||||
private TextView mTitle;
|
||||
private View mEmptyPlaceHolder;
|
||||
private View mClose;
|
||||
|
||||
private boolean mClearing = false;
|
||||
private PushMessageAdapter mAdapter = new PushMessageAdapter();
|
||||
private MessageViewModel mViewModel;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_push_message_hisotry_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTagName() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mClear = findViewById( R.id.module_push_id_clear );
|
||||
mHistoryList = findViewById( R.id.module_push_id_recycler_view );
|
||||
mTitle = findViewById( R.id.module_push_id_title );
|
||||
mEmptyPlaceHolder = findViewById( R.id.module_push_id_not_data );
|
||||
mClose = findViewById( R.id.module_push_id_close );
|
||||
|
||||
mClose.setOnClickListener( new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl( View v ) {
|
||||
exitSelf();
|
||||
}
|
||||
} );
|
||||
mClear.setOnClickListener( new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl( View v ) {
|
||||
if ( !mClearing ) {
|
||||
mClearing = true;
|
||||
AnimatorUtilsKt.startClearAnimator(
|
||||
mHistoryList,
|
||||
() -> {
|
||||
mViewModel.deleteAll();
|
||||
mClearing = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
} );
|
||||
mAdapter.deletePushBean = new PushMessageAdapter.PushAdapterListener() {
|
||||
@Override
|
||||
public void deleteBean( @NotNull PushBean bean, boolean action ) {
|
||||
if ( mClearing ) {
|
||||
return;
|
||||
}
|
||||
mViewModel.delete( bean );
|
||||
if ( action ) {
|
||||
exitSelf();
|
||||
} else {
|
||||
mAdapter.removeItem( bean );
|
||||
if ( mAdapter.getItemCount() == 0 ) {
|
||||
mEmptyPlaceHolder.setVisibility( View.VISIBLE );
|
||||
}
|
||||
updateHistoryMessageCount();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lastItemShow( boolean show ) {
|
||||
if ( !show && !mClearing ) {
|
||||
if ( mViewModel.getList() != null ) {
|
||||
int size = mViewModel.getList().size();
|
||||
if ( size > 0 && size < mHistoryList.getChildCount() ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
mClear.setVisibility( show ? View.VISIBLE : View.GONE );
|
||||
}
|
||||
};
|
||||
mViewModel = new MessageViewModel( list -> {
|
||||
UiThreadHandler.post( () -> {
|
||||
int size = list == null ? 0 : list.size();
|
||||
mAdapter.setDatas( list );
|
||||
mEmptyPlaceHolder.setVisibility( size > 0 ? View.GONE : View.VISIBLE );
|
||||
updateHistoryMessageCount();
|
||||
} );
|
||||
} );
|
||||
|
||||
mHistoryList.setLayoutManager( new LinearLayoutManager( AbsMogoApplication.getApp() ) );
|
||||
mHistoryList.setAdapter( mAdapter );
|
||||
mHistoryList.setItemAnimator( new PushItemAnimator() );
|
||||
mHistoryList.addOnItemTouchListener( new SwipeItemLayout.OnSwipeItemTouchListener( getContext() ) );
|
||||
|
||||
mRootView.setOnClickListener( view -> {
|
||||
} );
|
||||
}
|
||||
|
||||
private void exitSelf() {
|
||||
try {
|
||||
getActivity().getSupportFragmentManager().beginTransaction()
|
||||
.remove( this )
|
||||
.commitNowAllowingStateLoss();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateHistoryMessageCount() {
|
||||
HandlerUtils.INSTANCE.getMBgHandler().post( () -> {
|
||||
int count = 0;
|
||||
try {
|
||||
count = PushRepository.Companion.getPushRepository().getPushBeanDao().getAllCount();
|
||||
} catch ( Exception e ) {
|
||||
count = 0;
|
||||
}
|
||||
renderHistoryMessageCount( count );
|
||||
} );
|
||||
}
|
||||
|
||||
private void renderHistoryMessageCount( int count ) {
|
||||
UiThreadHandler.post( () -> {
|
||||
try {
|
||||
mTitle.setText( count > 0 ? "历史消息(" + count + ")" : "历史消息" );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected MessageHistoryPresenter createPresenter() {
|
||||
return new MessageHistoryPresenter( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.fragment;
|
||||
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MessageHistoryPresenter extends Presenter< MessageHistoryView > {
|
||||
|
||||
public MessageHistoryPresenter( MessageHistoryView view ) {
|
||||
super( view );
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.fragment;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface MessageHistoryView extends IView {
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.repository
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import androidx.room.Room
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NOTICE
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants
|
||||
import com.mogo.eagle.core.function.notice.dao.PushBeanDatabase
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean
|
||||
import com.mogo.eagle.core.function.notice.utils.HandlerUtils
|
||||
import com.mogo.eagle.core.function.notice.view.getApis
|
||||
import com.mogo.eagle.core.function.notice.viewmodel.PushViewModel
|
||||
import com.mogo.map.MogoLocationClient
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import java.util.*
|
||||
import kotlin.collections.HashSet
|
||||
|
||||
class PushRepository(mContext: Context) {
|
||||
|
||||
companion object {
|
||||
private const val TAG: String = "PushRepository"
|
||||
private lateinit var appContext: Context
|
||||
|
||||
fun init(context: Context) {
|
||||
appContext = context.applicationContext
|
||||
pushRepository
|
||||
}
|
||||
|
||||
val globalContext: Context by lazy {
|
||||
appContext
|
||||
}
|
||||
|
||||
val pushRepository: PushRepository by lazy {
|
||||
PushRepository(appContext)
|
||||
}
|
||||
}
|
||||
|
||||
// 被中断的push消息仅再次展示一次
|
||||
private val singleRePushSet = HashSet<PushBean>()
|
||||
|
||||
private val pushViewModel: PushViewModel = PushViewModel(mContext, this)
|
||||
private val pushBeanQueue: Queue<PushBean> = LinkedList()
|
||||
private val statusManager = getApis(mContext).statusManagerApi
|
||||
val pushBeanDao by lazy {
|
||||
Room.databaseBuilder(appContext, PushBeanDatabase::class.java, "database_push").build()
|
||||
.pushBeanDao()
|
||||
}
|
||||
private val locationClient =
|
||||
MogoLocationClient.getInstance(appContext)
|
||||
|
||||
private val mHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
private val statusChangedListener: IMogoStatusChangedListener =
|
||||
IMogoStatusChangedListener { sd, open ->
|
||||
CallerLogger.d("$M_NOTICE$TAG", "sd = $sd , open = $open")
|
||||
}
|
||||
|
||||
init {
|
||||
HandlerUtils.mBgHandler.postDelayed({
|
||||
updateMsgNum()
|
||||
}, 5000)
|
||||
}
|
||||
|
||||
private fun updateMsgNum() {
|
||||
val num = pushBeanDao.getAllCount()
|
||||
if (num > 100) { //历史消息最多保留100条
|
||||
pushBeanDao.deleteMin()
|
||||
updateMsgNum()
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun startIterate() {
|
||||
CallerLogger.d("$M_NOTICE$TAG", "startIterate : ${pushViewModel.pushBean}")
|
||||
if (!pushViewModel.isAddWindow()) {
|
||||
val bean = pushBeanQueue.peek()
|
||||
if (bean != null) {
|
||||
if (needDelay(bean)) {
|
||||
mHandler.removeCallbacks(delayRunnable)
|
||||
mHandler.postDelayed(delayRunnable, 15000)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
mHandler.post {
|
||||
iterateNext()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存被中断的push消息
|
||||
*/
|
||||
fun push(pushBean: PushBean) {
|
||||
if (singleRePushSet.contains(pushBean)) {
|
||||
return
|
||||
}
|
||||
CallerLogger.d("$M_NOTICE$TAG", "保存待下一次开启")
|
||||
singleRePushSet.add(pushBean)
|
||||
pushBeanQueue.offer(pushBean)
|
||||
}
|
||||
|
||||
private var delayRunnable = {
|
||||
startIterate()
|
||||
}
|
||||
|
||||
private fun needDelay(bean: PushBean): Boolean {
|
||||
if (locationClient.lastKnowLocation != null) {
|
||||
if (bean.speedLimit > 0 && bean.speedLimit <= locationClient.lastKnowLocation.speed * 18 / 5) {
|
||||
CallerLogger.d(
|
||||
"$M_NOTICE$TAG",
|
||||
"speedLimit : " + locationClient.lastKnowLocation.speed
|
||||
)
|
||||
return true
|
||||
}
|
||||
}
|
||||
if (statusManager.isV2XShow) {
|
||||
return true
|
||||
}
|
||||
if (statusManager.isVoiceShow) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun iterateNext(needSave: Boolean = false) {
|
||||
try {
|
||||
val nextBean = pushBeanQueue.peek()
|
||||
if (nextBean == null) {
|
||||
pushViewModel.pushBean = nextBean
|
||||
return
|
||||
}
|
||||
if (needDelay(nextBean)) {
|
||||
mHandler.removeCallbacksAndMessages(null)
|
||||
mHandler.postDelayed({
|
||||
iterateNext(needSave)
|
||||
}, 15000)
|
||||
return
|
||||
}
|
||||
pushViewModel.pushBean = pushBeanQueue.poll()
|
||||
} catch (e: Exception) {
|
||||
CallerLogger.e("$M_NOTICE$TAG", "$e")
|
||||
}
|
||||
if (pushViewModel.pushBean != null) {
|
||||
statusManager.registerStatusChangedListener(
|
||||
PushUIConstants.PATH,
|
||||
StatusDescriptor.V2X_UI,
|
||||
statusChangedListener
|
||||
)
|
||||
statusManager.registerStatusChangedListener(
|
||||
PushUIConstants.PATH,
|
||||
StatusDescriptor.VOICE_UI,
|
||||
statusChangedListener
|
||||
)
|
||||
} else {
|
||||
statusManager.unregisterStatusChangedListener(
|
||||
PushUIConstants.PATH,
|
||||
StatusDescriptor.VOICE_UI,
|
||||
statusChangedListener
|
||||
)
|
||||
statusManager.unregisterStatusChangedListener(
|
||||
PushUIConstants.PATH,
|
||||
StatusDescriptor.V2X_UI,
|
||||
statusChangedListener
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun delete(bean: PushBean) {
|
||||
HandlerUtils.mBgHandler.post {
|
||||
pushBeanDao.delete(bean)
|
||||
updateMsgNum()
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteAll() {
|
||||
HandlerUtils.mBgHandler.post {
|
||||
pushBeanDao.deleteAll()
|
||||
}
|
||||
}
|
||||
|
||||
fun getAll(): MutableList<PushBean> {
|
||||
return pushBeanDao.getAll()
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.mogo.eagle.core.function.notice.utils
|
||||
|
||||
import android.util.ArrayMap
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.function.notice.repository.PushRepository
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.service.analytics.IMogoAnalytics
|
||||
|
||||
object AnalyticsUtils {
|
||||
private val Analytics =
|
||||
ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation(PushRepository.globalContext) as IMogoAnalytics
|
||||
|
||||
fun track(event: String, vararg keyValue: String) {
|
||||
val map = ArrayMap<String, Any>()
|
||||
if (keyValue.isNotEmpty()) {
|
||||
for (i in 0..keyValue.size - 2 step 2) {
|
||||
map[keyValue[i]] = keyValue[i + 1]
|
||||
}
|
||||
}
|
||||
Analytics.track(event, map)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.utils
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
|
||||
object HandlerUtils {
|
||||
private val handlerThread = HandlerThread("push_ui_thread")
|
||||
val mBgHandler: Handler
|
||||
|
||||
init {
|
||||
handlerThread.start()
|
||||
mBgHandler = Handler(handlerThread.looper)
|
||||
}
|
||||
}
|
||||
@@ -1,494 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.view
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.Scroller
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.LayoutRes
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.eagle.core.function.notice.Config
|
||||
import com.mogo.eagle.core.function.notice.R
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean
|
||||
import com.mogo.eagle.core.function.notice.utils.AnalyticsUtils
|
||||
import com.mogo.eagle.core.function.notice.utils.stringConverterBitmap
|
||||
import com.mogo.eagle.core.function.notice.view.roundimage.RoundedImageView
|
||||
import com.mogo.eagle.core.function.notice.viewmodel.PushViewModel
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.service.windowview.IMogoTopViewManager
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener
|
||||
|
||||
class FloatView constructor(
|
||||
private val pushViewModel: PushViewModel,
|
||||
private val context: Context
|
||||
) {
|
||||
|
||||
companion object {
|
||||
const val TYPE_TOP_VIEW = 1
|
||||
const val TYPE_WINDOW_MANAGER = 2
|
||||
const val TAG: String = "FloatView.kt"
|
||||
}
|
||||
|
||||
interface PushViewController {
|
||||
fun show(bean: PushBean?)
|
||||
fun hide()
|
||||
fun inflateView(@LayoutRes layoutId: Int)
|
||||
}
|
||||
|
||||
abstract inner class PushView(context: Context) : FrameLayout(context),
|
||||
PushViewController {
|
||||
private lateinit var titleIconContainer: View
|
||||
private lateinit var pushTitle: TextView
|
||||
private lateinit var pushImage: RoundedImageView
|
||||
private lateinit var pushContent: TextView
|
||||
private lateinit var pushCheck: TextView
|
||||
|
||||
private var pushData: PushBean? = null
|
||||
|
||||
override fun inflateView(layoutId: Int) {
|
||||
LayoutInflater.from(context).inflate(layoutId, this, true)
|
||||
pushTitle = findViewById(R.id.module_push_title)
|
||||
pushCheck = findViewById(R.id.module_push_check)
|
||||
pushImage = findViewById(R.id.module_push_image)
|
||||
pushContent = findViewById(R.id.module_push_content)
|
||||
titleIconContainer = findViewById(R.id.module_push_app_icon_title)
|
||||
setOnClickListener {
|
||||
pushViewModel.dealCmd(PushViewModel.VOICE_ACTION_PUSH_MAIN, "1")
|
||||
turnNextMessage()
|
||||
}
|
||||
pushCheck.setOnClickListener {
|
||||
pushData?.let {
|
||||
if (pushCheckDialog == null) {
|
||||
pushCheckDialog = PushCheckDialog(ContextHolderUtil.getContext())
|
||||
}
|
||||
pushCheckDialog!!.showCheckDialog(it.title, it.content)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun turnNextMessage() {
|
||||
pushViewModel.pushBean?.apply {
|
||||
showTimeout = 0
|
||||
updateTimer()
|
||||
}
|
||||
}
|
||||
|
||||
open fun setBean(bean: PushBean) {
|
||||
pushData = bean
|
||||
// title
|
||||
pushTitle.text = bean.title
|
||||
|
||||
// image
|
||||
if (bean.imageUrl.isEmpty() && bean.QRCode.isEmpty()) {
|
||||
pushImage.gone()
|
||||
} else if (bean.imageUrl.isNotEmpty()) {
|
||||
val params = pushImage.layoutParams
|
||||
params.width = getImgWidth()
|
||||
params.height = getImgHeight()
|
||||
pushImage.layoutParams = params
|
||||
pushImage.visible()
|
||||
GlideApp.with(this).load(bean.imageUrl).into(pushImage)
|
||||
} else if (bean.QRCode.isNotEmpty()) {
|
||||
val params = pushImage.layoutParams
|
||||
params.width = getQrImgWidth()
|
||||
params.height = getQrImgHeight()
|
||||
pushImage.layoutParams = params
|
||||
ThreadPoolService.execute {
|
||||
val bmp = stringConverterBitmap(
|
||||
bean.QRCode,
|
||||
getQrImgWidth(),
|
||||
getQrImgHeight()
|
||||
)
|
||||
UiThreadHandler.post {
|
||||
pushImage.setImageBitmap(bmp)
|
||||
pushImage.visible()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// content
|
||||
if (bean.content.isEmpty()) {
|
||||
pushContent.gone()
|
||||
} else {
|
||||
pushContent.text = bean.content
|
||||
pushContent.visible()
|
||||
}
|
||||
|
||||
// 产品侧需要重新梳理,tts暂时不播报
|
||||
// if (bean.tts.isNotEmpty()) {
|
||||
// AIAssist.getInstance(context).speakTTSVoice(bean.tts)
|
||||
// }
|
||||
}
|
||||
|
||||
abstract fun getImgWidth(): Int
|
||||
abstract fun getImgHeight(): Int
|
||||
abstract fun getQrImgWidth(): Int
|
||||
abstract fun getQrImgHeight(): Int
|
||||
|
||||
override fun show(bean: PushBean?) {
|
||||
isAddWindow = true
|
||||
uiHandler.removeCallbacks(delayClosePush)
|
||||
}
|
||||
|
||||
override fun hide() {
|
||||
isAddWindow = false
|
||||
}
|
||||
}
|
||||
|
||||
open inner class PushViewInTopView(context: Context) : PushView(context) {
|
||||
|
||||
private val mTopViewManager: IMogoTopViewManager = getApis(context).topViewManager
|
||||
|
||||
init {
|
||||
inflateView(R.layout.module_push_item)
|
||||
}
|
||||
|
||||
private var topViewStatusListener = object : IMogoTopViewStatusListener {
|
||||
override fun onViewRemoved(view: View?) {
|
||||
isAddWindow = false
|
||||
if (pushViewModel.pushBean?.showTimeout ?: 0 > 0) {
|
||||
if (getApis(context).statusManagerApi.isV2XShow) {
|
||||
// 被中断的消息,需要再次被显示一次
|
||||
uiHandler.removeCallbacks(delayClosePush)
|
||||
pushViewModel.push()
|
||||
pushViewModel.pushMessageFinish()
|
||||
return
|
||||
}
|
||||
}
|
||||
pushViewModel.pushBean?.showTimeout = 0
|
||||
updateTimer()
|
||||
}
|
||||
|
||||
override fun onViewAdded(view: View?) {
|
||||
if (pushViewModel.pushBean != null) {
|
||||
startClosePush()
|
||||
}
|
||||
}
|
||||
|
||||
override fun beforeViewRemoveAnim(view: View?) {
|
||||
}
|
||||
|
||||
override fun beforeViewAddAnim(view: View?) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun show(bean: PushBean?) {
|
||||
super.show(bean)
|
||||
mLastVisibleType = TYPE_TOP_VIEW
|
||||
mTopViewManager.addView(this, topViewStatusListener)
|
||||
setBean(bean!!)
|
||||
}
|
||||
|
||||
override fun hide() {
|
||||
super.hide()
|
||||
mTopViewManager.removeView(this)
|
||||
}
|
||||
|
||||
override fun getImgWidth(): Int =
|
||||
context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_width)
|
||||
|
||||
override fun getImgHeight(): Int =
|
||||
context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height)
|
||||
|
||||
override fun getQrImgWidth(): Int =
|
||||
context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height)
|
||||
|
||||
override fun getQrImgHeight(): Int =
|
||||
context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height)
|
||||
}
|
||||
|
||||
// inner class PushViewInWindowView(context: Context) : PushView(context), View.OnTouchListener {
|
||||
//
|
||||
// private val mContentContainer: View
|
||||
// private val mWindowManager =
|
||||
// context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||
//
|
||||
// private val params = WindowManager.LayoutParams()
|
||||
//
|
||||
// init {
|
||||
//
|
||||
// @Suppress("DEPRECATION")
|
||||
// params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
|
||||
// params.flags = (WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||
// or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
|
||||
// or WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE
|
||||
// or WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
|
||||
// or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
|
||||
// params.width = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
// params.height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
// params.gravity = Gravity.START or Gravity.BOTTOM
|
||||
// params.format = PixelFormat.TRANSLUCENT
|
||||
// params.x = context.resources.getDimensionPixelSize(R.dimen.module_push_window_x)
|
||||
// params.y = context.resources.getDimensionPixelSize(R.dimen.module_push_window_x)
|
||||
// if (Build.VERSION.SDK_INT > 25) {
|
||||
// params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
|
||||
// }
|
||||
//
|
||||
// inflateView(R.layout.module_push_item_vertical)
|
||||
// mContentContainer = findViewById(R.id.module_push_content_container)
|
||||
// setOnTouchListener(this)
|
||||
// }
|
||||
//
|
||||
// override fun show(bean: PushBean?) {
|
||||
// super.show(bean)
|
||||
// mLastVisibleType = TYPE_WINDOW_MANAGER
|
||||
// setBean(bean!!)
|
||||
//
|
||||
// try {
|
||||
// mWindowManager.addView(this, params)
|
||||
// } catch (e: Exception) {
|
||||
// mWindowManager.updateViewLayout(this, params)
|
||||
// }
|
||||
// translationXAnimation(
|
||||
// -ResourcesHelper.getDimension(context, R.dimen.module_push_ui_width_vertical),
|
||||
// 0f
|
||||
// ) {
|
||||
// if (pushViewModel.pushBean != null) {
|
||||
// startClosePush()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private fun translationXAnimation(
|
||||
// from: Float,
|
||||
// to: Float,
|
||||
// doOnEnd: (animator: Animator) -> Unit
|
||||
// ) {
|
||||
// val transitionXAnimator: ObjectAnimator =
|
||||
// ObjectAnimator.ofFloat(
|
||||
// this,
|
||||
// View.TRANSLATION_X,
|
||||
// from,
|
||||
// to
|
||||
// )
|
||||
// transitionXAnimator.duration = 200
|
||||
// transitionXAnimator.doOnEnd(doOnEnd)
|
||||
// transitionXAnimator.start()
|
||||
// }
|
||||
//
|
||||
// override fun hide() {
|
||||
// super.hide()
|
||||
// translationXAnimation(
|
||||
// this.x,
|
||||
// -ResourcesHelper.getDimension(context, R.dimen.module_push_ui_width_vertical)
|
||||
// ) {
|
||||
// this.x = 0f
|
||||
// mWindowManager.removeViewImmediate(this)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// override fun onTouch(v: View?, ev: MotionEvent?): Boolean {
|
||||
//
|
||||
// if (mLastVisibleType != TYPE_WINDOW_MANAGER) {
|
||||
// return false
|
||||
// }
|
||||
// when (ev?.action) {
|
||||
// MotionEvent.ACTION_DOWN -> {
|
||||
// needInterceptClick = false
|
||||
// startX = ev.x
|
||||
// }
|
||||
// MotionEvent.ACTION_MOVE -> {
|
||||
// moveX = startX - ev.x
|
||||
// scrollBy(moveX.toInt(), 0)
|
||||
// startX = ev.x
|
||||
// if (scrollX < 0) {
|
||||
// scrollTo(0, 0)
|
||||
// }
|
||||
// if (!needInterceptClick && scrollX > 20) {
|
||||
// needInterceptClick = true
|
||||
// }
|
||||
// invalidate()
|
||||
// }
|
||||
// MotionEvent.ACTION_UP -> {
|
||||
// if (scrollX > 0) {
|
||||
// mScroller.startScroll(scrollX, 0, width - scrollX, 0)
|
||||
// invalidate()
|
||||
// return true
|
||||
// }
|
||||
// if (needInterceptClick) {
|
||||
// return true
|
||||
// }
|
||||
// }
|
||||
// else -> {
|
||||
// startX = 0f
|
||||
// moveX = 0f
|
||||
// }
|
||||
// }
|
||||
// return false
|
||||
// }
|
||||
//
|
||||
// override fun computeScroll() {
|
||||
// if (mScroller.computeScrollOffset()) {
|
||||
// scrollTo(mScroller.currX, mScroller.currY)
|
||||
// invalidate()
|
||||
// } else {
|
||||
// if (mScroller.currX == 0) {
|
||||
// return
|
||||
// }
|
||||
// mScroller.finalX = 0
|
||||
// removeCallbacks(delayClosePush)
|
||||
// if (isAddWindow) {
|
||||
// if (currentBean != null) {
|
||||
// AnalyticsUtils.track(Config.NEWS_CARD_SWIPE, "trigger_type", "1")
|
||||
// }
|
||||
// mWindowManager.removeView(this)
|
||||
// isAddWindow = false
|
||||
// }
|
||||
// pushViewModel.pushBean?.showTimeout = 0
|
||||
// updateTimer()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// override fun getImgWidth(): Int =
|
||||
// context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_width_vertical)
|
||||
//
|
||||
// override fun getImgHeight(): Int =
|
||||
// context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height_vertical)
|
||||
//
|
||||
// override fun getQrImgWidth(): Int =
|
||||
// context.resources.getDimensionPixelSize(R.dimen.module_push_image_qr_size_vertical)
|
||||
//
|
||||
// override fun getQrImgHeight(): Int =
|
||||
// context.resources.getDimensionPixelSize(R.dimen.module_push_image_qr_size_vertical)
|
||||
// }
|
||||
|
||||
private var pushCheckDialog: PushCheckDialog? = null
|
||||
private val delayClosePush: Runnable
|
||||
private var isAddWindow = false
|
||||
private val uiHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
private var startX = 0f
|
||||
private var moveX = 0f
|
||||
private val mScroller: Scroller = Scroller(context)
|
||||
private var needInterceptClick = false
|
||||
private var pause = false
|
||||
|
||||
private var currentBean: PushBean? = null
|
||||
|
||||
|
||||
private var mLastVisibleType = -1
|
||||
private var pushViewController: PushViewController? = null
|
||||
|
||||
init {
|
||||
delayClosePush = Runnable {
|
||||
updateTimer()
|
||||
}
|
||||
}
|
||||
|
||||
fun pushBeanChanged(bean: PushBean?) {
|
||||
uiHandler.post {
|
||||
uiHandler.removeCallbacks(delayClosePush)
|
||||
if (bean == null) {
|
||||
if (currentBean != null) {
|
||||
AnalyticsUtils.track(Config.NEWS_CARD_DISAPPEAR, "title", currentBean!!.title)
|
||||
}
|
||||
hide()
|
||||
} else {
|
||||
show(bean)
|
||||
AnalyticsUtils.track(Config.NEWS_CARD_SHOW, "title", bean.title)
|
||||
}
|
||||
currentBean = bean
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateTimer() {
|
||||
uiHandler.removeCallbacks(delayClosePush)
|
||||
val time = pushViewModel.pushBean?.showTimeout ?: 0
|
||||
if (time > 0) {
|
||||
pushViewModel.pushBean!!.showTimeout--
|
||||
uiHandler.postDelayed(delayClosePush, 1000)
|
||||
} else {
|
||||
pushViewModel.pushMessageFinish(true)
|
||||
}
|
||||
}
|
||||
|
||||
private fun show(bean: PushBean) {
|
||||
if (isAddWindow) {
|
||||
if (getApis(context).statusManagerApi.isMainPageOnResume) {
|
||||
if (mLastVisibleType != TYPE_TOP_VIEW) {
|
||||
hide()
|
||||
(pushViewController as View).postDelayed({
|
||||
show(bean)
|
||||
}, 750L)
|
||||
} else {
|
||||
showByTopView(bean)
|
||||
}
|
||||
} else {
|
||||
if (mLastVisibleType != TYPE_WINDOW_MANAGER) {
|
||||
hide()
|
||||
(pushViewController as View).postDelayed({
|
||||
show(bean)
|
||||
}, 750L)
|
||||
} else {
|
||||
showByWindowManager(bean)
|
||||
}
|
||||
}
|
||||
startClosePush()
|
||||
} else {
|
||||
if (getApis(context).statusManagerApi.isMainPageOnResume) {
|
||||
showByTopView(bean)
|
||||
} else {
|
||||
showByWindowManager(bean)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showByTopView(bean: PushBean) {
|
||||
if (pushViewController !is PushViewInTopView) {
|
||||
pushViewController = PushViewInTopView(context)
|
||||
}
|
||||
pushViewController?.show(bean)
|
||||
}
|
||||
|
||||
private fun showByWindowManager(bean: PushBean?) {
|
||||
// if (pushViewController !is PushViewInWindowView) {
|
||||
// pushViewController = PushViewInWindowView(context)
|
||||
// }
|
||||
// pushViewController?.show(bean)
|
||||
}
|
||||
|
||||
private fun startClosePush() {
|
||||
uiHandler.removeCallbacks(delayClosePush)
|
||||
uiHandler.postDelayed(
|
||||
delayClosePush,
|
||||
1000L
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun hide() {
|
||||
if (!isAddWindow) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
pushViewController?.hide()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun pauseTimer(on: Boolean) {
|
||||
if (on) {
|
||||
uiHandler.removeCallbacks(delayClosePush)
|
||||
} else {
|
||||
updateTimer()
|
||||
uiHandler.post {
|
||||
if (on) {
|
||||
pause = true
|
||||
uiHandler.removeCallbacks(delayClosePush)
|
||||
} else if (pause) {
|
||||
pause = false
|
||||
updateTimer()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun isAddWindow(): Boolean = isAddWindow
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.view
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.function.notice.R
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
|
||||
class PushCheckDialog(context: Context) : BaseFloatDialog(context) {
|
||||
|
||||
private var pushCheckClose: ImageView? = null
|
||||
private var pushCheckTitle: TextView? = null
|
||||
private var pushCheckContent: TextView? = null
|
||||
|
||||
init {
|
||||
setContentView(R.layout.module_push_dialog_check)
|
||||
setCanceledOnTouchOutside(true)
|
||||
pushCheckClose = findViewById(R.id.module_push_dialog_close)
|
||||
pushCheckTitle = findViewById(R.id.module_push_dialog_title)
|
||||
pushCheckContent = findViewById(R.id.module_push_dialog_content)
|
||||
pushCheckClose?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
fun showCheckDialog(title: String, content: String) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
if (title.isBlank() || content.isBlank()) {
|
||||
return
|
||||
}
|
||||
pushCheckTitle?.text = title
|
||||
pushCheckContent?.text = content
|
||||
show()
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.viewmodel
|
||||
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean
|
||||
import com.mogo.eagle.core.function.notice.repository.PushRepository
|
||||
import com.mogo.eagle.core.function.notice.utils.HandlerUtils
|
||||
|
||||
class MessageViewModel(private val messageViewModel: MessageListChange) {
|
||||
|
||||
var list: MutableList<PushBean>? = null
|
||||
set(value) {
|
||||
field = value
|
||||
messageViewModel.messageListChange(value)
|
||||
}
|
||||
|
||||
init {
|
||||
HandlerUtils.mBgHandler.post {
|
||||
list = PushRepository.pushRepository.getAll()
|
||||
}
|
||||
}
|
||||
|
||||
interface MessageListChange {
|
||||
fun messageListChange(list: MutableList<PushBean>?)
|
||||
}
|
||||
|
||||
fun delete(bean: PushBean) {
|
||||
PushRepository.pushRepository.delete(bean)
|
||||
}
|
||||
|
||||
fun deleteAll() {
|
||||
list = null
|
||||
PushRepository.pushRepository.deleteAll()
|
||||
}
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.viewmodel
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.eagle.core.function.notice.Config
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean
|
||||
import com.mogo.eagle.core.function.notice.repository.PushRepository
|
||||
import com.mogo.eagle.core.function.notice.utils.AnalyticsUtils
|
||||
import com.mogo.eagle.core.function.notice.utils.dealSchema
|
||||
import com.mogo.eagle.core.function.notice.view.FloatView
|
||||
|
||||
class PushViewModel(
|
||||
private val mContext: Context,
|
||||
private val pushRepository: PushRepository
|
||||
) {
|
||||
companion object {
|
||||
const val VOICE_ACTION_PUSH_MAIN = "VOICE_ACTION_PUSH_MAIN"
|
||||
const val VOICE_ACTION_PUSH_LEFT = "VOICE_ACTION_PUSH_LEFT"
|
||||
const val VOICE_ACTION_PUSH_RIGHT = "VOICE_ACTION_PUSH_RIGHT"
|
||||
const val VOICE_ACTION_PUSH_CANCEL = "VOICE_ACTION_PUSH_CANCEL"
|
||||
}
|
||||
|
||||
var floatView: FloatView? = null
|
||||
|
||||
private var mVoiceClient: AIAssist = AIAssist.getInstance(mContext)
|
||||
|
||||
private val voiceCmdCallback = object : IMogoVoiceCmdCallBack {
|
||||
override fun onSpeakEnd(speakText: String?) {
|
||||
}
|
||||
|
||||
override fun onCmdSelected(cmd: String?) {
|
||||
if (!cmd.isNullOrEmpty()) {
|
||||
dealCmd(cmd)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCmdAction(speakText: String?) {
|
||||
}
|
||||
|
||||
override fun onCmdCancel(speakText: String?) {
|
||||
}
|
||||
|
||||
override fun onSpeakSelectTimeOut(speakText: String?) {
|
||||
}
|
||||
}
|
||||
|
||||
fun dealCmd(cmd: String, isClick: String = "2") {
|
||||
if (TextUtils.isEmpty(cmd)) {
|
||||
return
|
||||
}
|
||||
pushBean?.let {
|
||||
when (cmd) {
|
||||
VOICE_ACTION_PUSH_MAIN -> {
|
||||
AnalyticsUtils.track(Config.NEWS_CARD_CLICK, "trigger_type", isClick)
|
||||
if (isClick == "2") {
|
||||
mVoiceClient.speakTTSVoiceWithLevel("好的",AIAssist.LEVEL1, voiceCmdCallback)
|
||||
}
|
||||
if (it.mainSchema.isNotEmpty()) {
|
||||
dealSchema(it.mainSchema, mContext)
|
||||
}
|
||||
}
|
||||
VOICE_ACTION_PUSH_LEFT -> {
|
||||
if (it.buttons.isNullOrEmpty()) {
|
||||
return
|
||||
}
|
||||
AnalyticsUtils.track(
|
||||
Config.NEWS_CARD_CLICK_BTN,
|
||||
"trigger_type",
|
||||
isClick, "btn_text", it.buttons[0].text
|
||||
)
|
||||
if (isClick == "2") {
|
||||
mVoiceClient.speakTTSVoiceWithLevel("好的", AIAssist.LEVEL1,voiceCmdCallback)
|
||||
}
|
||||
if (it.buttons[0].action.isNotEmpty()) {
|
||||
dealSchema(it.buttons[0].action, mContext)
|
||||
}
|
||||
}
|
||||
VOICE_ACTION_PUSH_RIGHT -> {
|
||||
if (it.buttons.isNullOrEmpty()) {
|
||||
return
|
||||
}
|
||||
AnalyticsUtils.track(
|
||||
Config.NEWS_CARD_CLICK_BTN,
|
||||
"trigger_type",
|
||||
isClick, "btn_text", it.buttons[1].text
|
||||
)
|
||||
if (isClick == "2") {
|
||||
mVoiceClient.speakTTSVoiceWithLevel("好的",AIAssist.LEVEL1 ,voiceCmdCallback)
|
||||
}
|
||||
if (it.buttons[1].action.isNotEmpty()) {
|
||||
dealSchema(it.buttons[1].action, mContext)
|
||||
}
|
||||
}
|
||||
VOICE_ACTION_PUSH_CANCEL -> {
|
||||
AnalyticsUtils.track(
|
||||
Config.NEWS_CARD_SWIPE,
|
||||
"trigger_type",
|
||||
isClick
|
||||
)
|
||||
if (isClick == "2") {
|
||||
mVoiceClient.speakTTSVoiceWithLevel("好的",AIAssist.LEVEL1, voiceCmdCallback)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var pushBean: PushBean? = null
|
||||
set(value) {
|
||||
field = value
|
||||
if (value == null) {
|
||||
floatView?.hide()
|
||||
floatView = null
|
||||
return
|
||||
}
|
||||
field?.showTimeoutShadow = field?.showTimeout?:0
|
||||
if (value.imageUrl.isBlank()) {
|
||||
value.imageUrl = ""
|
||||
}
|
||||
if (floatView == null) {
|
||||
floatView = FloatView(this, mContext)
|
||||
}
|
||||
floatView?.pushBeanChanged(field)
|
||||
registerVoiceCMD()
|
||||
}
|
||||
|
||||
fun pushMessageFinish(needSave: Boolean = false) {
|
||||
pushRepository.iterateNext(needSave)
|
||||
}
|
||||
|
||||
private fun registerVoiceCMD() {
|
||||
mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_CANCEL)
|
||||
mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_MAIN)
|
||||
mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_LEFT)
|
||||
mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_RIGHT)
|
||||
|
||||
if (pushBean != null && !pushBean!!.cancelVoiceCmd.isNullOrEmpty()) {
|
||||
mVoiceClient.registerUnWakeupCommand(
|
||||
VOICE_ACTION_PUSH_CANCEL,
|
||||
pushBean!!.cancelVoiceCmd!!.toTypedArray(),
|
||||
voiceCmdCallback
|
||||
)
|
||||
} else {
|
||||
mVoiceClient.registerUnWakeupCommand(
|
||||
VOICE_ACTION_PUSH_CANCEL,
|
||||
arrayOf("忽略", "取消", "算了", "不要", "不要了", "不看了", "关闭"),
|
||||
voiceCmdCallback
|
||||
)
|
||||
}
|
||||
|
||||
if (pushBean != null && !pushBean!!.mainVoiceCmd.isNullOrEmpty()) {
|
||||
mVoiceClient.registerUnWakeupCommand(
|
||||
VOICE_ACTION_PUSH_MAIN,
|
||||
pushBean!!.mainVoiceCmd!!.toTypedArray(),
|
||||
voiceCmdCallback
|
||||
)
|
||||
}
|
||||
|
||||
pushBean?.buttons?.forEach {
|
||||
it.voiceCmd?.apply {
|
||||
mVoiceClient.registerUnWakeupCommand(
|
||||
VOICE_ACTION_PUSH_RIGHT,
|
||||
toTypedArray(),
|
||||
voiceCmdCallback
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun speakDefault(voice: String) {
|
||||
mVoiceClient.speakTTSVoiceWithLevel(voice,AIAssist.LEVEL3 ,voiceCmdCallback)
|
||||
}
|
||||
|
||||
fun pauseAnimator(on: Boolean) {
|
||||
floatView?.pauseTimer(on)
|
||||
}
|
||||
|
||||
fun isAddWindow(): Boolean = floatView?.isAddWindow() ?: false
|
||||
|
||||
fun push() {
|
||||
pushBean?.apply {
|
||||
showTimeout = showTimeoutShadow
|
||||
pushRepository.push(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/module_push_clear_bg_radius" />
|
||||
<solid android:color="#FF494B66 "/>
|
||||
</shape>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/module_push_ui_button_radius" />
|
||||
<gradient android:angle="135" android:endColor="#1F7EFF" android:startColor="#1E57A4" android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/module_push_ui_button_radius" />
|
||||
<gradient android:angle="135" android:endColor="#124C9A" android:startColor="#123463" android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/module_push_panel_item_corner" />
|
||||
<solid android:color="#1F2131" />
|
||||
<!-- <gradient
|
||||
android:angle="-90"
|
||||
android:endColor="#2F3047"
|
||||
android:startColor="#3F4057"
|
||||
android:type="linear" />-->
|
||||
</shape>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/module_push_ui_button_radius" />
|
||||
<gradient android:angle="135" android:endColor="#616381" android:startColor="#48495E" />
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/module_push_ui_button_radius" />
|
||||
<gradient android:angle="135" android:endColor="#3A3B4D" android:startColor="#2B2C38" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/module_push_dialog_check_width"
|
||||
android:layout_height="@dimen/module_push_dialog_check_height"
|
||||
android:background="@drawable/module_push_dialog_check_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_push_dialog_close"
|
||||
android:layout_width="@dimen/module_push_dialog_close_width"
|
||||
android:layout_height="@dimen/module_push_dialog_close_height"
|
||||
android:layout_marginLeft="@dimen/module_push_dialog_close_margin"
|
||||
android:layout_marginTop="@dimen/module_push_dialog_close_margin"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/module_push_dialog_close"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_dialog_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_dialog_title_margin"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_dialog_title_size"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_dialog_content"
|
||||
android:layout_width="@dimen/module_push_dialog_content_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_dialog_content_margin_top"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_dialog_content_size"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_push_dialog_title" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_push_ui_height"
|
||||
android:layout_marginTop="@dimen/module_push_ui_margin_top"
|
||||
android:background="@drawable/module_push_item_background">
|
||||
|
||||
<com.mogo.module.push.view.roundimage.RoundedImageView
|
||||
android:id="@+id/module_push_image"
|
||||
android:layout_width="@dimen/module_push_ui_image_width"
|
||||
android:layout_height="@dimen/module_push_ui_image_height"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius_bottom_left="@dimen/module_push_ui_image_corner"
|
||||
app:riv_corner_radius_top_left="@dimen/module_push_ui_image_corner" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_push_app_icon_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_push_ui_app_icon_leftMargin"
|
||||
android:layout_marginTop="@dimen/module_push_ui_app_icon_topMargin"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_push_image"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginTop="@dimen/module_push_ui_app_icon_goneTopMargin">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|left"
|
||||
android:maxWidth="@dimen/module_push_title_mix_width"
|
||||
android:maxLength="25"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_ui_title_textSize"
|
||||
app:layout_constrainedWidth="true"
|
||||
tools:text="官方公告" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_push_rl_content"
|
||||
android:layout_width="@dimen/module_push_ui_content_width"
|
||||
android:layout_height="@dimen/module_push_ui_content_height"
|
||||
android:layout_marginTop="@dimen/module_push_ui_content_marginTop"
|
||||
android:layout_marginBottom="@dimen/module_push_ui_content_marginBottom"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_push_app_icon_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_push_app_icon_title">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="3"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_ui_title_text_size" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/module_push_line"
|
||||
android:layout_width="@dimen/module_push_line_width"
|
||||
android:layout_height="@dimen/module_push_line_height"
|
||||
android:layout_marginLeft="@dimen/module_push_line_margin_left"
|
||||
android:background="@color/module_push_item_line_color"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_push_rl_content"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_check"
|
||||
android:layout_width="@dimen/module_push_check_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/module_push_check_margin"
|
||||
android:layout_marginBottom="@dimen/module_push_check_margin"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_push_check"
|
||||
android:textColor="@color/module_push_check_color"
|
||||
android:textSize="@dimen/module_push_check_text_size"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_push_line"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_push_ui_height"
|
||||
android:background="@drawable/module_push_item_background_p">
|
||||
|
||||
<com.mogo.eagle.core.function.notice.view.roundimage.RoundedImageView
|
||||
android:id="@+id/module_push_image"
|
||||
android:layout_width="@dimen/module_push_ui_image_width"
|
||||
android:layout_height="@dimen/module_push_ui_image_height"
|
||||
android:layout_marginLeft="@dimen/module_push_ui_image_marLeft"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="@dimen/module_push_ui_image_corner" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_push_app_icon_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_push_ui_app_icon_leftMargin"
|
||||
android:layout_marginTop="@dimen/module_push_ui_app_icon_topMargin"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/module_push_ui_app_icon_size"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_push_progress_bar_frame"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_push_image"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginTop="@dimen/module_push_ui_app_icon_goneTopMargin">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_push_app_icon"
|
||||
android:layout_width="@dimen/module_push_ui_app_icon_size"
|
||||
android:layout_height="@dimen/module_push_ui_app_icon_size"
|
||||
android:layout_marginRight="@dimen/module_push_title_margin_start"
|
||||
android:background="@drawable/module_push_ui_ic_message2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|left"
|
||||
android:maxWidth="@dimen/module_push_title_mix_width"
|
||||
android:singleLine="true"
|
||||
android:maxLength="25"
|
||||
tools:text="标题标题标题标题标题标题标题"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_ui_title_textSize"
|
||||
app:layout_constrainedWidth="true" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/module_push_ui_content_marginTop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_push_app_icon_title"
|
||||
app:layout_constraintRight_toRightOf="@id/module_push_progress_bar_frame"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_push_app_icon_title">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:maxLines="3"
|
||||
android:layout_above="@+id/module_push_buttons"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_ui_title_text_size"
|
||||
tools:text="文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内文本内容文本内容文本内" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_push_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_push_button_height"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginTop="@dimen/module_push_button_margin_top"
|
||||
android:layout_marginBottom="@dimen/module_push_button_margin_bottom"
|
||||
android:gravity="center"
|
||||
android:weightSum="2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_button_left"
|
||||
android:layout_width="@dimen/module_push_button_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/module_push_left_button"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:enabled="true"
|
||||
android:lines="1"
|
||||
android:maxWidth="@dimen/module_push_button_maxWidth"
|
||||
android:maxLength="6"
|
||||
android:text="查看"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_button_right"
|
||||
android:layout_width="@dimen/module_push_button_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_push_button_right_marLeft"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/module_push_right_button"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:maxWidth="@dimen/module_push_button_maxWidth"
|
||||
android:maxLength="6"
|
||||
android:text="忽略"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_push_progress_bar_frame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_progress_bar_frame_marginTop"
|
||||
android:layout_marginEnd="@dimen/module_push_progress_bar_frame_marginEnd"
|
||||
android:background="@drawable/module_push_decrease_timer_bkg"
|
||||
android:paddingLeft="@dimen/module_push_progress_bar_frame_padding"
|
||||
android:paddingRight="@dimen/module_push_progress_bar_frame_padding"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_timer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="@dimen/module_push_ui_timer_textSize"
|
||||
tools:text="11s" />
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,135 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/module_push_ui_width_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/module_push_item_background_origin"
|
||||
android:maxHeight="@dimen/module_push_item_maxHeight_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/module_push_ui_app_icon_leftMargin_vertical"
|
||||
android:paddingRight="@dimen/module_push_ui_app_icon_leftMargin_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_push_content_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/module_push_content_paddingBottom_vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_push_app_icon_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_ui_app_icon_topMargin_vertical"
|
||||
android:layout_marginBottom="@dimen/module_push_image_marginTop_vertical"
|
||||
android:minHeight="@dimen/module_push_ui_app_icon_size">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_push_app_icon"
|
||||
android:layout_width="@dimen/module_push_ui_app_icon_size"
|
||||
android:layout_height="@dimen/module_push_ui_app_icon_size"
|
||||
android:layout_marginRight="@dimen/module_push_title_margin_start"
|
||||
tools:background="@drawable/module_push_ui_ic_message2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@+id/module_push_app_icon"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|left"
|
||||
android:maxWidth="@dimen/module_push_title_mix_width"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_ui_title_textSize"
|
||||
tools:text="push title" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_push_progress_bar_frame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/module_push_decrease_timer_bkg"
|
||||
android:paddingLeft="@dimen/module_push_progress_bar_frame_padding"
|
||||
android:paddingRight="@dimen/module_push_progress_bar_frame_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_timer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="@dimen/module_push_ui_timer_textSize"
|
||||
tools:text="11s" />
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<com.mogo.module.push.view.roundimage.RoundedImageView
|
||||
android:id="@+id/module_push_image"
|
||||
android:layout_width="@dimen/module_push_ui_image_width_vertical"
|
||||
android:layout_height="@dimen/module_push_ui_image_height_vertical"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="@dimen/module_push_ui_content_marginTop_vertical"
|
||||
android:scaleType="fitXY"
|
||||
app:riv_corner_radius="@dimen/module_push_ui_image_corner" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="@dimen/module_push_button_margin_top"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="4"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_push_ui_title_text_size"
|
||||
tools:text="文本内容文本内文本内容文本内文本内容文本内文本内容文本内文本内容文本内文本内容文本内文本内容文本内文本内容文本内文本内容文本内" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_push_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_push_button_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="@dimen/module_push_button_margin_bottom"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_button_left"
|
||||
android:layout_width="@dimen/module_push_button_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/module_push_left_button"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:maxWidth="@dimen/module_push_button_maxWidth"
|
||||
android:maxLength="6"
|
||||
android:text="查看"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_button_right"
|
||||
android:layout_width="@dimen/module_push_button_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_push_button_right_marLeft"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/module_push_right_button"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:maxWidth="@dimen/module_push_button_maxWidth"
|
||||
android:maxLength="6"
|
||||
android:text="忽略"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/module_push_panel_marginTop"
|
||||
android:layout_marginBottom="@dimen/module_push_panel_marginBottom"
|
||||
android:layout_marginRight="@dimen/module_push_panel_marginRight"
|
||||
android:layout_marginLeft="@dimen/module_push_panel_marginRight"
|
||||
android:paddingLeft="@dimen/module_push_panel_paddingLeft"
|
||||
android:paddingRight="@dimen/module_push_panel_paddingLeft"
|
||||
android:background="@drawable/module_push_message_background"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_id_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_activity_title_margin_top"
|
||||
android:text="历史消息"
|
||||
android:textColor="@color/module_push_panel_title_textColor"
|
||||
android:textSize="@dimen/module_push_activity_title_text_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_push_id_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/module_push_activity_close_margin_top"
|
||||
android:src="@drawable/module_push_close" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/module_push_id_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/module_push_activity_recycler_view_margin_top" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_id_not_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_push_str_not_data"
|
||||
android:textColor="@color/module_push_panel_title_textColor"
|
||||
android:textSize="@dimen/module_push_activity_not_data_text_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_id_clear"
|
||||
android:layout_width="@dimen/module_push_content_only_height"
|
||||
android:layout_height="@dimen/module_push_button_height"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginBottom="@dimen/module_push_activity_clear_margin_bottom"
|
||||
android:background="@drawable/module_push_clear_bg"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_push_str_clear"
|
||||
android:textColor="@color/module_push_panel_title_textColor"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,105 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.module.push.view.SwipeItemLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="@dimen/module_push_panel_paddingBottom">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_push_message_item_height">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/module_push_item_click"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/module_push_recycler_item_background">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
android:id="@+id/module_push_item_app_icon"
|
||||
android:layout_width="@dimen/module_push_message_app_icon_size"
|
||||
android:layout_height="@dimen/module_push_message_app_icon_size"
|
||||
android:layout_marginStart="@dimen/module_push_message_margin_start"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_item_title"
|
||||
android:layout_width="@dimen/module_push_item_content_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_push_image_margin_top"
|
||||
android:layout_marginTop="@dimen/module_push_item_title_margin_top"
|
||||
android:ellipsize="end"
|
||||
android:gravity="left"
|
||||
android:maxLines="1"
|
||||
android:text="push title"
|
||||
android:textColor="@color/module_push_item_title_textColor"
|
||||
android:textSize="@dimen/module_push_title_text_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_push_item_app_icon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_max="@dimen/module_push_item_content_width"
|
||||
app:layout_goneMarginBottom="@dimen/module_push_item_title_gone_margin_bottom" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_item_content"
|
||||
android:layout_width="@dimen/module_push_item_content_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/module_push_item_content_margin_end"
|
||||
android:ellipsize="end"
|
||||
android:gravity="left"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/module_push_item_content_textColor"
|
||||
android:textSize="@dimen/module_push_item_content_text_size"
|
||||
app:layout_constraintStart_toStartOf="@+id/module_push_item_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_push_item_title"
|
||||
tools:text="发现系统新版本,共140.3M。部分功能优化,建议下载升级。" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
android:id="@+id/module_push_item_image"
|
||||
android:layout_width="@dimen/module_push_item_image_width"
|
||||
android:layout_height="@dimen/module_push_item_image_height"
|
||||
android:layout_marginEnd="@dimen/module_push_message_item_image_margin_end"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:miv_radius="@dimen/module_push_item_image_radius"
|
||||
app:miv_shape="round" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_item_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_push_item_time_textSize"
|
||||
android:layout_marginEnd="@dimen/module_push_image_margin_top"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/module_push_item_time_textColor"
|
||||
android:textSize="@dimen/module_push_massage_time_text_size"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_push_item_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_push_item_content"
|
||||
tools:text="3:20" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_push_button_margin_top">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_push_item_delete"
|
||||
android:layout_width="@dimen/module_push_message_item_height"
|
||||
android:layout_height="@dimen/module_push_message_item_height"
|
||||
android:layout_marginStart="@dimen/module_push_button_margin_top"
|
||||
android:background="@drawable/module_push_recycler_item_background"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_push_str_delete"
|
||||
android:textColor="@color/module_push_item_title_textColor"
|
||||
android:textSize="@dimen/module_push_title_text_size" />
|
||||
</FrameLayout>
|
||||
</com.mogo.module.push.view.SwipeItemLayout>
|
||||
@@ -849,21 +849,21 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
//前车急刹预警
|
||||
EventTypeEnum.TYPE_USECASE_ID_EBW.poiType -> {
|
||||
EventTypeHelper.getEBW(appId){ alert ,tts ->
|
||||
EventTypeHelper.getEBW(appId){ alert, tts ->
|
||||
alertContent = alert
|
||||
ttsContent = tts
|
||||
}
|
||||
}
|
||||
//前向碰撞预警
|
||||
EventTypeEnum.TYPE_USECASE_ID_FCW.poiType -> {
|
||||
EventTypeHelper.getFCW(appId){ alert ,tts ->
|
||||
EventTypeHelper.getFCW(appId){ alert, tts ->
|
||||
alertContent = alert
|
||||
ttsContent = tts
|
||||
}
|
||||
}
|
||||
//逆向超车预警
|
||||
EventTypeEnum.TYPE_USECASE_ID_DNPW.poiType -> {
|
||||
EventTypeHelper.getDNPW(appId){ alert ,tts ->
|
||||
EventTypeHelper.getDNPW(appId){ alert, tts ->
|
||||
alertContent = alert
|
||||
ttsContent = tts
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import androidx.core.util.Pair
|
||||
import androidx.localbroadcastmanager.content.*
|
||||
import com.mogo.cloud.commons.utils.*
|
||||
import com.mogo.cloud.passport.*
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.module.common.enums.EventTypeHelper
|
||||
import com.mogo.commons.network.*
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW
|
||||
@@ -34,7 +36,6 @@ import com.mogo.eagle.core.function.v2x.events.receiver.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker.Marker
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.*
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.*
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils
|
||||
import com.mogo.eagle.core.function.v2x.events.voice.*
|
||||
@@ -51,7 +52,6 @@ import com.mogo.module.common.*
|
||||
import com.mogo.module.common.drawer.*
|
||||
import com.mogo.module.common.entity.*
|
||||
import com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum
|
||||
import com.mogo.module.common.enums.*
|
||||
import com.mogo.service.statusmanager.*
|
||||
import com.mogo.service.statusmanager.StatusDescriptor.ACC_STATUS
|
||||
import com.mogo.service.statusmanager.StatusDescriptor.SEEK_HELPING
|
||||
|
||||
@@ -62,8 +62,6 @@ internal object BridgeApi {
|
||||
|
||||
fun statusManager(): IMogoStatusManager? = apis?.statusManagerApi
|
||||
|
||||
fun analytics() = apis?.analyticsApi
|
||||
|
||||
fun v2xMarker() = v2xMarker
|
||||
|
||||
fun v2xPolyline() = v2xPolyline
|
||||
@@ -80,12 +78,4 @@ internal object BridgeApi {
|
||||
|
||||
fun registerCenter() = apis?.registerCenterApi
|
||||
|
||||
fun imageLoader() = apis?.imageLoaderApi
|
||||
|
||||
fun windowManager() = apis?.windowManagerApi
|
||||
|
||||
fun displayEffects() = apis?.displayEffectsManager
|
||||
|
||||
fun intentManager() = apis?.intentManagerApi
|
||||
|
||||
}
|
||||
@@ -3,18 +3,10 @@ package com.mogo.eagle.core.function.v2x.events.manager;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.module.common.entity.MarkerCardResult;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerNoveltyInfo;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.v2x.data.V2XMarkerCardResult;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
@@ -43,23 +35,6 @@ public interface IMoGoV2XMarkerManager extends IProvider {
|
||||
*/
|
||||
void analysisV2XRoadEvent(V2XMarkerCardResult markerCardResult);
|
||||
|
||||
|
||||
/**
|
||||
* 展开气泡
|
||||
*
|
||||
* @param context
|
||||
* @param currentMarker
|
||||
*/
|
||||
IMogoMarker openMarker(Context context, IMogoMarker currentMarker);
|
||||
|
||||
/**
|
||||
* 关闭气泡
|
||||
*
|
||||
* @param context
|
||||
* @param currentMarker
|
||||
*/
|
||||
void closeMarker(Context context, IMogoMarker currentMarker);
|
||||
|
||||
/**
|
||||
* 绘制正在预警的道路事件的POI点
|
||||
*
|
||||
|
||||
@@ -4,15 +4,14 @@ import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
@@ -21,21 +20,16 @@ import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.Utils;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
@@ -45,6 +39,7 @@ import com.mogo.v2x.data.V2XMarkerExploreWay;
|
||||
import com.mogo.v2x.data.V2XMarkerLocation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
@@ -127,7 +122,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
// 探路目前只有上报拥堵
|
||||
String poi = markerExploreWay.getPoiType();
|
||||
v2XRoadEventEntity.setPoiType(poi);
|
||||
v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay,markerCardResult.getExtras()));
|
||||
v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay, markerCardResult.getExtras()));
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
|
||||
}
|
||||
@@ -139,67 +134,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IMogoMarker openMarker(Context context, IMogoMarker currentMarker) {
|
||||
try {
|
||||
if (currentMarker != null) {
|
||||
Object object = currentMarker.getObject();
|
||||
if (object != null) {
|
||||
// 修改数据
|
||||
MarkerShowEntity showEntity = (MarkerShowEntity) object;
|
||||
showEntity.setChecked(true);
|
||||
|
||||
// 获取数据对应的View
|
||||
IMarkerView markerView = MapMarkerAdapter.getMarkerView(context,
|
||||
showEntity,
|
||||
currentMarker.getMogoMarkerOptions());
|
||||
|
||||
Bitmap bitmap;
|
||||
if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)
|
||||
|| showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) {
|
||||
bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity);
|
||||
} else {
|
||||
bitmap = ViewUtils.fromView(markerView.getView());
|
||||
}
|
||||
|
||||
currentMarker.setIcon(bitmap);
|
||||
currentMarker.setToTop();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return currentMarker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeMarker(Context context, IMogoMarker currentMarker) {
|
||||
try {
|
||||
if (currentMarker != null) {
|
||||
Object object = currentMarker.getObject();
|
||||
if (object != null) {
|
||||
MarkerShowEntity showEntity = (MarkerShowEntity) object;
|
||||
showEntity.setChecked(false);
|
||||
IMarkerView markerView = MapMarkerAdapter.getMarkerView(context,
|
||||
showEntity,
|
||||
currentMarker.getMogoMarkerOptions());
|
||||
|
||||
Bitmap bitmap;
|
||||
if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA)
|
||||
|| showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) {
|
||||
bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity);
|
||||
} else {
|
||||
bitmap = ViewUtils.fromView(markerView.getView());
|
||||
}
|
||||
currentMarker.setIcon(bitmap);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) {
|
||||
try {
|
||||
@@ -225,20 +159,15 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
markerShowEntity.setMarkerLocation(markerExploreWay.getLocation());
|
||||
markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_NOVELTY);
|
||||
|
||||
// 由于性能问题,D车机不使用事件扩散动画
|
||||
if (!CarSeries.isF8xxSeries()) {
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
|
||||
} else {
|
||||
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
|
||||
optionsRipple.period(1);
|
||||
}
|
||||
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
|
||||
optionsRipple.period(1);
|
||||
boolean isVrMode = false;
|
||||
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
|
||||
if (statusManager != null) {
|
||||
isVrMode = statusManager.isVrMode();
|
||||
}
|
||||
if (isVrMode) {
|
||||
mAlarmInfoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl(markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, clickListener);
|
||||
mAlarmInfoMarker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity);
|
||||
} else {
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
|
||||
IMogoMarkerManager marker = MogoMarkerManager.getInstance(context);
|
||||
|
||||
@@ -3,23 +3,11 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.mogo.eagle.core.function.v2x.R;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
@@ -27,7 +26,7 @@ public class V2XMarkerAdapter {
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回道路事件静态的图,因为D车机性能不行,会卡顿
|
||||
* 返回道路事件静态的图,因为车机性能不行,会卡顿
|
||||
*/
|
||||
public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) {
|
||||
Bitmap bitmap;
|
||||
@@ -156,17 +155,4 @@ public class V2XMarkerAdapter {
|
||||
return icons;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模拟点
|
||||
*
|
||||
* @param context 上下文
|
||||
* @return MarkerView
|
||||
*/
|
||||
public static Bitmap getV2XCarMarkerView(Context context, MarkerShowEntity showEntity) {
|
||||
if (showEntity.isChecked()) {
|
||||
return new V2XMarkerCarInfoView(context, showEntity).getView();
|
||||
} else {
|
||||
return new V2XMarkerCarView(context, showEntity).getView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.marker
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.text.TextUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.v2x.R
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes.V2XMarkerEntity
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar
|
||||
import com.mogo.module.common.entity.MarkerShowEntity
|
||||
import kotlinx.android.synthetic.main.view_marker_car.view.*
|
||||
import kotlinx.android.synthetic.main.view_marker_car_info.view.*
|
||||
import kotlinx.android.synthetic.main.view_marker_car_info.view.ivCar
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-0619:55
|
||||
* desc : 绘制在线车辆,特殊车辆
|
||||
* version: 1.0
|
||||
*/
|
||||
class V2XMarkerCarInfoView(context: Context, showEntity: MarkerShowEntity) :
|
||||
ConstraintLayout(context) {
|
||||
|
||||
init {
|
||||
initView(context, showEntity)
|
||||
}
|
||||
|
||||
private fun initView(context: Context, showEntity: MarkerShowEntity) {
|
||||
val bindObj: Any = showEntity.bindObj
|
||||
if (bindObj is MarkerOnlineCar) {
|
||||
//1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆
|
||||
when (bindObj.userInfo.safeLabelType) {
|
||||
// 可直播车机
|
||||
4 -> {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car, this)
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio)
|
||||
}
|
||||
else -> {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car_info, this)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bindObj is V2XMarkerEntity) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car, this)
|
||||
}
|
||||
updateUI(showEntity)
|
||||
}
|
||||
|
||||
fun updateUI(showEntity: MarkerShowEntity) {
|
||||
ivCar.rotation = showEntity.markerLocation.angle.toFloat()
|
||||
// ivCar.rotation = 90f
|
||||
|
||||
tvUserMarker.text = if (TextUtils.isEmpty(showEntity.textContent)) {
|
||||
""
|
||||
} else {
|
||||
showEntity.textContent
|
||||
}
|
||||
|
||||
val bindObj: Any = showEntity.bindObj
|
||||
if (bindObj is MarkerOnlineCar) {
|
||||
tvMarkerContent.text =
|
||||
if (bindObj.userInfo == null && TextUtils.isEmpty(bindObj.userInfo.userName)) {
|
||||
"蘑菇车主"
|
||||
} else {
|
||||
bindObj.userInfo.userName
|
||||
}
|
||||
|
||||
//车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆',
|
||||
when (bindObj.carInfo.vehicleType) {
|
||||
// 普通车
|
||||
0 -> {
|
||||
clMarkerContent.visibility = View.VISIBLE
|
||||
ivReverseTriangle.visibility = View.VISIBLE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
// 警车
|
||||
1 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
// 救护车
|
||||
2 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
// 道路救援车辆
|
||||
3 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
else -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bindObj is V2XMarkerEntity) {
|
||||
when (bindObj.targetId) {
|
||||
10001 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
10002 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
10003 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
//失控车
|
||||
10004 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
// 故障车
|
||||
20007 -> {
|
||||
clMarkerContent.visibility = View.GONE
|
||||
ivReverseTriangle.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getView(): Bitmap {
|
||||
return ViewUtils.fromView(this)
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.marker
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.v2x.R
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes.V2XMarkerEntity
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar
|
||||
import com.mogo.module.common.entity.MarkerShowEntity
|
||||
import kotlinx.android.synthetic.main.view_marker_car.view.*
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-0619:55
|
||||
* desc : 绘制在线车辆,特殊车辆
|
||||
* version: 1.0
|
||||
*/
|
||||
class V2XMarkerCarView(context: Context, showEntity: MarkerShowEntity) :
|
||||
ConstraintLayout(context) {
|
||||
|
||||
init {
|
||||
initView(context, showEntity)
|
||||
}
|
||||
|
||||
private fun initView(context: Context, showEntity: MarkerShowEntity) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_marker_car, this)
|
||||
updateUI(showEntity)
|
||||
}
|
||||
|
||||
fun updateUI(showEntity: MarkerShowEntity) {
|
||||
ivCar.rotation = showEntity.markerLocation.angle.toFloat()
|
||||
|
||||
val bindObj: Any = showEntity.bindObj
|
||||
if (bindObj is MarkerOnlineCar) {
|
||||
//1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆
|
||||
when (bindObj.userInfo.safeLabelType) {
|
||||
1 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_blue)
|
||||
}
|
||||
2 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_green)
|
||||
}
|
||||
3 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_red)
|
||||
}
|
||||
4 -> {
|
||||
ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio)
|
||||
}
|
||||
}
|
||||
|
||||
//车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆',
|
||||
when (bindObj.carInfo.vehicleType) {
|
||||
// 普通车
|
||||
0 -> {
|
||||
ivMarkerTip.visibility = View.VISIBLE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
// 警车
|
||||
1 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
// 救护车
|
||||
2 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
// 道路救援车辆
|
||||
3 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
else -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bindObj is V2XMarkerEntity) {
|
||||
when (bindObj.targetId) {
|
||||
10001 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_gray)
|
||||
}
|
||||
10002 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_ambulance)
|
||||
}
|
||||
10003 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.icon_car_police)
|
||||
}
|
||||
10004 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
// 故障车
|
||||
20007 -> {
|
||||
ivMarkerTip.visibility = View.GONE
|
||||
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getView(): Bitmap {
|
||||
return ViewUtils.fromView(this)
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
||||
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
|
||||
@@ -17,8 +17,6 @@ import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.v2x.DisplayEffectsInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -73,26 +71,24 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
getV2XMessageEntity().getContent().getTts(false);
|
||||
}
|
||||
showWindow();
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics != null) {
|
||||
String poiType = getV2XMessageEntity().getContent().getPoiType();
|
||||
String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat());
|
||||
String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon());
|
||||
String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId();
|
||||
String style = "1";
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", infoId);
|
||||
properties.put("type", poiType);
|
||||
properties.put("lng", lon);
|
||||
properties.put("lat", lat);
|
||||
properties.put("style", style);
|
||||
analytics.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
}
|
||||
String poiType = getV2XMessageEntity().getContent().getPoiType();
|
||||
String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat());
|
||||
String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon());
|
||||
String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId();
|
||||
String style = "1";
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", infoId);
|
||||
properties.put("type", poiType);
|
||||
properties.put("lng", lon);
|
||||
properties.put("lat", lat);
|
||||
properties.put("style", style);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void showWindow() {
|
||||
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
|
||||
V2XRoadEventEntity content = entity != null ? entity.getContent() : null;
|
||||
@@ -131,12 +127,11 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
if (entity.isNeedAddLine()) {
|
||||
drawPOI();
|
||||
}
|
||||
DisplayEffectsInterface wu = BridgeApi.INSTANCE.displayEffects();
|
||||
V2XRoadEventEntity content = entity.getContent();
|
||||
if (wu != null && content != null) {
|
||||
if (content != null) {
|
||||
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
|
||||
if (noveltyInfo != null && EventTypeEnum.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) {
|
||||
wu.displayEffects(EventTypeEnum.FOURS_FOG.getPoiType());
|
||||
CallerHmiManager.INSTANCE.displayEffects();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,7 @@ import android.graphics.Rect
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.utilcode.util.WindowUtils
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.utils.CarSeries
|
||||
import java.lang.Exception
|
||||
|
||||
class MapUtils {
|
||||
|
||||
@@ -22,34 +18,18 @@ class MapUtils {
|
||||
return
|
||||
}
|
||||
val mBoundRect = Rect()
|
||||
val paddingTop: Int
|
||||
val paddingBottom: Int
|
||||
val paddingRight: Int
|
||||
val paddingLeft: Int
|
||||
if (CarSeries.isF8xxSeries()) {
|
||||
paddingTop = WindowUtils.dip2px(context, 250f)
|
||||
paddingBottom = WindowUtils.dip2px(context, 100f)
|
||||
paddingRight = WindowUtils.dip2px(context, 100f)
|
||||
paddingLeft = WindowUtils.dip2px(context, 475f)
|
||||
} else {
|
||||
paddingTop = WindowUtils.dip2px(context, 370f)
|
||||
paddingBottom = WindowUtils.dip2px(context, 100f)
|
||||
paddingRight = WindowUtils.dip2px(context, 100f)
|
||||
paddingLeft = WindowUtils.dip2px(context, 575f)
|
||||
}
|
||||
mBoundRect.bottom = paddingBottom
|
||||
mBoundRect.top = paddingTop
|
||||
mBoundRect.left = paddingLeft
|
||||
mBoundRect.right = paddingRight
|
||||
mBoundRect.bottom = WindowUtils.dip2px(context, 100f)
|
||||
mBoundRect.top = WindowUtils.dip2px(context, 370f)
|
||||
mBoundRect.left = WindowUtils.dip2px(context, 575f)
|
||||
mBoundRect.right = WindowUtils.dip2px(context, 100f)
|
||||
// 当前车辆位置
|
||||
val carLocation = MogoLatLng(
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84Lat(),
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84Lon()
|
||||
)
|
||||
// 调整自适应的地图镜头
|
||||
carLocation?.let {
|
||||
CallerMapUIServiceManager.getMapUIController()?.showBounds("MapUtils", it, listOf(latLng), mBoundRect, true)
|
||||
}
|
||||
CallerMapUIServiceManager.getMapUIController()
|
||||
?.showBounds("MapUtils", carLocation, listOf(latLng), mBoundRect, true)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.utils;
|
||||
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -15,17 +14,13 @@ public class TrackUtils {
|
||||
//埋点
|
||||
public static void trackV2xRoadShow(String dbid, String type, String style) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", dbid);
|
||||
properties.put("type", type);
|
||||
properties.put("lng", V2XStatusManager.getInstance().getLocation().getLongitude());
|
||||
properties.put("lat", V2XStatusManager.getInstance().getLocation().getLatitude());
|
||||
properties.put("style", style);
|
||||
analytics.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -34,15 +29,11 @@ public class TrackUtils {
|
||||
//道路事件操作埋点 v2x_road_event
|
||||
public static void trackV2xRoadEvent(String dbid, String sn, String type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("dbid", dbid);
|
||||
properties.put("sn", sn);
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.V2X_ROAD_EVET, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_EVET, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -54,13 +45,9 @@ public class TrackUtils {
|
||||
*/
|
||||
public static void trackV2xRoadProduceEvent(int type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.V2X_ROAD_PRODUCE, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_PRODUCE, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -68,13 +55,9 @@ public class TrackUtils {
|
||||
|
||||
public static void trackV2XMarkerClick(int type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.LAUNCHER_ICON_CLICK, properties);
|
||||
AnalyticsUtils.track(V2XConst.LAUNCHER_ICON_CLICK, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -95,13 +78,9 @@ public class TrackUtils {
|
||||
*/
|
||||
public static void trackV2xHistoryEvent(int type) {
|
||||
try {
|
||||
IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics();
|
||||
if (analytics == null) {
|
||||
return;
|
||||
}
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
analytics.track(V2XConst.V2X_ROAD_EVET_HISTORY_BUTTON, properties);
|
||||
AnalyticsUtils.track(V2XConst.V2X_ROAD_EVET_HISTORY_BUTTON, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package com.mogo.eagle.core.function.v2x.events.voice
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.text.TextUtils
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
|
||||
import com.mogo.service.intent.IMogoIntentListener
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
@@ -51,7 +51,7 @@ object V2XVoiceManager : IMogoVoiceCmdCallBack, IMogoIntentListener {
|
||||
try {
|
||||
unRegisterWakeCmd(cmd)
|
||||
voiceCallbackMap[cmd] = callbackListener
|
||||
BridgeApi.intentManager()?.registerIntentListener(cmd, this)
|
||||
IntentManager.getInstance().registerIntentListener(cmd, this)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
@@ -63,7 +63,7 @@ object V2XVoiceManager : IMogoVoiceCmdCallBack, IMogoIntentListener {
|
||||
fun unRegisterWakeCmd(cmd: String): V2XVoiceManager {
|
||||
try {
|
||||
voiceCallbackMap.remove(cmd)
|
||||
BridgeApi.intentManager()?.unregisterIntentListener(cmd, this)
|
||||
IntentManager.getInstance().unregisterIntentListener(cmd, this)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
@@ -4,21 +4,22 @@ import android.location.Location
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_GREEN
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrentRoadTrafficLight
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlin.math.abs
|
||||
@@ -28,7 +29,7 @@ import kotlin.math.min
|
||||
|
||||
|
||||
class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
IMogoCarLocationChangedListener2 {
|
||||
IMoGoMapLocationListener {
|
||||
|
||||
private var vip: Boolean = false
|
||||
|
||||
@@ -38,7 +39,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
// 是否已进入到路口(停止线处)
|
||||
private var isEnter = false
|
||||
|
||||
private var mLocation: Location? = null
|
||||
private var mLocation: MogoLocation? = null
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -53,7 +54,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
// 到路口100m时回调
|
||||
CallerLogger.d("$M_V2X$TAG", "处理路口交通数据:是否是第一次处理:${isFirst}是否进入路口:${isEnter}")
|
||||
if (trafficLightResult.currentRoadIsRight()) {
|
||||
CallerLogger.d("$M_V2X$TAG","当前道路右转,不处理")
|
||||
CallerLogger.d("$M_V2X$TAG", "当前道路右转,不处理")
|
||||
return
|
||||
}
|
||||
if (isFirst && !isEnter) {
|
||||
@@ -79,7 +80,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
fun listenTrafficLight() {
|
||||
CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
|
||||
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
|
||||
MogoApisHandler.getInstance().apis.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
||||
CallVipSetListenerManager.registerVipSetListener(TAG, this)
|
||||
}
|
||||
|
||||
@@ -177,7 +178,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
for (i in 0..size step 2) {
|
||||
if (i < size) {
|
||||
// 自车到0-1、2-3、4-5、6-7组成的线段的最小距离
|
||||
minValue = min(minValue, LocationUtils.pointToLine(points[i].lon, points[i].lat, points[i+1].lon, points[i+1].lat, lon, lat))
|
||||
minValue = min(
|
||||
minValue,
|
||||
LocationUtils.pointToLine(
|
||||
points[i].lon,
|
||||
points[i].lat,
|
||||
points[i + 1].lon,
|
||||
points[i + 1].lat,
|
||||
lon,
|
||||
lat
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
return if (minValue > 9999) 0f else minValue.toFloat()
|
||||
@@ -186,18 +197,26 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
/**
|
||||
* 闯红灯预警
|
||||
*/
|
||||
@BizConfig(V2I,"",BIZ_IVP)
|
||||
@BizConfig(V2I, "", BIZ_IVP)
|
||||
private fun redLightWarning() {
|
||||
CallerLogger.d("$M_V2X$TAG", "=====闯红灯预警=====")
|
||||
ThreadUtils.runOnUiThread {
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, EventTypeEnum.TYPE_USECASE_ID_IVP.content, EventTypeEnum.TYPE_USECASE_ID_IVP.tts, EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, null, true, 5000L)
|
||||
CallerHmiManager.showWarningV2X(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.tts,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绿灯通行提示
|
||||
*/
|
||||
@BizConfig(V2I,"",BIZ_IVP_GREEN)
|
||||
@BizConfig(V2I, "", BIZ_IVP_GREEN)
|
||||
private fun greenLightWarning(speed: String = "50") {
|
||||
CallerLogger.d("$M_V2X$TAG", "=====绿灯通行预警=====")
|
||||
ThreadUtils.runOnUiThread {
|
||||
@@ -209,7 +228,15 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
speed
|
||||
)
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts, EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L)
|
||||
CallerHmiManager.showWarningV2X(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
content,
|
||||
tts,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,13 +248,11 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
|
||||
CallVipSetListenerManager.unRegisterVipSetListener(TAG)
|
||||
CallerTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
|
||||
MogoApisHandler.getInstance().apis.registerCenterApi.unregisterCarLocationChangedListener(
|
||||
TAG, this
|
||||
)
|
||||
CallerMapLocationListenerManager.removeListener(TAG,false)
|
||||
}
|
||||
|
||||
override fun onCarLocationChanged2(latLng: Location?) {
|
||||
latLng?.let {
|
||||
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
|
||||
location?.let {
|
||||
mLocation = it
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB |
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#585A7C" />
|
||||
<corners android:radius="360dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_6"
|
||||
android:left="@dimen/dp_6"
|
||||
android:right="@dimen/dp_6"
|
||||
android:top="@dimen/dp_6" />
|
||||
|
||||
</shape>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#5CC1FF"
|
||||
android:startColor="#256BFF" />
|
||||
<corners android:radius="360dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_3"
|
||||
android:left="@dimen/dp_16"
|
||||
android:right="@dimen/dp_16"
|
||||
android:top="@dimen/dp_3" />
|
||||
|
||||
</shape>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:id="@+id/shape_id" >
|
||||
<!-- 倒三角 -->
|
||||
<rotate
|
||||
android:fromDegrees="45"
|
||||
android:pivotX="135%"
|
||||
android:pivotY="15%"
|
||||
android:toDegrees="45" >
|
||||
<shape android:shape="rectangle" >
|
||||
<size android:width="@dimen/dp_20"
|
||||
android:height="@dimen/dp_20"/>
|
||||
<solid android:color="#3F4057" />
|
||||
</shape >
|
||||
</rotate >
|
||||
</item >
|
||||
</layer-list >
|
||||
@@ -20,7 +20,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_18">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventImg"
|
||||
android:layout_width="@dimen/module_v2x_event_image_width"
|
||||
android:layout_height="@dimen/module_v2x_event_image_height"
|
||||
@@ -108,7 +108,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/ivEventDistanceLogo"
|
||||
tools:text="2020/01/02 12:54" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventHead"
|
||||
android:layout_width="@dimen/module_v2x_event_head_size"
|
||||
android:layout_height="@dimen/module_v2x_event_head_size"
|
||||
@@ -213,7 +213,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/iv_event"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:visibility="gone">
|
||||
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventImg"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
@@ -99,7 +99,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/ivEventDistanceLogo"
|
||||
tools:text="2020/01/02 12:54" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivEventHead"
|
||||
android:layout_width="@dimen/module_v2x_event_head_size"
|
||||
android:layout_height="@dimen/module_v2x_event_head_size"
|
||||
@@ -226,7 +226,7 @@
|
||||
android:layout_height="@dimen/module_v2x_road_event_height"
|
||||
android:background="@drawable/bg_v2x_event_bg">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/iv_event"
|
||||
android:layout_width="@dimen/module_v2x_road_event_icon_width"
|
||||
android:layout_height="@dimen/module_v2x_road_event_icon_height"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivFaultHelpHead"
|
||||
android:layout_width="@dimen/module_v2x_event_help_head_size"
|
||||
android:layout_height="@dimen/module_v2x_event_help_head_size"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivFaultHelpHead"
|
||||
android:layout_width="@dimen/module_v2x_fault_help_height"
|
||||
android:layout_height="@dimen/module_v2x_fault_help_height"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_30" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivReportHead"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_20" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivReportHead"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_height="match_parent"
|
||||
app:roundLayoutRadius="@dimen/dp_30">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivImg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -31,7 +31,7 @@
|
||||
</com.mogo.eagle.core.widget.RoundLayout>
|
||||
</com.mogo.eagle.core.widget.RoundLayout>
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivReportHead"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_v2x_event_list_item">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/ivFaultHelpHead"
|
||||
android:layout_width="@dimen/module_v2x_history_event_icon_size"
|
||||
android:layout_height="@dimen/module_v2x_history_event_icon_size"
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/dp_80"
|
||||
android:orientation="vertical"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivMarkerTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/v_to_x_marker_car_red"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:rotation="90"
|
||||
android:src="@drawable/icon_car_gray"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ivMarkerTip"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivMarkerTip"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivMarkerTip" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/dp_5"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:background="@drawable/v2x_map_marker_blue_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
android:id="@+id/ivUserHead"
|
||||
android:layout_width="@dimen/dp_76"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:miv_failureHolder="@drawable/icon_default_user_head"
|
||||
app:miv_overlayImageId="@drawable/icon_default_user_head"
|
||||
app:miv_placeHolder="@drawable/icon_default_user_head"
|
||||
app:miv_shape="circle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:ellipsize="end"
|
||||
android:minWidth="@dimen/dp_150"
|
||||
android:singleLine="true"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_32"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ivIcon"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivUserHead"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHead"
|
||||
app:layout_goneMarginRight="@dimen/dp_30"
|
||||
tools:text="诗一样的女子" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUserMarker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/v2x_map_marker_driver_type_blue_info"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvMarkerContent"
|
||||
tools:text="老司机" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="@dimen/dp_85"
|
||||
android:layout_height="@dimen/dp_85"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_talk"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvMarkerContent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="-10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="@+id/clMarkerContent"
|
||||
app:layout_constraintStart_toStartOf="@+id/clMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/clMarkerContent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivReverseTriangle"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/v2x_shape_reverse_triangle_blue"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_map_marker_car_gray"
|
||||
android:translationY="-10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -20,7 +20,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:clickable="true" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:clickable="true" />
|
||||
|
||||
<com.mogo.service.imageloader.MogoImageView
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -23,27 +23,6 @@ public class MogoServicePaths {
|
||||
@Deprecated
|
||||
public static final String PATH_SERVICES_MAP = "/mapservices/api";
|
||||
|
||||
/**
|
||||
* 图片接口ARouter实例化路径
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_UTILS_IMAGE_LOADER = "/imageloader/api";
|
||||
|
||||
/**
|
||||
* 埋点接口ARouter实例化路径
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_UTILS_ANALYTICS = "/utils/analytics";
|
||||
|
||||
/**
|
||||
* 状态管理接口
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_STATUS_MANAGER = "/statusmanager/api";
|
||||
|
||||
/**
|
||||
* 消息中心
|
||||
*/
|
||||
@@ -51,29 +30,13 @@ public class MogoServicePaths {
|
||||
@Deprecated
|
||||
public static final String PATH_WINDOW_MANAGER = "/windowmanger/api";
|
||||
|
||||
/**
|
||||
* 管理 fragment
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_FRAGMENT_MANAGER = "/fragmentmanager/api";
|
||||
|
||||
/**
|
||||
* 免唤醒语音控制
|
||||
*
|
||||
* @deprecated use {@link #PATH_INTENT_MANAGER} instead.
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_VOICE_MANAGER = "/voicemanager/api";
|
||||
|
||||
/**
|
||||
* 意图控制接口
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_INTENT_MANAGER = "/intentmanager/api";
|
||||
|
||||
/**
|
||||
* 基础功能监听回调注册
|
||||
*/
|
||||
@@ -88,27 +51,6 @@ public class MogoServicePaths {
|
||||
@Deprecated
|
||||
public static final String PATH_SERVICE_APIS = "/mogoservice/apis";
|
||||
|
||||
/**
|
||||
* 顶部1/2屏管理
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_EXTENSIONS_TOP_VIEW_MANAGER = "/topview/api";
|
||||
|
||||
/**
|
||||
* 浓雾等极端事件特殊效果
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_MAIN_DISPLAY_EFFECTS_MANAGER = "/displayeffects/api";
|
||||
|
||||
/**
|
||||
* 其他模块调用公共的marker打点
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_MARKER_SERVICE = "/mogomarker/api";
|
||||
|
||||
/**
|
||||
* 自研地图和高德地图切换
|
||||
*/
|
||||
@@ -170,7 +112,7 @@ public class MogoServicePaths {
|
||||
public static final String PATH_BINDING_CAR = "/bindingcar/api";
|
||||
|
||||
/**
|
||||
* 云公告 模块
|
||||
* 路侧直播流 模块
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.mogo.eagle.core.data.map;
|
||||
|
||||
/**
|
||||
* poi信息封装
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class PoiWrapper {
|
||||
private int id;
|
||||
private String poiType;
|
||||
private int iconRes;
|
||||
private int iconInfoRes;
|
||||
private String iconUrl = "";
|
||||
// "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/VN000012.jpg";
|
||||
private String iconInfoUrl = "";
|
||||
// "http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1596705960869.png";
|
||||
private String title = "拥堵";
|
||||
|
||||
public PoiWrapper(){
|
||||
|
||||
}
|
||||
|
||||
public PoiWrapper(String poiType, int iconRes, int iconInfoRes, String title) {
|
||||
this.poiType = poiType;
|
||||
this.iconRes = iconRes;
|
||||
this.iconInfoRes = iconInfoRes;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public int getIconRes() {
|
||||
return iconRes;
|
||||
}
|
||||
|
||||
public void setIconRes(int iconRes) {
|
||||
this.iconRes = iconRes;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int getIconInfoRes() {
|
||||
return iconInfoRes;
|
||||
}
|
||||
|
||||
public void setIconInfoRes(int iconInfoRes) {
|
||||
this.iconInfoRes = iconInfoRes;
|
||||
}
|
||||
|
||||
public String getIconInfoUrl() {
|
||||
return iconInfoUrl;
|
||||
}
|
||||
|
||||
public void setIconInfoUrl(String iconInfoUrl) {
|
||||
this.iconInfoUrl = iconInfoUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PoiWrapper{" +
|
||||
"poiType='" + poiType + '\'' +
|
||||
", iconRes=" + iconRes +
|
||||
", iconInfoRes=" + iconInfoRes +
|
||||
", iconUrl='" + iconUrl + '\'' +
|
||||
", iconInfoUrl='" + iconInfoUrl + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerActivitiesScope implements Serializable {
|
||||
|
||||
private String content;
|
||||
private boolean isCheck;
|
||||
|
||||
public String getContent() {
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
return "";
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public boolean getIsCheck() {
|
||||
return isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(boolean isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerActivitiesScope{" +
|
||||
"content='" + content + '\'' +
|
||||
", isCheck=" + isCheck +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCarChat implements Serializable {
|
||||
|
||||
private String type;
|
||||
private MarkerLocation location;
|
||||
private MarkerUserInfo userInfo;
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MarkerUserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(MarkerUserInfo userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerCarChat{" +
|
||||
"location=" + location +
|
||||
", type='" + type + '\'' +
|
||||
", userInfo=" + userInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCarInfo implements Serializable {
|
||||
|
||||
private String carBrandLogoUrl;
|
||||
private String carTypeName;
|
||||
private int vehicleType;
|
||||
private CarLiveInfo carLiveInfo;
|
||||
|
||||
public String getCarBrandLogoUrl() {
|
||||
if (TextUtils.isEmpty(carBrandLogoUrl)) {
|
||||
return "";
|
||||
}
|
||||
return carBrandLogoUrl;
|
||||
}
|
||||
|
||||
public void setCarBrandLogoUrl(String carBrandLogoUrl) {
|
||||
this.carBrandLogoUrl = carBrandLogoUrl;
|
||||
}
|
||||
|
||||
public String getCarTypeName() {
|
||||
if (TextUtils.isEmpty(carTypeName)) {
|
||||
return "";
|
||||
}
|
||||
return carTypeName;
|
||||
}
|
||||
|
||||
public void setCarTypeName(String carTypeName) {
|
||||
this.carTypeName = carTypeName;
|
||||
}
|
||||
|
||||
public int getVehicleType() {
|
||||
return vehicleType;
|
||||
}
|
||||
|
||||
public void setVehicleType(int vehicleType) {
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
|
||||
public CarLiveInfo getCarLiveInfo() {
|
||||
return carLiveInfo;
|
||||
}
|
||||
|
||||
public void setCarLiveInfo(CarLiveInfo carLiveInfo) {
|
||||
this.carLiveInfo = carLiveInfo;
|
||||
}
|
||||
|
||||
public static class CarLiveInfo implements Serializable {
|
||||
//rtmp视频直播地址rtmp://
|
||||
private String videoUrl;
|
||||
//直播频道【直播心跳接口参数】C_1
|
||||
private String videoChannel;
|
||||
//直播源sn【直播心跳接口参数】XTCBA90740400625
|
||||
private String videoSn;
|
||||
|
||||
public String getVideoUrl() {
|
||||
return videoUrl;
|
||||
}
|
||||
|
||||
public void setVideoUrl(String videoUrl) {
|
||||
this.videoUrl = videoUrl;
|
||||
}
|
||||
|
||||
public String getVideoChannel() {
|
||||
return videoChannel;
|
||||
}
|
||||
|
||||
public void setVideoChannel(String videoChannel) {
|
||||
this.videoChannel = videoChannel;
|
||||
}
|
||||
|
||||
public String getVideoSn() {
|
||||
return videoSn;
|
||||
}
|
||||
|
||||
public void setVideoSn(String videoSn) {
|
||||
this.videoSn = videoSn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CarLiveInfo{" +
|
||||
"videoUrl='" + videoUrl + '\'' +
|
||||
", videoChannel='" + videoChannel + '\'' +
|
||||
", videoSn='" + videoSn + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerCarInfo{" +
|
||||
"carBrandLogoUrl='" + carBrandLogoUrl + '\'' +
|
||||
", carTypeName='" + carTypeName + '\'' +
|
||||
", vehicleType=" + vehicleType +
|
||||
", carLiveInfo=" + carLiveInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ihoudf on 2020-04-16.
|
||||
**/
|
||||
public class MarkerCarPois {
|
||||
|
||||
private List coordinates;
|
||||
private double angle; // 车头角度
|
||||
private String adcode;
|
||||
|
||||
public List getCoordinates() {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
public void setCoordinates(List coordinates) {
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public double getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public String getAdcode() {
|
||||
return adcode;
|
||||
}
|
||||
|
||||
public void setAdcode(String adcode) {
|
||||
this.adcode = adcode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerCarPois{" + "coordinates=" + coordinates + ", angle=" + angle + ", adcode" +
|
||||
"='" + adcode + '\'' + '}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCardResult extends BaseData {
|
||||
|
||||
private List<String> dataType; // 要查询的类型
|
||||
private List<MarkerCarChat> carChat;
|
||||
private List<MarkerShareMusic> shareMusic;
|
||||
private List<MarkerNoveltyInfo> noveltyInfo;
|
||||
|
||||
private List<MarkerOnlineCar> onlineCar;
|
||||
private List<MarkerExploreWay> exploreWay;
|
||||
private long messageTime;
|
||||
|
||||
public List<MarkerCarChat> getCarChat() {
|
||||
return carChat;
|
||||
}
|
||||
|
||||
public void setCarChat(List<MarkerCarChat> carChat) {
|
||||
this.carChat = carChat;
|
||||
}
|
||||
|
||||
public List<MarkerExploreWay> getExploreWay() {
|
||||
return exploreWay;
|
||||
}
|
||||
|
||||
public void setExploreWay(List<MarkerExploreWay> exploreWay) {
|
||||
this.exploreWay = exploreWay;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineCar> getOnlineCar() {
|
||||
return onlineCar;
|
||||
}
|
||||
|
||||
public void setOnlineCar(List<MarkerOnlineCar> onlineCar) {
|
||||
this.onlineCar = onlineCar;
|
||||
}
|
||||
|
||||
public List<MarkerShareMusic> getShareMusic() {
|
||||
return shareMusic;
|
||||
}
|
||||
|
||||
public void setShareMusic(List<MarkerShareMusic> shareMusic) {
|
||||
this.shareMusic = shareMusic;
|
||||
}
|
||||
|
||||
public List<MarkerNoveltyInfo> getNoveltyInfo() {
|
||||
return noveltyInfo;
|
||||
}
|
||||
|
||||
public void setNoveltyInfo(List<MarkerNoveltyInfo> noveltyInfo) {
|
||||
this.noveltyInfo = noveltyInfo;
|
||||
}
|
||||
|
||||
public List<String> getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(List<String> dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public long getMessageTime() {
|
||||
return messageTime;
|
||||
}
|
||||
|
||||
public void setMessageTime(long messageTime) {
|
||||
this.messageTime = messageTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerDynamicData implements Serializable {
|
||||
//QQ音乐,懒人听书,乐听头条 2 为书籍听书,3 为新闻,1 为qq音乐
|
||||
private int type;
|
||||
private String mediaId;//qq音乐id,书的bookId
|
||||
//qq音乐url 懒人听书为“”
|
||||
private String mediaUrl;
|
||||
//歌曲名 ,当前播放书名,新闻标题内容
|
||||
private String mediaName;
|
||||
//演唱歌手,当前章节,新闻来源
|
||||
private String mediaSinger;
|
||||
//歌曲封面,书籍封面,新闻预览图
|
||||
private String mediaImg;
|
||||
//音乐类别,类似经典 ,流行只有qq特有
|
||||
private String mediaType;
|
||||
private int maxTime;//音频总时长
|
||||
private String bookInfo;//懒人听书json串
|
||||
//当前播放时长,可以不加,播放进度单独独立出来
|
||||
private int curTime;
|
||||
//是否是本地音频,只有qq音乐
|
||||
private boolean isLocalMedia;//本地
|
||||
//播放模式,顺序,单曲循环,随机
|
||||
private int mediaPlayMode;
|
||||
//1 播放 2 缓冲 0 暂停/停止 -1 播放错误
|
||||
private int playState;
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
|
||||
public String getMediaUrl() {
|
||||
return mediaUrl;
|
||||
}
|
||||
|
||||
public void setMediaUrl(String mediaUrl) {
|
||||
this.mediaUrl = mediaUrl;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getPlayState() {
|
||||
return playState;
|
||||
}
|
||||
|
||||
public void setPlayState(int playState) {
|
||||
this.playState = playState;
|
||||
}
|
||||
|
||||
public String getMediaName() {
|
||||
if (TextUtils.isEmpty(mediaName)) {
|
||||
return "";
|
||||
}
|
||||
return mediaName;
|
||||
}
|
||||
|
||||
public void setMediaName(String mediaName) {
|
||||
this.mediaName = mediaName;
|
||||
}
|
||||
|
||||
public String getMediaSinger() {
|
||||
if (TextUtils.isEmpty(mediaSinger)) {
|
||||
return "";
|
||||
}
|
||||
return mediaSinger;
|
||||
}
|
||||
|
||||
public void setMediaSinger(String mediaSinger) {
|
||||
this.mediaSinger = mediaSinger;
|
||||
}
|
||||
|
||||
public String getMediaImg() {
|
||||
return mediaImg;
|
||||
}
|
||||
|
||||
public void setMediaImg(String mediaImg) {
|
||||
this.mediaImg = mediaImg;
|
||||
}
|
||||
|
||||
public long getMaxTime() {
|
||||
return maxTime;
|
||||
}
|
||||
|
||||
public void setMaxTime(int maxTime) {
|
||||
this.maxTime = maxTime;
|
||||
}
|
||||
|
||||
public long getCurTime() {
|
||||
return curTime;
|
||||
}
|
||||
|
||||
public void setCurTime(int curTime) {
|
||||
this.curTime = curTime;
|
||||
}
|
||||
|
||||
public String getMediaType() {
|
||||
if (TextUtils.isEmpty(mediaType)) {
|
||||
return "";
|
||||
}
|
||||
return mediaType;
|
||||
}
|
||||
|
||||
public void setMediaType(String mediaType) {
|
||||
this.mediaType = mediaType;
|
||||
}
|
||||
|
||||
public boolean isLocalMedia() {
|
||||
return isLocalMedia;
|
||||
}
|
||||
|
||||
public void setLocalMedia(boolean localMedia) {
|
||||
isLocalMedia = localMedia;
|
||||
}
|
||||
|
||||
public int getMediaPlayMode() {
|
||||
return mediaPlayMode;
|
||||
}
|
||||
|
||||
public void setMediaPlayMode(int mediaPlayMode) {
|
||||
this.mediaPlayMode = mediaPlayMode;
|
||||
}
|
||||
|
||||
public String getBookInfo() {
|
||||
return bookInfo;
|
||||
}
|
||||
|
||||
public void setBookInfo(String bookInfo) {
|
||||
this.bookInfo = bookInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerDynamicData{" +
|
||||
"type=" + type +
|
||||
", mediaId='" + mediaId + '\'' +
|
||||
", mediaUrl='" + mediaUrl + '\'' +
|
||||
", mediaName='" + mediaName + '\'' +
|
||||
", mediaSinger='" + mediaSinger + '\'' +
|
||||
", mediaImg='" + mediaImg + '\'' +
|
||||
", mediaType='" + mediaType + '\'' +
|
||||
", maxTime=" + maxTime +
|
||||
", bookInfo='" + bookInfo + '\'' +
|
||||
", curTime=" + curTime +
|
||||
", isLocalMedia=" + isLocalMedia +
|
||||
", mediaPlayMode=" + mediaPlayMode +
|
||||
", playState=" + playState +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerExploreWay implements Serializable {
|
||||
|
||||
private String infoId;
|
||||
private String type;//卡片类型,
|
||||
private String poiType;
|
||||
private String sn;
|
||||
private MarkerLocation location;//位置信息
|
||||
private int direction;//方位角度
|
||||
private boolean canLive;//是否可直播(1为可直播,0不可直播)
|
||||
private int fileType;//是图片还是视频(1视频,0图片)
|
||||
private String addr;//北京市朝阳区三里屯街道108号
|
||||
private long generateTime;//时间戳
|
||||
private String cityName;//:"城市名称",
|
||||
private double distance;//距离
|
||||
private MarkerUserInfo userInfo;//用户信息
|
||||
private List<MarkerExploreWayItem> items;//视频地址和图片地址
|
||||
//上报类型:1-用户上报,2-后台上报 3-三方上报
|
||||
private String uploadType;
|
||||
|
||||
private boolean fabulous;
|
||||
|
||||
// http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=42321443
|
||||
// 1 需要用户判断是否拥堵 进行UGC问答
|
||||
private int infoCheckNode;
|
||||
|
||||
public Map<String, Object> extras = null;
|
||||
|
||||
public String getAddr() {
|
||||
if (TextUtils.isEmpty(addr)) {
|
||||
return "未知道路";
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
public void setAddr(String addr) {
|
||||
this.addr = addr;
|
||||
}
|
||||
|
||||
public boolean getCanLive() {
|
||||
return canLive;
|
||||
}
|
||||
|
||||
public void setCanLive(boolean canLive) {
|
||||
this.canLive = canLive;
|
||||
}
|
||||
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
}
|
||||
|
||||
public void setCityName(String cityName) {
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
public float getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(int direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public double getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(double distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public double getFileType() {
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public void setFileType(int fileType) {
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
public Long getGenerateTime() {
|
||||
return generateTime;
|
||||
}
|
||||
|
||||
public void setGenerateTime(Long generateTime) {
|
||||
this.generateTime = generateTime;
|
||||
}
|
||||
|
||||
public List<MarkerExploreWayItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<MarkerExploreWayItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MarkerUserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(MarkerUserInfo userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
|
||||
public int getInfoIdInt() {
|
||||
try {
|
||||
return Integer.parseInt(infoId);
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void setInfoId(String infoId) {
|
||||
this.infoId = infoId;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public String getUploadType() {
|
||||
return uploadType;
|
||||
}
|
||||
|
||||
public void setUploadType(String uploadType) {
|
||||
this.uploadType = uploadType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
MarkerExploreWay that = (MarkerExploreWay) o;
|
||||
return Objects.equals(infoId, that.infoId) &&
|
||||
Objects.equals(type, that.type) &&
|
||||
Objects.equals(poiType, that.poiType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(infoId, type, poiType);
|
||||
}
|
||||
|
||||
public boolean isCanLive() {
|
||||
return canLive;
|
||||
}
|
||||
|
||||
public void setGenerateTime(long generateTime) {
|
||||
this.generateTime = generateTime;
|
||||
}
|
||||
|
||||
public int getInfoCheckNode() {
|
||||
return infoCheckNode;
|
||||
}
|
||||
|
||||
public void setInfoCheckNode(int infoCheckNode) {
|
||||
this.infoCheckNode = infoCheckNode;
|
||||
}
|
||||
|
||||
public boolean isFabulous() {
|
||||
return fabulous;
|
||||
}
|
||||
|
||||
public void setFabulous(boolean fabulous) {
|
||||
this.fabulous = fabulous;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerExploreWay{" +
|
||||
"infoId='" + infoId + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
", poiType='" + poiType + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", location=" + location +
|
||||
", direction=" + direction +
|
||||
", canLive=" + canLive +
|
||||
", fileType=" + fileType +
|
||||
", addr='" + addr + '\'' +
|
||||
", generateTime=" + generateTime +
|
||||
", cityName='" + cityName + '\'' +
|
||||
", distance=" + distance +
|
||||
", userInfo=" + userInfo +
|
||||
", items=" + items +
|
||||
", uploadType='" + uploadType + '\'' +
|
||||
", fabulous=" + fabulous +
|
||||
", infoCheckNode=" + infoCheckNode +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 道路情报,V2X预警,地图道路事件POI,违章停车POI等
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerExploreWayItem implements Serializable {
|
||||
|
||||
private String thumbnail;
|
||||
private String url;
|
||||
private String content;
|
||||
private double illegalCount;
|
||||
|
||||
public String getThumbnail() {
|
||||
if (TextUtils.isEmpty(thumbnail)) {
|
||||
return "";
|
||||
}
|
||||
return thumbnail;
|
||||
}
|
||||
|
||||
public void setThumbnail(String thumbnail) {
|
||||
this.thumbnail = thumbnail;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
return "";
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public double getIllegalCount() {
|
||||
return illegalCount;
|
||||
}
|
||||
|
||||
public void setIllegalCount(double illegalCount) {
|
||||
this.illegalCount = illegalCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerExploreWayItem{" +
|
||||
"thumbnail='" + thumbnail + '\'' +
|
||||
", url='" + url + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", illegalCount='" + illegalCount + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-1615:12
|
||||
* desc : 爱好
|
||||
* version: 1.0
|
||||
*/
|
||||
public class MarkerHobbyDatum implements Serializable {
|
||||
private List<MarkerOnlineTag> singerTop2; // 最喜欢的两位歌手
|
||||
private List<MarkerOnlineTag> songTypeTop2; // 最喜欢的两种音乐类型
|
||||
private List<MarkerOnlineTag> newsType; // 最喜欢的资讯类型
|
||||
private List<MarkerOnlineTag> listenBookTop2; // 最喜欢听的两本书
|
||||
private List<MarkerOnlineTag> ifSociety; // 是否喜爱社交
|
||||
|
||||
|
||||
public List<MarkerOnlineTag> getSingerTop2() {
|
||||
return singerTop2;
|
||||
}
|
||||
|
||||
public void setSingerTop2(List<MarkerOnlineTag> singerTop2) {
|
||||
this.singerTop2 = singerTop2;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getSongTypeTop2() {
|
||||
return songTypeTop2;
|
||||
}
|
||||
|
||||
public void setSongTypeTop2(List<MarkerOnlineTag> songTypeTop2) {
|
||||
this.songTypeTop2 = songTypeTop2;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getNewsType() {
|
||||
return newsType;
|
||||
}
|
||||
|
||||
public void setNewsType(List<MarkerOnlineTag> newsType) {
|
||||
this.newsType = newsType;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getListenBookTop2() {
|
||||
return listenBookTop2;
|
||||
}
|
||||
|
||||
public void setListenBookTop2(List<MarkerOnlineTag> listenBookTop2) {
|
||||
this.listenBookTop2 = listenBookTop2;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getIfSociety() {
|
||||
return ifSociety;
|
||||
}
|
||||
|
||||
public void setIfSociety(List<MarkerOnlineTag> ifSociety) {
|
||||
this.ifSociety = ifSociety;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerHobbyDatum{" +
|
||||
"singerTop2=" + singerTop2 +
|
||||
", songTypeTop2=" + songTypeTop2 +
|
||||
", newsType=" + newsType +
|
||||
", listenBookTop2=" + listenBookTop2 +
|
||||
", ifSociety=" + ifSociety +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerLocation implements Serializable {
|
||||
|
||||
private double lat;//纬度
|
||||
private double lon;//经度
|
||||
private double angle;//车头角度,可以没有
|
||||
private String address;//具体的位置信息
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
if (TextUtils.isEmpty(address)) {
|
||||
return "";
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerLocation{" +
|
||||
"lat=" + lat +
|
||||
", lon=" + lon +
|
||||
", angle=" + angle +
|
||||
", address='" + address + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
/**
|
||||
* 新鲜事儿Marker数据
|
||||
*/
|
||||
public class MarkerNoveltyInfo {
|
||||
private String type;
|
||||
private String sn;
|
||||
private MarkerLocation location;
|
||||
private String poiType;
|
||||
private ContentData contentData;
|
||||
|
||||
public ContentData getContentData() {
|
||||
return contentData;
|
||||
}
|
||||
|
||||
public void setContentData(ContentData contentData) {
|
||||
this.contentData = contentData;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public static class ContentData {
|
||||
private String content;
|
||||
private String iconUrl;
|
||||
private String imgUrl;
|
||||
private String infoId;
|
||||
private long likeNum;
|
||||
private String title;
|
||||
private String gasPrices;
|
||||
private boolean displayNavigation;
|
||||
private boolean desplayHost;
|
||||
private boolean fabulous;
|
||||
private String styleType;
|
||||
//上报类型:1-用户上报,2-后台上报 3-三方上报
|
||||
private String uploadType;
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
public void setInfoId(String infoId) {
|
||||
this.infoId = infoId;
|
||||
}
|
||||
|
||||
public long getLikeNum() {
|
||||
return likeNum;
|
||||
}
|
||||
|
||||
public void setLikeNum(long likeNum) {
|
||||
this.likeNum = likeNum;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public boolean isDisplayNavigation() {
|
||||
return displayNavigation;
|
||||
}
|
||||
|
||||
public void setDisplayNavigation(boolean displayNavigation) {
|
||||
this.displayNavigation = displayNavigation;
|
||||
}
|
||||
|
||||
public String getStyleType() {
|
||||
return styleType;
|
||||
}
|
||||
|
||||
public void setStyleType(String styleType) {
|
||||
this.styleType = styleType;
|
||||
}
|
||||
|
||||
public String getGasPrices() {
|
||||
return gasPrices;
|
||||
}
|
||||
|
||||
public void setGasPrices(String gasPrices) {
|
||||
this.gasPrices = gasPrices;
|
||||
}
|
||||
|
||||
public boolean isDesplayHost() {
|
||||
return desplayHost;
|
||||
}
|
||||
|
||||
public void setDesplayHost(boolean desplayHost) {
|
||||
this.desplayHost = desplayHost;
|
||||
}
|
||||
|
||||
public boolean isFabulous() {
|
||||
return fabulous;
|
||||
}
|
||||
|
||||
public void setFabulous(boolean fabulous) {
|
||||
this.fabulous = fabulous;
|
||||
}
|
||||
|
||||
public String getUploadType() {
|
||||
return uploadType;
|
||||
}
|
||||
|
||||
public void setUploadType(String uploadType) {
|
||||
this.uploadType = uploadType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContentData{" +
|
||||
"content='" + content + '\'' +
|
||||
", iconUrl='" + iconUrl + '\'' +
|
||||
", imgUrl='" + imgUrl + '\'' +
|
||||
", infoId='" + infoId + '\'' +
|
||||
", likeNum=" + likeNum +
|
||||
", title='" + title + '\'' +
|
||||
", gasPrices='" + gasPrices + '\'' +
|
||||
", displayNavigation=" + displayNavigation +
|
||||
", desplayHost=" + desplayHost +
|
||||
", fabulous=" + fabulous +
|
||||
", styleType='" + styleType + '\'' +
|
||||
", uploadType='" + uploadType + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerNoveltyInfo{" +
|
||||
"type='" + type + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", location=" + location +
|
||||
", poiType='" + poiType + '\'' +
|
||||
", contentData=" + contentData +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MarkerOnlineCar implements Serializable {
|
||||
|
||||
private String type;//卡片类型
|
||||
private MarkerLocation location;//所在位置
|
||||
private Boolean isFocus;//isFocus":"0-未关注,1-关注
|
||||
private MarkerUserInfo userInfo;//用户数据
|
||||
private MarkerCarInfo carInfo;//车辆数据
|
||||
private List<MarkerCarPois> pois;//车辆路线
|
||||
private MarkerDynamicData dynamicData;//动态数据
|
||||
private MarkerHobbyDatum hobbyData;//爱好数据集合
|
||||
private List<MarkerActivitiesScope> activitiesScope;//活动范围数据集合
|
||||
private int compatibility;//匹配度
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public Boolean getFocus() {
|
||||
return isFocus;
|
||||
}
|
||||
|
||||
public void setFocus(Boolean focus) {
|
||||
isFocus = focus;
|
||||
}
|
||||
|
||||
public MarkerUserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(MarkerUserInfo userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
public MarkerCarInfo getCarInfo() {
|
||||
return carInfo;
|
||||
}
|
||||
|
||||
public void setCarInfo(MarkerCarInfo carInfo) {
|
||||
this.carInfo = carInfo;
|
||||
}
|
||||
|
||||
public List<MarkerCarPois> getPois() {
|
||||
return pois;
|
||||
}
|
||||
|
||||
public void setPois(List<MarkerCarPois> pois) {
|
||||
this.pois = pois;
|
||||
}
|
||||
|
||||
public MarkerDynamicData getDynamicData() {
|
||||
return dynamicData;
|
||||
}
|
||||
|
||||
public void setDynamicData(MarkerDynamicData dynamicData) {
|
||||
this.dynamicData = dynamicData;
|
||||
}
|
||||
|
||||
public MarkerHobbyDatum getHobbyData() {
|
||||
return hobbyData;
|
||||
}
|
||||
|
||||
public void setHobbyData(MarkerHobbyDatum hobbyData) {
|
||||
this.hobbyData = hobbyData;
|
||||
}
|
||||
|
||||
public List<MarkerActivitiesScope> getActivitiesScope() {
|
||||
return activitiesScope;
|
||||
}
|
||||
|
||||
public void setActivitiesScope(List<MarkerActivitiesScope> activitiesScope) {
|
||||
this.activitiesScope = activitiesScope;
|
||||
}
|
||||
|
||||
public int getCompatibility() {
|
||||
return compatibility;
|
||||
}
|
||||
|
||||
public void setCompatibility(int compatibility) {
|
||||
this.compatibility = compatibility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerOnlineCar{" + "type='" + type + '\'' + ", location=" + location + ", " +
|
||||
"isFocus=" + isFocus + ", userInfo=" + userInfo + ", carInfo=" + carInfo + ", " + "pois=" + pois + ", dynamicData=" + dynamicData + ", hobbyData=" + hobbyData + "," + " activitiesScope=" + activitiesScope + ", compatibility=" + compatibility + '}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerOnlineTag implements Serializable {
|
||||
|
||||
private String content;
|
||||
private boolean isCheck;
|
||||
|
||||
public String getContent() {
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
return "";
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public boolean getIsCheck() {
|
||||
return isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(boolean isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerHobbyDatum{" +
|
||||
"content='" + content + '\'' +
|
||||
", isCheck=" + isCheck +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerResponse extends BaseData implements Serializable {
|
||||
|
||||
// private int code;
|
||||
// private String msg;
|
||||
private MarkerCardResult result;
|
||||
private String sign;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public MarkerCardResult getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public void setResult(MarkerCardResult result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerResponse{" + "result=" + result + ", sign='" + sign + '\'' + ", code=" + code + ", msg='" + msg + '\'' + '}';
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user