[2.12.0] local code style change
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user