From 90d8d50cdbd34d4243ca7f2f6ca04dd3568902e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 17 Feb 2020 17:58:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86bug=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E6=B0=94=E6=B3=A1=E4=B8=8E=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E7=9A=84=E8=81=94=E5=8A=A8=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/module/service/marker/MapMarkerManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java index e2950a5043..a4f2b866da 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java @@ -221,7 +221,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag if (alpha == 1) { try { // 使用TranslateAnimation,填写一个需要移动的目标点 - ScaleAnimation animationScale = new ScaleAnimation(0.5f, 1.2f, 0.5f, 1.2f); + ScaleAnimation animationScale = new ScaleAnimation(0.1f, 1.2f, 0.1f, 1.2f); animationScale.setDuration(500); animationScale.setFillMode(Animation.FILL_MODE_FORWARDS); @@ -233,10 +233,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag } catch (Exception e) { Logger.e(TAG, e, "error."); } - }else{ + } else { try { // 使用TranslateAnimation,填写一个需要移动的目标点 - ScaleAnimation animationScale = new ScaleAnimation(1.2f, 1f, 1.2f, 1f); + ScaleAnimation animationScale = new ScaleAnimation(1.2f, 0.9f, 1.2f, 0.9f); animationScale.setDuration(500); animationScale.setFillMode(Animation.FILL_MODE_FORWARDS); From c634f822268127e41b3bfc51701826b91150694c Mon Sep 17 00:00:00 2001 From: wangcongtao Date: Mon, 17 Feb 2020 18:26:53 +0800 Subject: [PATCH 2/3] bugfix: UI-321,UI-322 --- .idea/misc.xml | 2 +- .../module/apps/AppNavigatorFragment.java | 8 ++ .../module/apps/AppNavigatorPresenter.java | 77 +++++++++++-------- .../java/com/mogo/module/apps/AppsConst.java | 18 +++-- 4 files changed, 64 insertions(+), 41 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 707ee6e613..2dc54c489f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java index b967c5cdcc..8e6aa9988f 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java @@ -121,4 +121,12 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi getActivity().onBackPressed(); } } + + @Override + public void onDestroyView() { + super.onDestroyView(); + if ( mPresenter != null ) { + mPresenter.onDestroy( getViewLifecycleOwner() ); + } + } } diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java index b846804f48..f6aa0267d3 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java @@ -1,11 +1,22 @@ package com.mogo.module.apps; +import android.content.Intent; + import androidx.annotation.NonNull; import androidx.lifecycle.LifecycleOwner; +import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.commons.mvp.Presenter; import com.mogo.commons.voice.AIAssist; import com.mogo.commons.voice.IMogoVoiceCmdCallBack; +import com.mogo.module.apps.utils.LaunchUtils; +import com.mogo.service.MogoServicePaths; +import com.mogo.service.intent.IMogoIntentListener; +import com.mogo.service.intent.IMogoIntentManager; +import com.mogo.utils.TipToast; + +import org.json.JSONException; +import org.json.JSONObject; /** * @author congtaowang @@ -13,7 +24,9 @@ import com.mogo.commons.voice.IMogoVoiceCmdCallBack; *

* 描述 */ -public class AppNavigatorPresenter extends Presenter< AppNavigatorView > implements IMogoVoiceCmdCallBack { +public class AppNavigatorPresenter extends Presenter< AppNavigatorView > implements IMogoIntentListener { + + IMogoIntentManager mIntentManager; public AppNavigatorPresenter( AppNavigatorView view ) { super( view ); @@ -22,59 +35,55 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme @Override public void onCreate( @NonNull LifecycleOwner owner ) { super.onCreate( owner ); + mIntentManager = ( IMogoIntentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_INTENT_MANAGER ).navigation( getContext() ); } @Override public void onResume( @NonNull LifecycleOwner owner ) { super.onResume( owner ); - AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL, AppsConst.CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS, this ); - AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL, AppsConst.CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS, this ); + mIntentManager.registerIntentListener( AppsConst.COMMAND_OPERATION, this ); } @Override public void onPause( @NonNull LifecycleOwner owner ) { super.onPause( owner ); - AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL ); - AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL ); + mIntentManager.unregisterIntentListener( AppsConst.COMMAND_OPERATION ); } @Override - public void onCmdSelected( String cmd ) { - if ( mView == null ) { + public void onIntentReceived( String intentStr, Intent intent ) { + if ( !AppsConst.COMMAND_OPERATION.equals( intentStr ) ) { return; } - switch ( cmd ) { - case AppsConst.CMD_OPEN_APPS_PANEL: - mView.openAppsPanel(); - break; - case AppsConst.CMD_CLOSE_APPS_PANEL: - mView.closeAppsPanel(); - break; + try { + JSONObject object = new JSONObject( intent.getStringExtra( "data" ) ); + String app = object.optString( "object" ); + String operation = object.optString( "operation" ); + if ( AppsConst.OBJECT_ALL_APPS.equals( app ) ) { + if ( AppsConst.OPERATION_OPEN.equals( operation ) ) { + mView.openAppsPanel(); + } else if ( AppsConst.OPERATION_CLOSE.equals( operation ) ) { + mView.closeAppsPanel(); + } + } else if ( AppsConst.OBJECT_FAST_SETTINGS.equals( app ) ) { + if ( AppsConst.OPERATION_OPEN.equals( operation ) ) { + try { + LaunchUtils.launchByPkg( getContext(), AppsConst.APP_PKG_CAR_SETTINGS ); + } catch ( Exception e ) { + TipToast.shortTip( R.string.module_apps_str_no_app ); + } + } + } + } catch ( JSONException e ) { + e.printStackTrace(); } } - @Override - public void onCmdAction( String speakText ) { - - } - - @Override - public void onCmdCancel( String speakText ) { - - } - - @Override - public void onSpeakEnd( String speakText ) { - - } - - @Override - public void onSpeakSelectTimeOut( String speakText ) { - - } - @Override public void onDestroy( @NonNull LifecycleOwner owner ) { + if ( mIntentManager != null ) { + mIntentManager.unregisterIntentListener( AppsConst.COMMAND_OPERATION ); + } super.onDestroy( owner ); } } diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java index aea6b2cad4..142822b9d5 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsConst.java @@ -8,17 +8,16 @@ package com.mogo.module.apps; */ public class AppsConst { + /** + * 打开/关闭全部应用、打开/关闭车辆设置 + */ + public static final String COMMAND_OPERATION = "system.application.operation"; + /** * 每页显示多少个app */ public static final int TOTAL_SIZE_EACH_PAGE = 12; - public static final String CMD_OPEN_APPS_PANEL = "CMD_OPEN_APPS_PANEL"; - public static final String[] CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS = {"打开全部应用"}; - - public static final String CMD_CLOSE_APPS_PANEL = "CMD_CLOSE_APPS_PANEL"; - public static final String[] CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS = {"关闭全部应用"}; - /** * 媒体跳转 */ @@ -27,4 +26,11 @@ public class AppsConst { * 车辆设置跳转 */ public static final String APP_PKG_CAR_SETTINGS = "com.zhidao.settings"; + + public static final String OBJECT_ALL_APPS = "全部应用"; + public static final String OBJECT_FAST_SETTINGS = "快捷设置"; + public static final String OPERATION_OPEN = "打开"; + public static final String OPERATION_CLOSE = "关闭"; + + } From f42ec6c65f1db01b76c9e4a1406990aac725a9e6 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Mon, 17 Feb 2020 19:03:46 +0800 Subject: [PATCH 3/3] opt ui --- .../src/main/res/layout/tanlu_item_video_cover.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_video_cover.xml b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_video_cover.xml index 15c0e8e2c8..e56381d53e 100644 --- a/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_video_cover.xml +++ b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_video_cover.xml @@ -70,8 +70,8 @@