Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	skin/mogo-skin-light/build.gradle
This commit is contained in:
wangcongtao
2020-09-01 14:26:48 +08:00
25 changed files with 176 additions and 106 deletions

View File

@@ -75,7 +75,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
IMogoMapListener,
IMogoAimlessModeListener,
IMogoStatusChangedListener,
IMogoIntentListener{
IMogoIntentListener {
private static final String TAG = "EntranceFragment";
@@ -192,13 +192,13 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
mStatusManager.setUserInteractionStatus(TAG, true, false);
mMApUIController.recoverLockMode();
UiThreadHandler.postDelayed( ()->{
UiThreadHandler.postDelayed(() -> {
if (!mStatusManager.isV2XShow()) {
mStatusManager.setUserInteractionStatus(TAG, true, false);
mMApUIController.setLockZoom(16);
mMApUIController.changeZoom(16.0f);
}
}, 1_000L );
}, 1_000L);
}
});
@@ -208,7 +208,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
return true;
});
mUploadRoadCondition.setOnLongClickListener(view->{
mUploadRoadCondition.setOnLongClickListener(view -> {
mApis.getMogoMonitorApi().showLogDebugDialog();
return true;
});
@@ -301,7 +301,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
// 埋点
final Map<String, Object> properties = new HashMap<>();
properties.put("type", 3);
ServiceApisManager.serviceApis.getAnalyticsApi().track("Launcher_APP_Icon", properties);
ServiceApisManager.serviceApis.getAnalyticsApi().track("Launcher_APP_Icon",
properties);
} catch (Exception e) {
Logger.e(TAG, e, "打开个人中心Exception");
}
@@ -309,7 +310,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mUserHeadImg.setVisibility(DebugConfig.isLauncher() ? View.VISIBLE : View.GONE);
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload, mStatusManager);
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload,
mStatusManager);
debugTopView();
}
@@ -320,7 +322,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
traceData("1");
}
private static final String AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV";
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
"AUTONAVI_STANDARD_BROADCAST_RECV";
@NonNull
@Override
@@ -450,17 +453,19 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
return;
}
if (descriptor == StatusDescriptor.UPLOADING) {
if (isTrue) {
mUploading.setVisibility(View.VISIBLE);
mUpload.setVisibility(View.GONE);
mUploadButtonAnimatorController.doFrameAnimOnUploadButton();
} else {
mUploadButtonAnimatorController.stopAnimation();
mUploading.setVisibility(View.GONE);
mUpload.setVisibility(View.VISIBLE);
}
} else if (descriptor == StatusDescriptor.DISPLAY_OVERVIEW) {
// 1.1.5的需求,上报即成功,去掉此处动画
// if (descriptor == StatusDescriptor.UPLOADING) {
// if (isTrue) {
// mUploading.setVisibility(View.VISIBLE);
// mUpload.setVisibility(View.GONE);
// mUploadButtonAnimatorController.doFrameAnimOnUploadButton();
// } else {
// mUploadButtonAnimatorController.stopAnimation();
// mUploading.setVisibility(View.GONE);
// mUpload.setVisibility(View.VISIBLE);
// }
// } else
if (descriptor == StatusDescriptor.DISPLAY_OVERVIEW) {
if (!mMogoNavi.isNaviing()) {
return;
}
@@ -585,7 +590,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
});
});
findViewById(R.id.btnDebugAddBottomLayerView).setOnClickListener(v->{
findViewById(R.id.btnDebugAddBottomLayerView).setOnClickListener(v -> {
TextView tv = new TextView(getContext());
tv.setText("entrance add");
mApis.getEntranceButtonController().addBottomLayerView(tv, 50, 50);
@@ -593,28 +598,30 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
@Override
public void onMapModeChanged( EnumMapUI ui ) {
if ( mCameraMode == null ) {
public void onMapModeChanged(EnumMapUI ui) {
if (mCameraMode == null) {
return;
}
mCameraMode.setSelected(ui == EnumMapUI.NorthUP_2D);
mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up : R.string.mode_north_up));
mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up :
R.string.mode_north_up));
}
@Override
public void onDestroy() {
super.onDestroy();
if ( mMogoRegisterCenter != null ) {
if (mMogoRegisterCenter != null) {
mMogoRegisterCenter.unregisterMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoAimlessModeListener(TAG);
}
if ( mStatusManager != null ) {
if (mStatusManager != null) {
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.UPLOADING, this);
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW, this);
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW
, this);
}
if ( mApis != null ) {
if ( mApis.getIntentManagerApi() != null ) {
if (mApis != null) {
if (mApis.getIntentManagerApi() != null) {
mApis.getIntentManagerApi().unregisterIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, this);
}
}

View File

@@ -43,11 +43,6 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// 小智语音,免唤醒词等服务
compileOnly rootProject.ext.dependencies.mogomap
compileOnly rootProject.ext.dependencies.mogoutils
compileOnly rootProject.ext.dependencies.mogocommons
compileOnly rootProject.ext.dependencies.mogoserviceapi
compileOnly rootProject.ext.dependencies.modulecommon
compileOnly rootProject.ext.dependencies.androidxconstraintlayout
compileOnly rootProject.ext.dependencies.arouter
compileOnly rootProject.ext.dependencies.aiassist
@@ -63,8 +58,18 @@ dependencies {
if( Boolean.valueOf(RELEASE) ){
implementation rootProject.ext.dependencies.modulepushbase
compileOnly rootProject.ext.dependencies.mogomap
compileOnly rootProject.ext.dependencies.mogoutils
compileOnly rootProject.ext.dependencies.mogocommons
compileOnly rootProject.ext.dependencies.mogoserviceapi
compileOnly rootProject.ext.dependencies.modulecommon
} else {
implementation project(":modules:mogo-module-push-base")
compileOnly project(':libraries:mogo-map')
compileOnly project(':foudations:mogo-utils')
compileOnly project(':foudations:mogo-commons')
compileOnly project(':services:mogo-service-api')
compileOnly project(':modules:mogo-module-common')
}
}

View File

@@ -9,6 +9,7 @@ import com.mogo.map.location.MogoLocation
import com.mogo.module.share.ShareControl
import com.mogo.module.share.dialog.LaucherShareDialog
import com.mogo.service.tanlu.TanluUploadParams
import com.mogo.utils.NetworkUtils
import com.mogo.utils.TipToast
import com.mogo.utils.logger.Logger
@@ -18,24 +19,30 @@ import com.mogo.utils.logger.Logger
object UploadHelper {
fun upload(context:Context, type: TanluUploadParams,forcePlayVoice:Boolean = false) {
if(ServiceApisManager.serviceApis.statusManagerApi.isUploading){
Logger.d("UploadHelper", "正在上报===")
TipToast.tip("正在上报,请稍后重试")
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
// Logger.d("UploadHelper", "正在上报===")
// TipToast.tip("正在上报,请稍后重试")
}else {
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
if(DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ||forcePlayVoice) {
AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传")
// 判断当前网络状态
if(NetworkUtils.isConnected(context)) {
// 有网就正常上报
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
// if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ || forcePlayVoice) {
// 因为思必驰语音分享时,语音助手会自己播报一段文字
// AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传")
// }
// 上报即成功
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
val latLon = MogoLatLng(location.latitude, location.longitude)
type.location = latLon
Logger.d("UploadHelper", "upload ----> $type")
ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type)
}else{
// 没网就直接提示失败
AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络")
}
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
val latLon = MogoLatLng(location.latitude, location.longitude)
type.location = latLon
Logger.d("UploadHelper", "upload ----> $type")
ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type)
// val intent = Intent()
// intent.action = "com.zhidao.share.roadcondition.action"
// intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
// intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
// intent.putExtra("type", type)
// context.sendBroadcast(intent)
}
}
}

View File

@@ -20,7 +20,7 @@
android:layout_height="wrap_content"
android:id="@+id/tvShareContent"
android:text="上报拥堵"
android:textColor="@color/white"
android:textColor="@color/module_share_dialog_icon_text_color"
android:textSize="@dimen/share_module_item"
android:textStyle="bold" />

View File

@@ -13,7 +13,7 @@
android:clickable="true"
android:focusable="true"
android:layout_gravity="center"
android:background="@drawable/shape_bg_222533_20px">
android:background="@drawable/module_share_dialog_bg">
<TextView
android:id="@+id/btn_share_title"
@@ -23,7 +23,7 @@
android:layout_marginTop="@dimen/share_module_title_margin_top"
android:gravity="center"
android:text="一 我要分享 一"
android:textColor="@color/white"
android:textColor="@color/module_share_dialog_title_text_color"
android:textSize="@dimen/share_module_title_content"
android:textStyle="bold" />
@@ -56,7 +56,7 @@
android:layout_marginTop="@dimen/share_module_tv_margin_top"
android:gravity="center"
android:text="上报拥堵"
android:textColor="@color/white"
android:textColor="@color/module_share_dialog_icon_text_color"
android:textSize="@dimen/share_module_item"
android:textStyle="bold" />
</RelativeLayout>
@@ -83,7 +83,7 @@
android:layout_marginTop="@dimen/share_module_tv_margin_top"
android:gravity="center"
android:text="分享油价"
android:textColor="@color/white"
android:textColor="@color/module_share_dialog_icon_text_color"
android:textSize="@dimen/share_module_item"
android:textStyle="bold" />
</RelativeLayout>
@@ -109,7 +109,7 @@
android:layout_marginTop="@dimen/share_module_tv_margin_top"
android:gravity="center"
android:text="上报交通检查"
android:textColor="@color/white"
android:textColor="@color/module_share_dialog_icon_text_color"
android:textSize="@dimen/share_module_item"
android:textStyle="bold" />
</RelativeLayout>
@@ -135,7 +135,7 @@
android:layout_marginTop="@dimen/share_module_tv_margin_top"
android:gravity="center"
android:text="上报封路"
android:textColor="@color/white"
android:textColor="@color/module_share_dialog_icon_text_color"
android:textSize="@dimen/share_module_item"
android:textStyle="bold" />
</RelativeLayout>
@@ -148,7 +148,7 @@
android:layout_marginTop="@dimen/share_module_bottom_margin_top"
android:gravity="center"
android:text="可以对小智说:上报拥堵、上报交通检查、上报封路"
android:textColor="@color/white_40"
android:textColor="@color/module_share_dialog_notice_text_color"
android:textSize="@dimen/share_module_bottom_size"
android:textStyle="bold" />
</RelativeLayout>

View File

@@ -9,7 +9,7 @@
android:layout_width="@dimen/share_module_width"
android:layout_height="@dimen/share_module_height"
android:layout_gravity="center"
android:background="@drawable/shape_bg_222533_20px"
android:background="@drawable/module_share_dialog_bg"
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toBottomOf="parent"
@@ -23,7 +23,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/share_module_title_margin_top"
android:text="我要分享"
android:textColor="@color/white"
android:textColor="@color/module_share_dialog_title_text_color"
android:drawableLeft="@drawable/module_share_title_icon_left"
android:drawableRight="@drawable/module_share_title_icon_right"
android:drawablePadding="@dimen/dp_40"
@@ -40,7 +40,7 @@
android:drawableTop="@drawable/share_block_up"
android:text="拥堵"
android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
app:layout_constraintHorizontal_chainStyle="spread_inside"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/btn_share_title"
@@ -56,7 +56,7 @@
android:drawableTop="@drawable/share_traffic_check"
android:text="交通检查"
android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
android:gravity="center"
app:layout_constraintTop_toTopOf="@+id/tvBlock"
app:layout_constraintLeft_toRightOf="@id/tvBlock"
@@ -72,7 +72,7 @@
app:layout_constraintTop_toTopOf="@+id/tvBlock"
app:layout_constraintLeft_toRightOf="@+id/tvTrafficCheck"
app:layout_constraintRight_toLeftOf="@+id/tvAccident"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
android:gravity="center"
android:drawablePadding="@dimen/share_module_drawable_padding" />
<TextView
@@ -85,7 +85,7 @@
app:layout_constraintTop_toTopOf="@+id/tvBlock"
app:layout_constraintLeft_toRightOf="@+id/tvClosure"
app:layout_constraintRight_toLeftOf="@+id/tvConstruction"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
android:gravity="center"
android:drawablePadding="@dimen/share_module_drawable_padding" />
<TextView
@@ -99,7 +99,7 @@
app:layout_constraintLeft_toRightOf="@+id/tvAccident"
app:layout_constraintRight_toRightOf="@+id/vBg"
android:layout_marginEnd="@dimen/share_module_btn_margin_left_right"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
android:gravity="center"
android:drawablePadding="@dimen/share_module_drawable_padding" />
<TextView
@@ -109,7 +109,7 @@
android:drawableTop="@drawable/share_real_time_traffic"
android:text="实时路况"
android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tvBlock"
app:layout_constraintLeft_toLeftOf="@+id/tvBlock"
@@ -122,7 +122,7 @@
android:drawableTop="@drawable/share_seek_help"
android:text="故障求助"
android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tvTrafficCheck"
app:layout_constraintLeft_toLeftOf="@+id/tvTrafficCheck"
@@ -135,7 +135,7 @@
android:drawableTop="@drawable/share_stagnant_water"
android:text="道路积水"
android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tvClosure"
app:layout_constraintLeft_toLeftOf="@+id/tvClosure"
@@ -148,7 +148,7 @@
android:drawableTop="@drawable/share_road_icy"
android:text="道路结冰"
android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
app:layout_constraintTop_toBottomOf="@+id/tvAccident"
app:layout_constraintLeft_toLeftOf="@+id/tvAccident"
android:layout_marginTop="@dimen/share_module_sec_btn_margin_top"
@@ -161,7 +161,7 @@
android:drawableTop="@drawable/share_dense_fog"
android:text="浓雾"
android:textSize="@dimen/share_module_btn_text_size"
android:textColor="#fff"
android:textColor="@color/module_share_dialog_icon_text_color"
app:layout_constraintTop_toBottomOf="@+id/tvConstruction"
app:layout_constraintLeft_toLeftOf="@+id/tvConstruction"
android:layout_marginTop="@dimen/share_module_sec_btn_margin_top"

View File

@@ -1,22 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#000000</color>
<color name="colorPrimaryDark">#000000</color>
<color name="colorAccent">#1F7FFF</color>
<color name="red_tips">#FF1B1B</color>
<color name="white">#FFFFFF</color>
<color name="white_50">#80FFFFFF</color>
<color name="white_40">#99FFFFFF</color>
<color name="color_F8F8F8">#F8F8F8</color>
<color name="color_3">#333333</color>
<color name="color_DADAE2">#DADAE2</color>
<color name="color_1C1C1C">#1C1C1C</color>
<color name="color_545362">#545362</color>
<color name="color_191C25">#99191C25</color>
<color name="color_666666">#666666</color>
<color name="color_999999">#999999</color>
<color name="color_000000">#000000</color>
<color name="all_transparent_white">#00FFFFFF</color>
<color name="module_share_dialog_icon_text_color">#fff</color>
<color name="module_share_dialog_title_text_color">#fff</color>
<color name="module_share_dialog_notice_text_color">#99FFFFFF</color>
</resources>

View File

@@ -8,11 +8,13 @@ import android.view.View;
import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.map.MogoLatLng;
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.module.tanlu.callback.DataSetChangedAdapter;
import com.mogo.module.tanlu.model.event.MarkerInfo;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.module.ModuleType;
@@ -20,6 +22,8 @@ import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.service.tanlu.IMogoTanluUiProvider;
import com.mogo.utils.logger.Logger;
import org.greenrobot.eventbus.EventBus;
import io.reactivex.Single;
import io.reactivex.SingleEmitter;
import io.reactivex.SingleOnSubscribe;
@@ -66,4 +70,12 @@ public class TanluCardViewProvider implements IMogoTanluUiProvider {
tanluListWindow.realShare(intentStr, intent);
});
}
@Override
public void shareSuccess(String poiType, MogoLatLng location) {
MarkerInfo markerInfo = new MarkerInfo(poiType, "", location.lon, location.lat, true, "1");
EventBus.getDefault().post(markerInfo);
}
}

View File

@@ -20,7 +20,8 @@ class MarkerInfoReceiver : BroadcastReceiver() {
var lon = intent.getDoubleExtra("lon",0.0) //经度
var custom = intent.getBooleanExtra("custom", false)
Log.d("MarkerInfoReceiver", "type =" + type + "---->lat =" + lat + "----lon =" + lon + " --custom = " + custom + "---imageUrl =" + imageUrl)
EventBus.getDefault().post(MarkerInfo(type, imageUrl,lon, lat, custom, fromType))
// 此处不接收抓取完成的广播1.1.5的需求是触发即分享成功,所以此处逻辑暂时注释,待日后看情况放开
// EventBus.getDefault().post(MarkerInfo(type, imageUrl,lon, lat, custom, fromType))
}
}
}

View File

@@ -270,6 +270,7 @@ public class V2XModuleProvider implements
* 刷新自车求助状态
*/
private void initCarForHelpStatus() {
Logger.d(MODULE_NAME, "刷新自车求助状态……");
//本地查询是否超时
V2XServiceManager.getV2XRefreshModel().getHelpSignal(new V2XRefreshCallback<V2XSeekHelpRes>() {
@Override
@@ -277,18 +278,15 @@ public class V2XModuleProvider implements
if (result != null) {
V2XSeekHelpRes.ResultBean resultBean = result.getResult();
if (resultBean != null) {
Logger.d(MODULE_NAME, "刷新自车求助状态 resultBean"+resultBean);
int vehicleType = resultBean.getVehicleType();
//故障车
if (vehicleType == 4) {
if (!V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
refreshMeSeekHelp(true);
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, true);
}
refreshMeSeekHelp(true);
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, true);
} else {
if (V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
refreshMeSeekHelp(false);
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, false);
}
refreshMeSeekHelp(false);
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, false);
}
}
}

View File

@@ -11,7 +11,6 @@ import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpButton;
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpDialog;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;

View File

@@ -1,4 +1,4 @@
package com.mogo.module.v2x.scenario.scene.seek;
package com.mogo.module.v2x.scenario.scene.help;
import android.content.Context;
import android.content.Intent;