opt
This commit is contained in:
@@ -59,11 +59,10 @@ import java.util.List;
|
||||
* 描述:加载各个模块
|
||||
*/
|
||||
public class MainActivity extends MvpActivity< MainView, MainPresenter > implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMogoMarkerClickListener, IMogoVoiceCmdCallBack {
|
||||
IMogoLocationListener,
|
||||
IMogoMarkerClickListener {
|
||||
|
||||
private static final String TAG = "MainActivity";
|
||||
private static final String BACK_CMD = "back";
|
||||
|
||||
private IMogoServiceApis mServiceApis;
|
||||
private IMogoMapService mMogoMapService;
|
||||
@@ -281,18 +280,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoFragmentManager.registerMainFragmentStackTransactionListener( ( size ) -> {
|
||||
if ( size == 0 ) {
|
||||
showLayout();
|
||||
|
||||
AIAssist.getInstance(getContext())
|
||||
.unregisterUnWakeupCommand(BACK_CMD);
|
||||
|
||||
} else if ( size == 1 ) {
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(BACK_CMD, new String[] { "关闭", "返回" }, this);
|
||||
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override public void run() {
|
||||
mMogoMapUIController.setPointToCenter(0.5,0.5);
|
||||
|
||||
UiThreadHandler.postDelayed( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mMogoMapUIController.setPointToCenter( 0.5, 0.5 );
|
||||
}
|
||||
}, 1000 );
|
||||
hideLayout();
|
||||
@@ -424,28 +416,4 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoFragmentManager = null;
|
||||
AIAssist.getInstance( this ).release();
|
||||
}
|
||||
|
||||
@Override public void onCmdSelected(String cmd) {
|
||||
|
||||
if (TextUtils.equals(BACK_CMD,cmd)) {
|
||||
mMogoFragmentManager.clearAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override public void onCmdAction(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onCmdCancel(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onSpeakEnd(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onSpeakSelectTimeOut(String speakText) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.os.Message;
|
||||
import android.os.Trace;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -48,6 +49,7 @@ import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
@@ -85,7 +87,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoIntentListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoVoiceCmdCallBack {
|
||||
IMogoVoiceCmdCallBack,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
private boolean mInternalUnWakeupRegisterStatus = false;
|
||||
|
||||
@@ -310,6 +313,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
mLauncher = apis.getLauncherApi();
|
||||
mFragmentManager = apis.getFragmentManagerApi();
|
||||
mCardManager = apis.getCardManagerApi();
|
||||
|
||||
mFragmentManager.addMainFragmentStackTransactionListener( this );
|
||||
initWorkThread();
|
||||
}
|
||||
|
||||
@@ -633,17 +638,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
case ADAS_UI:
|
||||
try {
|
||||
if ( isTrue ) {
|
||||
// ADAS 时,不在自动刷新打点策略
|
||||
stopAutoRefreshStrategy();
|
||||
// 清除所有的打点信息记录
|
||||
MarkerServiceHandler.getMapMarkerManager().alreadySmallMarker.clear();
|
||||
onAdasOn();
|
||||
} else {
|
||||
// 主动刷新
|
||||
refreshStrategy();
|
||||
// ADAS关闭后,打开打点策略
|
||||
if ( mAutoRefreshCallback != null ) {
|
||||
mAutoRefreshCallback.onSuccess();
|
||||
}
|
||||
onAdasClosed();
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
@@ -659,6 +656,21 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
|
||||
private void onAdasOn(){
|
||||
// ADAS 时,不在自动刷新打点策略
|
||||
stopAutoRefreshStrategy();
|
||||
// 清除所有的打点信息记录
|
||||
MarkerServiceHandler.getMapMarkerManager().alreadySmallMarker.clear();
|
||||
}
|
||||
|
||||
private void onAdasClosed(){
|
||||
refreshStrategy();
|
||||
// ADAS关闭后,打开打点策略
|
||||
if ( mAutoRefreshCallback != null ) {
|
||||
mAutoRefreshCallback.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
public void restartAutoRefreshAtTime( int time ) {
|
||||
if ( time < 0 ) {
|
||||
Logger.w( TAG, "ignore refresh request case time < 0" );
|
||||
@@ -798,6 +810,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
} else if ( MogoReceiver.ACTION_VOICE_READY.equals( command ) ) {
|
||||
AIAssist.getInstance( mContext ).flush();
|
||||
} else if ( ServiceConst.COMMAND_MY_LOCATION.equals( command ) ) {
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mUiController.recoverLockMode();
|
||||
}
|
||||
@@ -853,10 +868,17 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
UiThreadHandler.post( () -> {
|
||||
mUiController.showMyLocation( ( ( float ) degree ) );
|
||||
|
||||
mUiController.showMyLocation( inflateCursorView( degree ) );
|
||||
} );
|
||||
}
|
||||
|
||||
private View inflateCursorView( double degree ) {
|
||||
View view = View.inflate( mContext, R.layout.map_amap_cursor, null );
|
||||
view.setRotation( ( float ) degree );
|
||||
return view;
|
||||
}
|
||||
|
||||
private void changeMyLocation( CarStateInfo.ValuesBean valuesBean ) {
|
||||
if ( valuesBean == null ) {
|
||||
return;
|
||||
@@ -903,6 +925,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mUiController.recoverLockMode();
|
||||
}
|
||||
} else if ( TextUtils.equals( ServiceConst.CMD_BACK, cmd ) ) {
|
||||
mFragmentManager.clearAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -925,4 +949,13 @@ public class MogoServices implements IMogoMapListener,
|
||||
public void onSpeakSelectTimeOut( String speakText ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransaction( int size ) {
|
||||
if ( size == 0 ) {
|
||||
AIAssist.getInstance( mContext ).unregisterUnWakeupCommand( ServiceConst.CMD_BACK );
|
||||
} else {
|
||||
AIAssist.getInstance( mContext ).registerUnWakeupCommand( ServiceConst.CMD_BACK, ServiceConst.CMD_BACK_WORDS, this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,5 +149,8 @@ public class ServiceConst {
|
||||
"定位我的位置"
|
||||
};
|
||||
|
||||
public static final String CMD_BACK = "back";
|
||||
public static final String[] CMD_BACK_WORDS = new String[]{"关闭", "返回"};
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -340,6 +340,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
|
||||
mLastDataResult = response.getResult();
|
||||
@@ -392,6 +396,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( TextUtils.isEmpty( mCurrentModuleName ) ) {
|
||||
// 默认大而全
|
||||
mCurrentModuleName = ServiceConst.CARD_TYPE_BUSINESS_OPERATION;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/map_amap_id_cursor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/map_api_ic_current_location2_cursor" />
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user