This commit is contained in:
wangcongtao
2020-03-26 19:23:53 +08:00
41 changed files with 2964 additions and 437 deletions

View File

@@ -36,6 +36,7 @@ public class ExtensionsModuleConst {
//唤醒指令
//分享路况/上报路况/上报拥堵/上报交通检查/上报封路 唤醒
public static final String UPLOAD_ROAD_CONDITION_AWAKEN = "com.zhidao.pathfinder.report.roadCondition";
public static final String UPLOAD_ROAD_CONDITION = "command_upload_roadcondition";
//关闭分享框 唤醒
public static final String SHARE_DIALOG_CLOSE = "com.zhidao.share.close";
// 两次未回复关闭分享对话框

View File

@@ -1,7 +1,9 @@
package com.mogo.module.extensions.entrance;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
@@ -46,6 +48,7 @@ import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.fragmentmanager.FragmentDescriptor;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoAddressManager;
import com.mogo.service.module.IMogoModuleProvider;
@@ -215,8 +218,29 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mSpeedLimit = findViewById( R.id.module_entrance_id_speed_limit_container );
mSpeedLimitValue = findViewById( R.id.module_entrance_id_speed_limit_value );
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);
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 ) );
}
}
});
}
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
"AUTONAVI_STANDARD_BROADCAST_RECV";
@NonNull
@Override
protected EntrancePresenter createPresenter() {

View File

@@ -125,6 +125,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
* 注册唤醒命令
*/
private void registerAwakeVoice() {
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION, mogoIntentListener);
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.GO_TO_SHARE, mogoIntentListener);
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.SHARE_DIALOG_CLOSE, mogoIntentListener);
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN, mogoIntentListener);
@@ -206,6 +208,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
ShareControl.getInstance(mContext).dismissDialog();
Logger.d(TAG, "mogoIntentListener 两次未回复关闭对话框");
}
} else if (intentStr.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) { //上报路况 免唤醒 --ok
uploadRoadCondition();
}
}
};
@@ -244,7 +248,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
Log.d(TAG, "handleNeedAuthorizeCmd 上报封路 ----> ");
uploadRoadClosed();
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK)
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)) { //上报拥堵, 分享路况, 上报路况
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) { //上报拥堵, 分享路况, 上报路况
Log.d(TAG, "handleNeedAuthorizeCmd 上报路况 ----> ");
uploadRoadCondition();
}