From daf002569f64226ad9f1bbf3905cd88f28b36cea Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 20 Dec 2021 17:11:08 +0800 Subject: [PATCH] =?UTF-8?q?[Delete]=20=E5=88=A0=E9=99=A4mogo-module-widget?= =?UTF-8?q?s=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- app/build.gradle | 2 - .../mogo-core-function-main/build.gradle | 2 - .../function/main/MainMoGoApplication.java | 1 - .../core/data/constants/MogoServicePaths.java | 7 - modules.txt | 1 - modules/mogo-module-widgets/.gitignore | 1 - modules/mogo-module-widgets/README.md | 3 - modules/mogo-module-widgets/build.gradle | 73 ----- .../mogo-module-widgets/consumer-rules.pro | 1 - modules/mogo-module-widgets/gradle.properties | 3 - .../mogo-module-widgets/proguard-rules.pro | 21 -- .../src/main/AndroidManifest.xml | 4 - .../module/widgets/AutoNaviIntentHandler.java | 272 ------------------ .../mogo/module/widgets/MogoWidgetManger.java | 108 ------- .../module/widgets/MogoWidgetsProvider.java | 97 ------- ...module_widgets_app_entrance_root_bkg.9.png | Bin 711 -> 0 bytes .../module_widgets_app_handler_close.png | Bin 372 -> 0 bytes .../module_widgets_app_handler_open.png | Bin 360 -> 0 bytes ...module_widgets_app_entrance_root_bkg.9.png | Bin 711 -> 0 bytes .../module_widgets_app_handler_close.png | Bin 372 -> 0 bytes .../module_widgets_app_handler_open.png | Bin 360 -> 0 bytes ...module_widgets_app_entrance_root_bkg.9.png | Bin 1373 -> 0 bytes .../module_widgets_app_handler_close.png | Bin 577 -> 0 bytes .../module_widgets_app_handler_open.png | Bin 564 -> 0 bytes .../drawable/module_widgets_app_body_bkg.xml | 9 - ...module_widgets_app_entrance_root_bkg.9.png | Bin 711 -> 0 bytes .../module_widgets_app_handler_bkg.xml | 9 - .../layout/module_widgets_app_entrance.xml | 66 ----- .../src/main/res/values-ldpi/dimens.xml | 15 - .../src/main/res/values-mdpi/dimens.xml | 15 - .../res/values-xhdpi-1920x1000/dimens.xml | 15 - .../src/main/res/values-xhdpi/dimens.xml | 15 - .../src/main/res/values/colors.xml | 4 - .../src/main/res/values/dimens.xml | 15 - .../src/main/res/values/strings.xml | 7 - settings.gradle | 1 - 36 files changed, 767 deletions(-) delete mode 100644 modules/mogo-module-widgets/.gitignore delete mode 100644 modules/mogo-module-widgets/README.md delete mode 100644 modules/mogo-module-widgets/build.gradle delete mode 100644 modules/mogo-module-widgets/consumer-rules.pro delete mode 100644 modules/mogo-module-widgets/gradle.properties delete mode 100644 modules/mogo-module-widgets/proguard-rules.pro delete mode 100644 modules/mogo-module-widgets/src/main/AndroidManifest.xml delete mode 100644 modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java delete mode 100644 modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java delete mode 100644 modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetsProvider.java delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-ldpi/module_widgets_app_entrance_root_bkg.9.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-ldpi/module_widgets_app_handler_close.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-ldpi/module_widgets_app_handler_open.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-mdpi/module_widgets_app_entrance_root_bkg.9.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-mdpi/module_widgets_app_handler_close.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-mdpi/module_widgets_app_handler_open.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-xhdpi/module_widgets_app_entrance_root_bkg.9.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-xhdpi/module_widgets_app_handler_close.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable-xhdpi/module_widgets_app_handler_open.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable/module_widgets_app_body_bkg.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable/module_widgets_app_entrance_root_bkg.9.png delete mode 100644 modules/mogo-module-widgets/src/main/res/drawable/module_widgets_app_handler_bkg.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/layout/module_widgets_app_entrance.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/values-ldpi/dimens.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/values-mdpi/dimens.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/values-xhdpi-1920x1000/dimens.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/values-xhdpi/dimens.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/values/colors.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/values/dimens.xml delete mode 100644 modules/mogo-module-widgets/src/main/res/values/strings.xml diff --git a/app/build.gradle b/app/build.gradle index c2352502f5..be86273e76 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -202,7 +202,6 @@ dependencies { implementation rootProject.ext.dependencies.mogomonitor implementation rootProject.ext.dependencies.moduleextensions implementation rootProject.ext.dependencies.modulemap - implementation rootProject.ext.dependencies.mogomodulewidgets implementation rootProject.ext.dependencies.moduleADAS implementation rootProject.ext.dependencies.modulepushbase implementation rootProject.ext.dependencies.modulepush @@ -234,7 +233,6 @@ dependencies { implementation project(':modules:mogo-module-monitor') implementation project(':modules:mogo-module-extensions') implementation project(':modules:mogo-module-map') - implementation project(':modules:mogo-module-widgets') implementation project(':modules:mogo-module-adas') implementation project(":modules:mogo-module-push-base") implementation project(":modules:mogo-module-push") diff --git a/core/function-impl/mogo-core-function-main/build.gradle b/core/function-impl/mogo-core-function-main/build.gradle index fb91558dd4..e7c2452f2c 100644 --- a/core/function-impl/mogo-core-function-main/build.gradle +++ b/core/function-impl/mogo-core-function-main/build.gradle @@ -73,7 +73,6 @@ dependencies { implementation rootProject.ext.dependencies.mogomonitor implementation rootProject.ext.dependencies.moduleextensions implementation rootProject.ext.dependencies.modulemap - implementation rootProject.ext.dependencies.mogomodulewidgets implementation rootProject.ext.dependencies.moduleADAS implementation rootProject.ext.dependencies.modulepushbase implementation rootProject.ext.dependencies.modulepush @@ -108,7 +107,6 @@ dependencies { implementation project(':modules:mogo-module-monitor') implementation project(':modules:mogo-module-extensions') implementation project(':modules:mogo-module-map') - implementation project(':modules:mogo-module-widgets') implementation project(':modules:mogo-module-adas') implementation project(":modules:mogo-module-push-base") implementation project(":modules:mogo-module-push") diff --git a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index efb87fe80e..9daf262336 100644 --- a/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-main/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -283,7 +283,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { MogoModulePaths.addBaseModule(new MogoModule(UpgradeReportConstants.PATH, UpgradeReportConstants.NAME)); // 初始化 bugly 日志采集 //MogoModulePaths.addBaseModule(new MogoModule(CrashReportConstants.PATH, CrashReportConstants.NAME)); - MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS)); if (DebugConfig.isMapBased()) { MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME)); } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java index ddd9a60030..27db0a7849 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java @@ -271,13 +271,6 @@ public class MogoServicePaths { @Deprecated public static final String PATH_CRASH_WARNING = "/crash/warning"; - /** - * 悬浮小控件 - */ - @Keep - @Deprecated - public static final String PATH_WIDGETS = "/widgets/provider"; - /** * 在线好友面板 */ diff --git a/modules.txt b/modules.txt index 4075dd2434..671cae1a82 100644 --- a/modules.txt +++ b/modules.txt @@ -42,7 +42,6 @@ :modules:mogo-module-push :modules:tanlulib :modules:mogo-module-monitor -:modules:mogo-module-widgets :core:function-impl:mogo-core-function-autopilot :core:function-impl:mogo-core-function-hmi :core:function-impl:mogo-core-function-map diff --git a/modules/mogo-module-widgets/.gitignore b/modules/mogo-module-widgets/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/modules/mogo-module-widgets/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/modules/mogo-module-widgets/README.md b/modules/mogo-module-widgets/README.md deleted file mode 100644 index 837a8c3cec..0000000000 --- a/modules/mogo-module-widgets/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# 项目介绍 - -一些独立于其他业务的悬浮小控件 diff --git a/modules/mogo-module-widgets/build.gradle b/modules/mogo-module-widgets/build.gradle deleted file mode 100644 index 23d8483f05..0000000000 --- a/modules/mogo-module-widgets/build.gradle +++ /dev/null @@ -1,73 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-android-extensions' - id 'kotlin-kapt' - id 'com.alibaba.arouter' -} - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - // buildToolsVersion rootProject.ext.android.buildToolsVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - - //ARouter apt 参数 - kapt { - useBuildCache = false - arguments { - arg("AROUTER_MODULE_NAME", project.getName()) - } - } - } - - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - implementation rootProject.ext.dependencies.androidxappcompat - implementation rootProject.ext.dependencies.androidxconstraintlayout - - implementation rootProject.ext.dependencies.arouter - kapt rootProject.ext.dependencies.aroutercompiler - - implementation rootProject.ext.dependencies.rxjava - implementation rootProject.ext.dependencies.rxandroid - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - api rootProject.ext.dependencies.mogomapapi - api rootProject.ext.dependencies.mogoutils - api rootProject.ext.dependencies.mogocommons - api rootProject.ext.dependencies.mogoserviceapi - implementation rootProject.ext.dependencies.modulecommon - } else { - api project(":libraries:mogo-map-api") - api project(":foudations:mogo-utils") - api project(":foudations:mogo-commons") - api project(':services:mogo-service-api') - implementation project(':modules:mogo-module-common') - } -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/modules/mogo-module-widgets/consumer-rules.pro b/modules/mogo-module-widgets/consumer-rules.pro deleted file mode 100644 index 8e56b33abb..0000000000 --- a/modules/mogo-module-widgets/consumer-rules.pro +++ /dev/null @@ -1 +0,0 @@ --keep class com.mogo.module.widgets.MogoWidgetsProvider{*;} \ No newline at end of file diff --git a/modules/mogo-module-widgets/gradle.properties b/modules/mogo-module-widgets/gradle.properties deleted file mode 100644 index 0d62fa48dd..0000000000 --- a/modules/mogo-module-widgets/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.module -POM_ARTIFACT_ID=module-widgets -VERSION_CODE=1 diff --git a/modules/mogo-module-widgets/proguard-rules.pro b/modules/mogo-module-widgets/proguard-rules.pro deleted file mode 100644 index 481bb43481..0000000000 --- a/modules/mogo-module-widgets/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/AndroidManifest.xml b/modules/mogo-module-widgets/src/main/AndroidManifest.xml deleted file mode 100644 index fb0d21444c..0000000000 --- a/modules/mogo-module-widgets/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java b/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java deleted file mode 100644 index f71f5cbc0c..0000000000 --- a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java +++ /dev/null @@ -1,272 +0,0 @@ -package com.mogo.module.widgets; - -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.text.TextUtils; -import android.view.Gravity; -import android.view.View; -import android.view.WindowManager; -import android.widget.ImageView; -import android.widget.TextView; - -import com.elegant.utils.ResourcesHelper; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.commons.debug.DebugConfig; -import com.mogo.commons.storage.SpStorage; -import com.mogo.commons.voice.AIAssist; -import com.mogo.commons.voice.IMogoVoiceCmdCallBack; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.wm.WindowManagerView; -import com.mogo.utils.CommonUtils; -import com.mogo.utils.LaunchUtils; -import com.mogo.utils.UiThreadHandler; -import com.mogo.utils.logger.Logger; - -import java.util.HashMap; -import java.util.Map; -/** - * @author congtaowang - * @since 2020/6/5 - *

- * 描述 - */ -public class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack { - - private static final String TAG = "AutoNaviIntentHandler"; - public static final String OPEN = "OPEN_APP"; - - // 显示浮窗时,同步状态时间间隔 - public static final long SYNC_INTERVAL = 60_000L; - - private static volatile AutoNaviIntentHandler sInstance; - - private AutoNaviIntentHandler() { - } - - public static AutoNaviIntentHandler getInstance() { - if ( sInstance == null ) { - synchronized ( AutoNaviIntentHandler.class ) { - if ( sInstance == null ) { - sInstance = new AutoNaviIntentHandler(); - } - } - } - return sInstance; - } - - private WindowManagerView mWindowManagerView; - private Map< String, Object > mProperties = new HashMap<>(); - - private TextView mEnterApp; - private TextView mConsult; - private View mHandler; - private ImageView mHandlerIcon; - - private boolean mLargeStyle = true; - - public synchronized void release() { - sInstance = null; - } - - private Runnable mAutoNaviSyncRunnable = () -> { - if ( mWindowManagerView != null && mWindowManagerView.isShowing() ) { - syncAutoNaviForgroundStatus( AbsMogoApplication.getApp() ); - } - }; - - public void handle( Context context, Intent intent ) { - int keyType = intent.getIntExtra( "KEY_TYPE", 0 ); - switch ( keyType ) { - case 10021: - closeEntrance(); - break; - case 10019: - int extraState = intent.getIntExtra( "EXTRA_STATE", -1 ); - switch ( extraState ) { - case 3: // 前台 - syncAutoNaviNavingStatus( context ); - break; - case 9: // 非导航 - SpStorage.setNavigationTarget( "" ); - case 4: // 后台 - closeEntrance(); - break; - case 8: // 导航 - showEntrance( context ); - break; - } - break; - } - } - - /** - * 通过查询高德地图状态后再显示 - * - * @param context - */ - public void preShowEntrance( Context context ) { - syncAutoNaviForgroundStatus( context ); - } - - private void showEntrance( Context context ) { - - if ( mWindowManagerView == null ) { - mWindowManagerView = new WindowManagerView.Builder( AbsMogoApplication.getApp() ) - .contentView( R.layout.module_widgets_app_entrance ) - .size( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT ) - .gravity( Gravity.LEFT | Gravity.TOP ) - .position( ResourcesHelper.getDimensionPixelSize( context, R.dimen.module_widgets_app_entrance_x ), ResourcesHelper.getDimensionPixelSize( AbsMogoApplication.getApp(), R.dimen.module_widgets_app_entrance_y ) ) - .showInWindowManager(); - mWindowManagerView.attachTouchEvent( ( view, xPos, yPos ) -> { - chooseAction( view, xPos, yPos ); - } ); - mEnterApp = mWindowManagerView.findViewById( R.id.module_widgets_app_entrance ); - mConsult = mWindowManagerView.findViewById( R.id.module_widgets_app_consult ); - mHandler = mWindowManagerView.findViewById( R.id.module_widgets_app_handler_container ); - mHandlerIcon = mWindowManagerView.findViewById( R.id.module_widgets_app_handler ); - } - try { - if ( mWindowManagerView.isShowing() ) { - return; - } - if ( MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .isMainPageOnResume() ) { - return; - } - mWindowManagerView.show(); - MogoWidgetManger.getInstance().getApis().getAnalyticsApi().track( "NAVI_button_show", null ); - AIAssist.getInstance( context ).registerUnWakeupCommand( OPEN, new String[]{"切换到辅助驾驶模式"}, this ); - UiThreadHandler.postDelayed( mAutoNaviSyncRunnable, SYNC_INTERVAL ); - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - - private void chooseAction( View root, float xPos, float yPos ) { - if ( isInViewArea( root, mEnterApp, xPos, yPos ) ) { - enterApp( root.getContext() ); - } else if ( isInViewArea( root, mHandler, xPos, yPos ) ) { - handleStyle( mHandler.getContext() ); - } else if ( isInViewArea( root, mConsult, xPos, yPos ) ) { - consultUser( root.getContext() ); - } - } - - private boolean isInViewArea( View root, View target, float xPos, float yPos ) { - int loc[] = new int[2]; - root.getLocationOnScreen( loc ); - int rootX = loc[0]; - int rootY = loc[1]; - - target.getLocationOnScreen( loc ); - int targetX = loc[0]; - int targetY = loc[1]; - int targetWidth = target.getMeasuredWidth(); - int targetHeight = target.getMeasuredHeight(); - - if ( xPos + rootX >= targetX - && xPos + rootX <= targetX + targetWidth - && yPos + rootY >= targetY - && yPos + rootY <= targetY + targetHeight ) { - return true; - } - return false; - } - - /** - * 目的地车友 - * - * @param context - */ - private void consultUser( Context context ) { - mProperties.clear(); - mProperties.put( "appname", CommonUtils.getAppName( context ) ); - mProperties.put( "appversion", CommonUtils.getVersionName( context ) ); - mProperties.put( "from", 9 ); - mProperties.put( "type", "consult" ); - MogoWidgetManger.getInstance().getApis().getAnalyticsApi().track( "appenterfront", mProperties ); - if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageOnResume() ) { - MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().showPanel(); - } else { - Intent start = new Intent( Intent.ACTION_VIEW ); - start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK ); - start.setData( Uri.parse( "mogo://launcher/main/switch2?type=showOnlineCarPanel" ) ); - context.startActivity( start ); - } - } - - private void handleStyle( Context context ) { - if ( mLargeStyle ) { - mEnterApp.setText( R.string.module_widgets_app_entrance_short ); - mConsult.setText( R.string.module_widgets_app_consult_short ); - mLargeStyle = false; - mHandlerIcon.setImageResource( R.drawable.module_widgets_app_handler_open ); - } else { - mEnterApp.setText( R.string.module_widgets_app_entrance_text ); - mConsult.setText( R.string.module_widgets_app_entrance_consult ); - mLargeStyle = true; - mHandlerIcon.setImageResource( R.drawable.module_widgets_app_handler_close ); - } - } - - /** - * 进入app - * - * @param context - */ - private void enterApp( Context context ) { - try { - if ( !DebugConfig.isLauncher() ) { - LaunchUtils.launchByPkg( context, "com.mogo.launcher.app" ); - } - mProperties.clear(); - mProperties.put( "appname", CommonUtils.getAppName( context ) ); - mProperties.put( "appversion", CommonUtils.getVersionName( context ) ); - mProperties.put( "from", 9 ); - MogoWidgetManger.getInstance().getApis().getAnalyticsApi().track( "appenterfront", mProperties ); - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - - public void closeEntrance() { - UiThreadHandler.removeCallbacks( mAutoNaviSyncRunnable ); - if ( mWindowManagerView == null ) { - return; - } - try { - mWindowManagerView.dismiss(); - AIAssist.getInstance( AbsMogoApplication.getApp() ).unregisterUnWakeupCommand( OPEN, this ); - } catch ( Exception e ) { - Logger.e( TAG, e, "error." ); - } - } - - public void syncAutoNaviForgroundStatus( Context context ) { - Intent intent = new Intent(); - intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" ); - intent.putExtra( "KEY_TYPE", 12404 ); - intent.putExtra( "EXTRA_REQUEST_AUTO_STATE", 0 ); - context.sendBroadcast( intent ); - } - - public void syncAutoNaviNavingStatus( Context context ) { - Intent intent = new Intent(); - intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" ); - intent.putExtra( "KEY_TYPE", 12404 ); - intent.putExtra( "EXTRA_REQUEST_AUTO_STATE", 1 ); - context.sendBroadcast( intent ); - } - - @Override - public void onCmdSelected( String cmd ) { - if ( TextUtils.equals( OPEN, cmd ) ) { - Logger.d( TAG, "recognized open command." ); - enterApp( AbsMogoApplication.getApp() ); - } - } -} - diff --git a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java b/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java deleted file mode 100644 index e98df71c77..0000000000 --- a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.mogo.module.widgets; - -import android.content.Context; -import android.content.Intent; - -import com.mogo.map.navi.IMogoNaviListener2; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.service.IMogoServiceApis; -import com.mogo.service.intent.IMogoIntentListener; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; -import com.mogo.utils.UiThreadHandler; -/** - * @author congtaowang - * @since 2020/8/12 - * - * 描述 - */ -public class MogoWidgetManger implements IMogoNaviListener2, IMogoIntentListener, IMogoStatusChangedListener { - // 接受其他app发给高德的广播 - public static final String ACTION_AUTO_NAVI_RECEIVER = "AUTONAVI_STANDARD_BROADCAST_RECV"; - // 接受高德发过来的广播 - public static final String ACTION_AUTO_NAVI_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND"; - - private static final String TAG = "MogoWidgetManger"; - - private static volatile MogoWidgetManger sInstance; - - private MogoWidgetManger() { - } - - public static MogoWidgetManger getInstance() { - if ( sInstance == null ) { - synchronized ( MogoWidgetManger.class ) { - if ( sInstance == null ) { - sInstance = new MogoWidgetManger(); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - private Object readResolve() { - // 阻止反序列化,必须实现 Serializable 接口 - return sInstance; - } - - private IMogoServiceApis mApis; - private Context mContext; - - public IMogoServiceApis getApis() { - return mApis; - } - - public void init( Context context ) { - mContext = context; - mApis = MogoApisHandler.getInstance().getApis(); - initMapStatusListener(); - initStatusListener(); - initIntentListener(); - UiThreadHandler.postDelayed( ()->{ - AutoNaviIntentHandler.getInstance().syncAutoNaviForgroundStatus( mContext ); - }, 1_000L ); - } - - private void initMapStatusListener() { - mApis.getRegisterCenterApi().registerMogoNaviListener( TAG, this ); - } - - private void initIntentListener() { - mApis.getIntentManagerApi().registerIntentListener( ACTION_AUTO_NAVI_RECEIVER, this ); - mApis.getIntentManagerApi().registerIntentListener( ACTION_AUTO_NAVI_SEND, this ); - } - - private void initStatusListener() { - mApis.getStatusManagerApi().registerStatusChangedListener( TAG, StatusDescriptor.MAIN_PAGE_RESUME, this ); - } - - @Override - public void onStopNavi() { - AutoNaviIntentHandler.getInstance().closeEntrance(); - } - - @Override - public void onStartNavi() { - AutoNaviIntentHandler.getInstance().preShowEntrance( mContext ); - } - - @Override - public void onIntentReceived( String intentStr, Intent intent ) { - AutoNaviIntentHandler.getInstance().handle( mContext, intent ); - } - - @Override - public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) { - if ( descriptor == StatusDescriptor.MAIN_PAGE_RESUME ) { - if ( isTrue ) { - AutoNaviIntentHandler.getInstance().closeEntrance(); - } else { - AutoNaviIntentHandler.getInstance().syncAutoNaviForgroundStatus( mContext ); - } - } - } -} diff --git a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetsProvider.java b/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetsProvider.java deleted file mode 100644 index caf1a40123..0000000000 --- a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetsProvider.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.mogo.module.widgets; - -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.map.listener.IMogoMapListener; -import com.mogo.map.location.IMogoLocationListener; -import com.mogo.map.marker.IMogoMarkerClickListener; -import com.mogo.map.navi.IMogoNaviListener; -import com.mogo.service.module.IMogoModuleLifecycle; -import com.mogo.service.module.IMogoModuleProvider; -import com.mogo.service.module.ModuleType; -import com.mogo.utils.UiThreadHandler; -import com.mogo.utils.logger.Logger; -/** - * @author congtaowang - * @since 2020/8/12 - * - * 高德地图启动的时候才会用到这个模块 - */ -@Route( path = MogoWidgetsProvider.PATH ) -public class MogoWidgetsProvider implements IMogoModuleProvider { - - private static final String TAG = "MogoWidgetsProvider"; - - public static final String PATH = "/widgets/provider"; - public static final String NAME = "MogoWidgetProvider"; - - @Override - public Fragment createFragment( Context context, Bundle data ) { - return null; - } - - @Override - public View createView( Context context ) { - return null; - } - - @NonNull - @Override - public String getModuleName() { - return null; - } - - @Override - public IMogoModuleLifecycle getCardLifecycle() { - return null; - } - - @Override - public IMogoMapListener getMapListener() { - return null; - } - - @Override - public int getType() { - return ModuleType.TYPE_SERVICE; - } - - @Override - public IMogoNaviListener getNaviListener() { - return null; - } - - @Override - public IMogoLocationListener getLocationListener() { - return null; - } - - @Override - public IMogoMarkerClickListener getMarkerClickListener() { - return null; - } - - @Override - public String getAppPackage() { - return null; - } - - @Override - public String getAppName() { - return null; - } - - @Override - public void init( Context context ) { - Logger.d( TAG, "init." ); - UiThreadHandler.postDelayed( () -> { - MogoWidgetManger.getInstance().init( context ); - }, 6_000L ); - } -} diff --git a/modules/mogo-module-widgets/src/main/res/drawable-ldpi/module_widgets_app_entrance_root_bkg.9.png b/modules/mogo-module-widgets/src/main/res/drawable-ldpi/module_widgets_app_entrance_root_bkg.9.png deleted file mode 100644 index c1d5b757c4f882724c90ab58ef7b82c78da4e4e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 711 zcmeAS@N?(olHy`uVBq!ia0vp^5g^RL1|$oo8kjIJF!g!5IEGZ*dV4o9`*MKDv5zxm zZHAoAC4cK4ReyYKd8fVO`61yGNt1Vn=w|#ApEv#Vj{VhD zlf$309Q>x89T}k`mOcG-q^4r!luhTuHoS9`eY#U$9n^|9v?6_R(YU0Q2KFEtDgl zPL=u9pgeWoZ%LV(nRlBbBTs%m=MiRm^D0w$i4gN$%V34qk9$%~C&Vu2ve3D+S9$Ik z%Z|7QpPfX@xv#sZ7Wn6%O7>=2ByKVBYU7(d2Wo5k=0xZ@d|`?|k)^Xc>VZeTOZoCS zQE3WQjp>_aozT-_P8U6pKFwQT?}6!?vRK~OEl6&d&m(i1C!v8+je(iR-~ck=!@wp1 zlz*S3>Xoz5(!MGdVz{rzoc>f3Ixk zKgJZ-Gs`loZ^uiSoWHNXuW6^{xwP4AXZxdi_}dS^-u_Px$E=fc|R5%f>Q#nqv782ZnE*9=V5fue#a)T692&GFC=u@P~8KC0^v>bun zh1bp%E$)z)yf@;H#*3U3jAYM$|1C2f+m2(8rfDWl5CoT|8OQP5fG`Z-2qwHytCad+ ztq0g^sr3xSS(>J|1lj`mZ&{X)MkRr!!GbmtVr`K&5Fz$Bv-`T{_Lvey(V|CYSvGAw zSyusa)9n%K$M_=@;$MeEriYa0qap}iY>~Z$B>kXJ0$MYiD_r`uv6svdOuz=~r0xA_3QM54=q S#}4`c0000Px$B1uF+R5%f(QacWUKoDgiv7@%4Glbs6Xl-Nb3Dm*^XldygEVQt+u<`~L)^-#? z;1(vD7y`ZlX0zyONF-TicHV~>b`3*)@;o<-z3=;u5k=8ZMU5Z`c2p=iNQ4k4sUZZ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/res/drawable-xhdpi/module_widgets_app_handler_close.png b/modules/mogo-module-widgets/src/main/res/drawable-xhdpi/module_widgets_app_handler_close.png deleted file mode 100644 index 2faa623d9a04f1e54f21419fcfc295bfe690c0a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 577 zcmV-H0>1r;P)Px$`$;m5^;h& z6dGy}Cx{&WKk-J+n9XL#c7?ot9LJX`B?JaX!3lX;p<&yQ_%QlAmnE?i7eNED zlZAjxs@LmXK_b<1RFH{W6-=AHR=^7qVDl9y1qt)0(lmXdkHdZ*3rUxW-B_DLePfM&yPr*DgkNTZubZNZ`L15ycD!A zxqyXJwITCudch)ysw!9p5p>pw+j5Jz_vI5}b3h#UCkM2j3&y3XQ zsc>aM5zij@4f>TpQxGJXoYpo zv6f&RAz5W5!6rhL1ph-w1l3Oz85E08mV5Xu=~w-A5w4Qu=T68cPg&7F<-9MU_*H|B P00000NkvXXu0mjfXaoTe diff --git a/modules/mogo-module-widgets/src/main/res/drawable-xhdpi/module_widgets_app_handler_open.png b/modules/mogo-module-widgets/src/main/res/drawable-xhdpi/module_widgets_app_handler_open.png deleted file mode 100644 index cb114a6bcc05056b1b5e0fe01c60e1d1cb782651..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 564 zcmV-40?Yl0P)Px$?ny*JR7efARy$6^KoE^Bp8(O*5an|M#4+emL`6w~gv6&sRL~+S3VM1jfH*-u zB{j%3RlteIn?8$Y|h&rnvB6$rhL8!2F$)8|0kC0@bj?;qXPF z{myE&%42MY^8uNQ7!95%kq#*QGa8M~05ge#&?}1Krr+;>fy6c-NiVjC!pqafJkkf#mU0*#pUrh6(e>bS~) zN79#zfYHVANwKX7h$$qVnIfi=n5c40*?1=L5Sh0h3$Vw9FNDJQ~*90x?C=A zgW}_jp>pKdMz;flrjP^0RI%N>Ed~J~YRKIjnJS zbVOe*PUEezNbF}J+Uf~y09Q`;(6a2iPNcDRh7cmFglO!Ns_%neeSOVj!T$ - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/drawable/module_widgets_app_entrance_root_bkg.9.png b/modules/mogo-module-widgets/src/main/res/drawable/module_widgets_app_entrance_root_bkg.9.png deleted file mode 100644 index c1d5b757c4f882724c90ab58ef7b82c78da4e4e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 711 zcmeAS@N?(olHy`uVBq!ia0vp^5g^RL1|$oo8kjIJF!g!5IEGZ*dV4o9`*MKDv5zxm zZHAoAC4cK4ReyYKd8fVO`61yGNt1Vn=w|#ApEv#Vj{VhD zlf$309Q>x89T}k`mOcG-q^4r!luhTuHoS9`eY#U$9n^|9v?6_R(YU0Q2KFEtDgl zPL=u9pgeWoZ%LV(nRlBbBTs%m=MiRm^D0w$i4gN$%V34qk9$%~C&Vu2ve3D+S9$Ik z%Z|7QpPfX@xv#sZ7Wn6%O7>=2ByKVBYU7(d2Wo5k=0xZ@d|`?|k)^Xc>VZeTOZoCS zQE3WQjp>_aozT-_P8U6pKFwQT?}6!?vRK~OEl6&d&m(i1C!v8+je(iR-~ck=!@wp1 zlz*S3>Xoz5(!MGdVz{rzoc>f3Ixk zKgJZ-Gs`loZ^uiSoWHNXuW6^{xwP4AXZxdi_}dS^-u_ - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/layout/module_widgets_app_entrance.xml b/modules/mogo-module-widgets/src/main/res/layout/module_widgets_app_entrance.xml deleted file mode 100644 index 18772c4556..0000000000 --- a/modules/mogo-module-widgets/src/main/res/layout/module_widgets_app_entrance.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/values-ldpi/dimens.xml b/modules/mogo-module-widgets/src/main/res/values-ldpi/dimens.xml deleted file mode 100644 index 5bfa3a220b..0000000000 --- a/modules/mogo-module-widgets/src/main/res/values-ldpi/dimens.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 22px - 15px - 2px - 503px - 501px - 20px - 27px - 71px - 4px - 56px - 40px - 7px - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/values-mdpi/dimens.xml b/modules/mogo-module-widgets/src/main/res/values-mdpi/dimens.xml deleted file mode 100644 index 5bfa3a220b..0000000000 --- a/modules/mogo-module-widgets/src/main/res/values-mdpi/dimens.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 22px - 15px - 2px - 503px - 501px - 20px - 27px - 71px - 4px - 56px - 40px - 7px - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-widgets/src/main/res/values-xhdpi-1920x1000/dimens.xml deleted file mode 100644 index ab9b044c6c..0000000000 --- a/modules/mogo-module-widgets/src/main/res/values-xhdpi-1920x1000/dimens.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 40px - 30px - 4px - 906px - 1316px - 37px - 50px - 71px - 8px - 100px - 85px - 8px - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-widgets/src/main/res/values-xhdpi/dimens.xml deleted file mode 100644 index ab9b044c6c..0000000000 --- a/modules/mogo-module-widgets/src/main/res/values-xhdpi/dimens.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 40px - 30px - 4px - 906px - 1316px - 37px - 50px - 71px - 8px - 100px - 85px - 8px - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/values/colors.xml b/modules/mogo-module-widgets/src/main/res/values/colors.xml deleted file mode 100644 index 8184cc697b..0000000000 --- a/modules/mogo-module-widgets/src/main/res/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/values/dimens.xml b/modules/mogo-module-widgets/src/main/res/values/dimens.xml deleted file mode 100644 index 5bfa3a220b..0000000000 --- a/modules/mogo-module-widgets/src/main/res/values/dimens.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 22px - 15px - 2px - 503px - 501px - 20px - 27px - 71px - 4px - 56px - 40px - 7px - \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/res/values/strings.xml b/modules/mogo-module-widgets/src/main/res/values/strings.xml deleted file mode 100644 index 1207c6ab0b..0000000000 --- a/modules/mogo-module-widgets/src/main/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - mogo-module-service - 辅助驾驶模式 - 咨询终点车友 - - - diff --git a/settings.gradle b/settings.gradle index 3a3aaea85f..ee6b430265 100644 --- a/settings.gradle +++ b/settings.gradle @@ -55,7 +55,6 @@ include ':libraries:mogo-map' // OLD业务模块 include ':modules:tanlulib' -include ':modules:mogo-module-widgets' include ':modules:mogo-module-monitor' include ':modules:mogo-module-obu' include ':modules:mogo-module-adas'