opt
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.mogo.launcher">
|
||||
<!-- android:sharedUserId="android.uid.system">-->
|
||||
|
||||
package="com.mogo.launcher"
|
||||
android:sharedUserId="android.uid.system">
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
private LocationSource.OnLocationChangedListener mOnLocationChangedListener;
|
||||
private boolean mIsCarLockced = false;
|
||||
|
||||
private float mDefaultZoomLevel = 16.0f;
|
||||
|
||||
public AMapNaviViewWrapper( AMapNaviView mapView ) {
|
||||
this.mMapView = mapView;
|
||||
this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView, this );
|
||||
@@ -382,12 +384,20 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void changeZoom( boolean zoom ) {
|
||||
if ( checkAMapView() ) {
|
||||
mDefaultZoomLevel = getMap().getZoomLevel();
|
||||
if ( zoom ) {
|
||||
mMapView.zoomIn();
|
||||
mDefaultZoomLevel += 1.5f;
|
||||
if ( mDefaultZoomLevel > 20 ) {
|
||||
mDefaultZoomLevel = 20;
|
||||
}
|
||||
} else {
|
||||
mMapView.zoomOut();
|
||||
mDefaultZoomLevel -= 1.5f;
|
||||
if ( mDefaultZoomLevel < 1 ) {
|
||||
mDefaultZoomLevel = 1;
|
||||
}
|
||||
}
|
||||
Logger.i( TAG, "mapview zoom = " + mMapView.getMap().getCameraPosition().zoom );
|
||||
changeZoom( mDefaultZoomLevel );
|
||||
Logger.i( TAG, "mapview zoom = " + mDefaultZoomLevel );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -54,6 +55,7 @@ import com.mogo.service.module.IMogoAddressManager;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -126,10 +128,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
|
||||
mIMogoAuthorizeModuleManager = (IMogoAuthorizeModuleManager) ARouter.getInstance().build(AuthorizeConstant.PROVIDER_MODULE).navigation(getContext());
|
||||
mIMogoAuthorizeModuleManager.registerAuthorizeListener(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY, this);
|
||||
mIMogoAuthorizeModuleManager = ( IMogoAuthorizeModuleManager ) ARouter.getInstance().build( AuthorizeConstant.PROVIDER_MODULE ).navigation( getContext() );
|
||||
mIMogoAuthorizeModuleManager.registerAuthorizeListener( AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY, this );
|
||||
|
||||
mEntrancePresenter = new EntrancePresenter(getContext(), this, mIMogoAuthorizeModuleManager);
|
||||
mEntrancePresenter = new EntrancePresenter( getContext(), this, mIMogoAuthorizeModuleManager );
|
||||
mMogoFragmentManager = mApis.getFragmentManagerApi();
|
||||
mMogoAddressManager = mApis.getAddressManagerApi();
|
||||
|
||||
@@ -138,7 +140,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mSearch = findViewById( R.id.module_entrance_id_search );
|
||||
|
||||
mSearch.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
setMarkerStatus( true );
|
||||
mSearchProvider = ( IMogoModuleProvider ) ARouter.getInstance()
|
||||
.build( MogoModulePaths.PATH_MODULE_SEARCH )
|
||||
.navigation();
|
||||
@@ -153,7 +155,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mHome = findViewById( R.id.module_entrance_id_home );
|
||||
mHome.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
setMarkerStatus( true );
|
||||
mMogoAddressManager.goHome();
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
|
||||
@@ -161,7 +163,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mCompany = findViewById( R.id.module_entrance_id_company );
|
||||
mCompany.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
setMarkerStatus( true );
|
||||
mMogoAddressManager.goCompany();
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
|
||||
@@ -174,6 +176,26 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
} );
|
||||
mVRMode = findViewById( R.id.module_entrance_id_vr_mode );
|
||||
mVRMode.setOnClickListener( view -> {
|
||||
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
Rect mBoundRect = new Rect();
|
||||
final int paddingTop = WindowUtils.dip2px( getContext(), 250 );
|
||||
final int paddingBottom = WindowUtils.dip2px( getContext(), 150 );
|
||||
final int paddingRight = WindowUtils.dip2px( getContext(), 150 );
|
||||
final int paddingLeft = WindowUtils.dip2px( getContext(), 650 );
|
||||
|
||||
mBoundRect.bottom = paddingBottom;
|
||||
mBoundRect.top = paddingTop;
|
||||
mBoundRect.left = paddingLeft;
|
||||
mBoundRect.right = paddingRight;
|
||||
mMApUIController.showBounds( TAG,
|
||||
new MogoLatLng(
|
||||
mService.getSingletonLocationClient( getContext() ).getLastKnowLocation().getLatitude(),
|
||||
mService.getSingletonLocationClient( getContext() ).getLastKnowLocation().getLongitude()
|
||||
),
|
||||
Arrays.asList( new MogoLatLng( 39.9736012000, 116.4220762300 ) ),
|
||||
mBoundRect,
|
||||
false );
|
||||
} );
|
||||
|
||||
mMove2CurrentLocation = findViewById( R.id.module_entrance_id_move2_current_location );
|
||||
@@ -223,36 +245,38 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mSpeedLimitUnit = findViewById( R.id.module_entrance_id_speed_limit_unit );
|
||||
|
||||
|
||||
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, new IMogoIntentListener() {
|
||||
@Override public void onIntentReceived(String intentStr, Intent intent) {
|
||||
int key_type = intent.getIntExtra("KEY_TYPE", 0);
|
||||
mApis.getIntentManagerApi().registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, new IMogoIntentListener() {
|
||||
@Override
|
||||
public void onIntentReceived( String intentStr, Intent intent ) {
|
||||
int key_type = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
|
||||
int type = intent.getIntExtra("EXTRA_TYPE", -1);
|
||||
int opera_type = intent.getIntExtra("EXTRA_OPERA", -1);
|
||||
if (key_type == 10027) {
|
||||
if (opera_type == 0) {
|
||||
ivMode.setSelected(false);
|
||||
} else if (opera_type == 1) {
|
||||
ivMode.setSelected(true);
|
||||
int type = intent.getIntExtra( "EXTRA_TYPE", -1 );
|
||||
int opera_type = intent.getIntExtra( "EXTRA_OPERA", -1 );
|
||||
if ( key_type == 10027 ) {
|
||||
if ( opera_type == 0 ) {
|
||||
ivMode.setSelected( false );
|
||||
} else if ( opera_type == 1 ) {
|
||||
ivMode.setSelected( true );
|
||||
}
|
||||
ivMode.setText(
|
||||
getString( ivMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
getString( ivMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
}
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void setMarkerStatus(boolean show){
|
||||
protected void setMarkerStatus( boolean show ) {
|
||||
mMogoStatusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, show
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, show
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected EntrancePresenter createPresenter() {
|
||||
@@ -280,28 +304,28 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if (mEntrancePresenter != null) {
|
||||
if ( mEntrancePresenter != null ) {
|
||||
mEntrancePresenter.unregisterUnWake();
|
||||
}
|
||||
|
||||
mIMogoAuthorizeModuleManager.unregisterAuthorizeListener(AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY);
|
||||
mIMogoAuthorizeModuleManager.unregisterAuthorizeListener( AuthorizeInvokerConstant.AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void authorizeSuccess() {
|
||||
Log.d(TAG, "authorizeSuccess --------> ");
|
||||
Log.d( TAG, "authorizeSuccess --------> " );
|
||||
mEntrancePresenter.handleNeedAuthorizeCmd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorizeFailed(String errorMsg) {
|
||||
Log.e(TAG, "authorizeFailed --------> ");
|
||||
public void authorizeFailed( String errorMsg ) {
|
||||
Log.e( TAG, "authorizeFailed --------> " );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forbiddenVoiceWhenAuthorize(String cmd) {
|
||||
Log.d(TAG, "forbiddenVoiceWhenAuthorize --------> ");
|
||||
public void forbiddenVoiceWhenAuthorize( String cmd ) {
|
||||
Log.d( TAG, "forbiddenVoiceWhenAuthorize --------> " );
|
||||
|
||||
}
|
||||
|
||||
@@ -328,7 +352,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
ivMode.setVisibility( View.VISIBLE );
|
||||
mExitNavi.setVisibility( View.VISIBLE );
|
||||
mMApUIController.setPointToCenter( 0.675926, 0.77552 );
|
||||
mMApUIController.changeMapMode(ivMode.isSelected()?EnumMapUI.NorthUP_2D :EnumMapUI.CarUp_2D );
|
||||
mMApUIController.changeMapMode( ivMode.isSelected() ? EnumMapUI.NorthUP_2D : EnumMapUI.CarUp_2D );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -339,7 +363,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
mSpeedLimit.setVisibility( View.GONE );
|
||||
mMApUIController.setPointToCenter( 0.66145, 0.590688 );
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
mMApUIController.changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 272 B |
Binary file not shown.
|
After Width: | Height: | Size: 451 B |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="90px" />
|
||||
<solid android:color="#4C6873A5" />
|
||||
</shape>
|
||||
@@ -146,7 +146,7 @@
|
||||
android:layout_height="@dimen/module_ext_operation_panel_vr_height"
|
||||
android:background="@drawable/module_ext_dw_top_corner_bkg"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -10,26 +10,42 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_ext_id_voice"
|
||||
android:layout_width="@dimen/module_ext_voice_icon_width"
|
||||
android:layout_height="@dimen/module_ext_voice_icon_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="@dimen/module_ext_voice_icon_width"
|
||||
android:layout_height="@dimen/module_ext_voice_icon_height"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <com.mogo.module.extensions.anim.JSurfaceView-->
|
||||
<!-- />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_voice_msg"
|
||||
<LinearLayout
|
||||
android:id="@+id/module_ext_id_voice_msg_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/module_ext_str_voice_msg"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_voice_textSize"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_ext_id_voice"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/module_ext_ic_right_arrow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_voice_msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_ext_id_voice_msg_icon_margin_left"
|
||||
android:background="@drawable/module_ext_dw_grey_bottom_bkg"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/module_ext_id_voice_msg_padding_left"
|
||||
android:paddingTop="@dimen/module_ext_id_voice_msg_padding_top"
|
||||
android:paddingRight="@dimen/module_ext_id_voice_msg_padding_right"
|
||||
android:paddingBottom="@dimen/module_ext_id_voice_msg_padding_bottom"
|
||||
android:text="@string/module_ext_str_voice_msg"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_voice_textSize" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_time"
|
||||
@@ -95,8 +111,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
android:textSize="@dimen/module_ext_weather_temp_desc_textSize"
|
||||
android:textColor="#FFFFFF" />
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_ext_weather_temp_desc_textSize" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
||||
@@ -90,4 +90,10 @@
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px
|
||||
</dimen>
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">15px</dimen>
|
||||
|
||||
<dimen name="module_ext_id_voice_msg_padding_top">9px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_bottom">9px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_left">18px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_right">18px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_icon_margin_left">-1px</dimen>
|
||||
</resources>
|
||||
@@ -88,4 +88,10 @@
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
|
||||
|
||||
<dimen name="module_ext_id_voice_msg_padding_top">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_bottom">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_left">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_right">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_icon_margin_left">-2px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -88,4 +88,10 @@
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
|
||||
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
|
||||
|
||||
<dimen name="module_ext_id_voice_msg_padding_top">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_bottom">17px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_left">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_padding_right">36px</dimen>
|
||||
<dimen name="module_ext_id_voice_msg_icon_margin_left">-2px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -20,28 +20,31 @@
|
||||
<string name="module_ext_str_exit_navi">退出导航</string>
|
||||
<string name="module_ext_str_continue_navi">继续导航</string>
|
||||
<string name="module_ext_str_exit_path">退出全览</string>
|
||||
<string name="mode_car_up">车头</string>
|
||||
<string name="mode_north_up">正北</string>
|
||||
<string name="mode_car_up">车头</string>
|
||||
<string name="mode_north_up">正北</string>
|
||||
|
||||
<string-array name="module_ext_str_arr_ai_tips">
|
||||
<string-array name="module_ext_str_arr_ai_tips">
|
||||
<item>你好小智,播放音乐</item>
|
||||
<item>你好小智,我要听音乐</item>
|
||||
<item>你好小智,播放赵磊的歌</item>
|
||||
<item>你好小智,我想听成都</item>
|
||||
<item>你好小智,打开导航</item>
|
||||
<item>你好小智,我要去拉萨</item>
|
||||
<item>你好小智,我要回家</item>
|
||||
<item>你好小智,我要去加油站</item>
|
||||
<item>你好小智,导航去西单商场</item>
|
||||
<item>你好小智,打开行车记录仪</item>
|
||||
<item>你好小智,打开收音机</item>
|
||||
<item>你好小智,调频到97.4</item>
|
||||
<item>你好小智,调频到103.9</item>
|
||||
<item>你好小智,今天天气怎么样</item>
|
||||
<item>你好小智,北京明天天气怎么样</item>
|
||||
<item>你好小智,打开车聊聊</item>
|
||||
<item>你好小智,我想聊天</item>
|
||||
<item>你好小智,中关村堵不堵</item>
|
||||
<item>你好小智,打开探路</item>
|
||||
<item>你好小智,附近路况</item>
|
||||
<item>你好小智,前方路况怎么样</item>
|
||||
<item>你好小智,上报路况</item>
|
||||
<item>你好小智,分享这首歌</item>
|
||||
<item>你好小智,打开辅助驾驶</item>
|
||||
<item>你好小智,查询附近的人</item>
|
||||
<item>你好小智,音量开到百分之三十</item>
|
||||
<item>你好小智,打开全部应用</item>
|
||||
<item>你好小智,返回桌面</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.VoicePreemptType;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -30,6 +31,7 @@ public class CardIntroduceConfigs {
|
||||
public static String sBroadcastConfigKey;
|
||||
|
||||
public static Map< String, CardIntroduceConfig > sConfigs = new HashMap<>();
|
||||
private static IMogoStatusManager sStatusManager;
|
||||
|
||||
static {
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_BUSINESS_OPERATION, new CardIntroduceConfig( ModuleNames.CARD_TYPE_BUSINESS_OPERATION, "", 3 ) );
|
||||
@@ -40,8 +42,8 @@ public class CardIntroduceConfigs {
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_NOVELTY, new CardIntroduceConfig( ModuleNames.CARD_TYPE_NOVELTY, "新鲜事,邀你给同城车友分享沿途封路、拥堵消息", 0 ) );
|
||||
}
|
||||
|
||||
public static void init( Context context ) {
|
||||
|
||||
public static void init( Context context, IMogoStatusManager manager ) {
|
||||
sStatusManager = manager;
|
||||
WorkThreadHandler.getInstance().post( () -> {
|
||||
sBroadcastConfigKey = KEY_VOICE_BROADCAST_CONFIG + CommonUtils.getVersionCode( context );
|
||||
String configsStr = SharedPrefsMgr.getInstance( context ).getString( sBroadcastConfigKey );
|
||||
@@ -58,16 +60,24 @@ public class CardIntroduceConfigs {
|
||||
} );
|
||||
}
|
||||
|
||||
public static void broadcast( Context context, String type ) {
|
||||
public static void broadcastCardIntroduce( Context context, String type ) {
|
||||
if ( sConfigs.get( type ) == null ) {
|
||||
Logger.d( TAG, "un support %s", type );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( sConfigs.get( type ).broadcastAmount >= 3 ) {
|
||||
Logger.d( TAG, "do not broadcast %s cast amount = %s", type, type );
|
||||
Logger.d( TAG, "do not broadcastCardIntroduce %s cast amount = %s", type, type );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( sStatusManager != null ) {
|
||||
if ( !sStatusManager.isAIAssistReady() ) {
|
||||
Logger.w( TAG, "ai assist not ready: %s", type );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CardIntroduceConfig config = sConfigs.get( type );
|
||||
config.broadcastAmount++;
|
||||
|
||||
|
||||
@@ -39,9 +39,7 @@ import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
@@ -97,7 +95,7 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
mMogoIntentManager = apis.getIntentManagerApi();
|
||||
|
||||
registerReceiver();
|
||||
CardIntroduceConfigs.init( getContext() );
|
||||
CardIntroduceConfigs.init( getContext(), apis.getStatusManagerApi() );
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
@@ -283,7 +281,7 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
SharedPrefsMgr.getInstance( getContext() ).putString( KEY_SORTED_CARD_MODULES, GsonUtil.jsonFromObject( mSortedCards ) );
|
||||
Log.i( TAG, "enable & disable card cost " + ( System.currentTimeMillis() - start1 ) + "ms" );
|
||||
|
||||
CardIntroduceConfigs.broadcast( mActivity, mEnableModuleName );
|
||||
CardIntroduceConfigs.broadcastCardIntroduce( mActivity, mEnableModuleName );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient android:angle="270" android:endColor="#00222222" android:startColor="#79000000" />
|
||||
<gradient android:angle="270" android:endColor="#00222222" android:startColor="#000000" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -85,7 +85,7 @@ public class MapPresenter extends Presenter<MapView> implements
|
||||
}, 1_000 );
|
||||
} else {
|
||||
// 30s后锁车刷新
|
||||
mRefreshStrategyController.restartAutoRefreshAtTime( 30 );
|
||||
mRefreshStrategyController.restartAutoRefreshAtTime( 30_000 );
|
||||
}
|
||||
} else if (type == 2) {
|
||||
|
||||
|
||||
@@ -13,12 +13,14 @@ import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Trace;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -451,6 +453,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
|
||||
private void stopAutoRefreshStrategy() {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
Logger.d( TAG, "stop auto refresh strategy" );
|
||||
mHandler.removeMessages( ServiceConst.MSG_TYPE_REFRESH_DECREASE );
|
||||
}
|
||||
@@ -814,6 +819,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
} else if ( MogoReceiver.ACTION_VOICE_READY.equals( command ) ) {
|
||||
AIAssist.getInstance( mContext ).flush();
|
||||
mStatusManager.setAIAssistReady( TAG, true );
|
||||
} else if ( ServiceConst.COMMAND_MY_LOCATION.equals( command ) ) {
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
@@ -907,12 +913,12 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
mInternalUnWakeupRegisterStatus = true;
|
||||
AIAssist.getInstance( mContext )
|
||||
.registerUnWakeupCommand( ServiceConst.CMD_UN_WAKE_PREV,
|
||||
ServiceConst.CMD_UN_WAKE_PREV_UN_WAKE_WORDS, this );
|
||||
AIAssist.getInstance( mContext )
|
||||
.registerUnWakeupCommand( ServiceConst.CMD_UN_WAKE_NEXT,
|
||||
ServiceConst.CMD_UN_WAKE_NEXT_UN_WAKE_WORDS, this );
|
||||
// AIAssist.getInstance( mContext )
|
||||
// .registerUnWakeupCommand( ServiceConst.CMD_UN_WAKE_PREV,
|
||||
// ServiceConst.CMD_UN_WAKE_PREV_UN_WAKE_WORDS, this );
|
||||
// AIAssist.getInstance( mContext )
|
||||
// .registerUnWakeupCommand( ServiceConst.CMD_UN_WAKE_NEXT,
|
||||
// ServiceConst.CMD_UN_WAKE_NEXT_UN_WAKE_WORDS, this );
|
||||
AIAssist.getInstance( mContext )
|
||||
.registerUnWakeupCommand( ServiceConst.CMD_UN_WAKEUP_MY_LOCATION,
|
||||
ServiceConst.CMD_UN_WAKEUP_WORDS_MY_LOCATION, this );
|
||||
@@ -926,10 +932,10 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
mInternalUnWakeupRegisterStatus = false;
|
||||
AIAssist.getInstance( mContext )
|
||||
.unregisterUnWakeupCommand( ServiceConst.CMD_UN_WAKE_PREV, this );
|
||||
AIAssist.getInstance( mContext )
|
||||
.unregisterUnWakeupCommand( ServiceConst.CMD_UN_WAKE_NEXT, this );
|
||||
// AIAssist.getInstance( mContext )
|
||||
// .unregisterUnWakeupCommand( ServiceConst.CMD_UN_WAKE_PREV, this );
|
||||
// AIAssist.getInstance( mContext )
|
||||
// .unregisterUnWakeupCommand( ServiceConst.CMD_UN_WAKE_NEXT, this );
|
||||
AIAssist.getInstance( mContext )
|
||||
.unregisterUnWakeupCommand( ServiceConst.CMD_UN_WAKEUP_MY_LOCATION, this );
|
||||
}
|
||||
@@ -974,7 +980,11 @@ public class MogoServices implements IMogoMapListener,
|
||||
@Override
|
||||
public void onTransaction( int size ) {
|
||||
if ( size == 0 ) {
|
||||
mUiController.setPointToCenter( 0.66145, 0.661094 );
|
||||
if ( mNavi.isNaviing() ) {
|
||||
mUiController.setPointToCenter( 0.675926, 0.77552 );
|
||||
} else {
|
||||
mUiController.setPointToCenter( 0.66145, 0.661094 );
|
||||
}
|
||||
mUiController.showMyLocation( !mNavi.isNaviing() );
|
||||
AIAssist.getInstance( mContext ).unregisterUnWakeupCommand( ServiceConst.CMD_BACK );
|
||||
} else {
|
||||
|
||||
@@ -77,6 +77,13 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
boolean isMainPageOnResume();
|
||||
|
||||
/**
|
||||
* 小智语音是否准备完毕
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isAIAssistReady();
|
||||
|
||||
/**
|
||||
* 设置小智语音UI状态
|
||||
*
|
||||
@@ -151,6 +158,14 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
void setMainPageResumeStatus( String tag, boolean resume );
|
||||
|
||||
/**
|
||||
* 设置小智语音状态
|
||||
*
|
||||
* @param tag
|
||||
* @param ready
|
||||
*/
|
||||
void setAIAssistReady( String tag, boolean ready );
|
||||
|
||||
/**
|
||||
* 注册监听
|
||||
*
|
||||
|
||||
@@ -54,5 +54,10 @@ public enum StatusDescriptor {
|
||||
/**
|
||||
* 主页 resume 状态
|
||||
*/
|
||||
MAIN_PAGE_RESUME;
|
||||
MAIN_PAGE_RESUME,
|
||||
|
||||
/**
|
||||
* 小智语音状态
|
||||
*/
|
||||
AI_ASSIST_READY;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,11 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
return get_bool_val( StatusDescriptor.MAIN_PAGE_RESUME );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAIAssistReady() {
|
||||
return get_bool_val( StatusDescriptor.AI_ASSIST_READY );
|
||||
}
|
||||
|
||||
private boolean get_bool_val( StatusDescriptor descriptor ) {
|
||||
Boolean val = mStatus.get( descriptor );
|
||||
return val == null ? false : val;
|
||||
@@ -165,6 +170,13 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
recordStatusModifier( tag, StatusDescriptor.MAIN_PAGE_RESUME );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAIAssistReady( String tag, boolean ready ) {
|
||||
mStatus.put( StatusDescriptor.AI_ASSIST_READY, ready );
|
||||
invokeStatusChangedListener( StatusDescriptor.AI_ASSIST_READY, ready );
|
||||
recordStatusModifier( tag, StatusDescriptor.AI_ASSIST_READY );
|
||||
}
|
||||
|
||||
private void invokeStatusChangedListener( StatusDescriptor descriptor, boolean status ) {
|
||||
if ( mListeners.containsKey( descriptor ) ) {
|
||||
Iterator< IMogoStatusChangedListener > iterator = mListeners.get( descriptor ).iterator();
|
||||
|
||||
Reference in New Issue
Block a user