Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:sharedUserId="android.uid.system"
|
||||
package="com.mogo.launcher">
|
||||
<!-- android:sharedUserId="android.uid.system"-->
|
||||
|
||||
</manifest>
|
||||
@@ -261,4 +261,10 @@ public class DebugConfig {
|
||||
public static boolean isLoadGuideModule() {
|
||||
return sLoadGuideModule;
|
||||
}
|
||||
|
||||
private static String SP_GUIDE = "SP_GUIDE_2020_09_09";
|
||||
|
||||
public static String getSpGuide(){
|
||||
return SP_GUIDE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
|
||||
@NonNull
|
||||
@Override
|
||||
public AppCompatDelegate getDelegate() {
|
||||
return MogoSkinManager.getInstance().getInstaller().getSkinAppCompatDelegate( this, this );
|
||||
return MogoSkinManager.getInstance().getInstaller().getSkinAppCompatDelegate(this,
|
||||
super.getDelegate(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mogo.module.authorize.util
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig.getSpGuide
|
||||
import com.mogo.utils.storage.SharedPrefsMgr
|
||||
|
||||
object SharedPreferenceUtil {
|
||||
|
||||
private const val HAS_AUTH = "HAS_AUTH"
|
||||
private const val HAS_GUIDE = "HAS_GUIDE"
|
||||
private const val AUTHORIZE_UPDATE_TIME = "AUTHORIZE_UPDATE_TIME"
|
||||
|
||||
fun needAuthorization(type: Int): Boolean {
|
||||
@@ -30,6 +30,6 @@ object SharedPreferenceUtil {
|
||||
}
|
||||
|
||||
fun hasGuide(): Boolean {
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(HAS_GUIDE, false)
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(getSpGuide(), false)
|
||||
}
|
||||
}
|
||||
@@ -473,19 +473,17 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
return;
|
||||
}
|
||||
|
||||
// 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 (descriptor == StatusDescriptor.UPLOADING&&DebugConfig.isLauncher()) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package com.mogo.module.guide.util
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.utils.storage.SharedPrefsMgr
|
||||
|
||||
object SharedPreferenceUtil {
|
||||
|
||||
const val HAS_GUIDE = "HAS_GUIDE"
|
||||
|
||||
fun hasGuide(): Boolean {
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(HAS_GUIDE, false)
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(DebugConfig.getSpGuide(), false)
|
||||
}
|
||||
|
||||
fun setGuideFinish() {
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).putBoolean(HAS_GUIDE, true)
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).putBoolean(DebugConfig.getSpGuide(), true)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
|
||||
android:padding="@dimen/module_main_event_fragment_container_padding" />
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_message_history_fragment_container"
|
||||
|
||||
@@ -25,6 +25,5 @@
|
||||
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">635px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_width">1263px</dimen>
|
||||
<dimen name="module_main_event_fragment_container_padding">10px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -25,5 +25,4 @@
|
||||
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">340px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_width">1313px</dimen>
|
||||
<dimen name="module_main_event_fragment_container_padding">10px</dimen>
|
||||
</resources>
|
||||
@@ -25,6 +25,5 @@
|
||||
<dimen name="module_main_entrance_fragment_container_padding">16px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_width">658px</dimen>
|
||||
<dimen name="module_main_event_fragment_container_padding">4px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -204,19 +204,21 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
|
||||
});
|
||||
}
|
||||
|
||||
// ServiceApisManager.serviceApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.ACC_STATUS, new IMogoStatusChangedListener() {
|
||||
// @Override
|
||||
// public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
// if (isTrue) {
|
||||
// queryShareConfigRetryTime = 0;
|
||||
// queryShareButtonConfig();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// // 获取分享框配置信息
|
||||
// queryShareConfigRetryTime = 0;
|
||||
// queryShareButtonConfig();
|
||||
if(!DebugConfig.isLauncher()) {
|
||||
ServiceApisManager.serviceApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.ACC_STATUS, new IMogoStatusChangedListener() {
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (isTrue) {
|
||||
queryShareConfigRetryTime = 0;
|
||||
queryShareButtonConfig();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 获取分享框配置信息
|
||||
queryShareConfigRetryTime = 0;
|
||||
queryShareButtonConfig();
|
||||
}
|
||||
Logger.d(TAG,"init over====");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.module.share.constant.ACCIDENT_STRATEGY_SHARE_PUSH_TYPE
|
||||
import com.mogo.module.share.constant.S_TAG
|
||||
import com.mogo.module.share.strategyreceiver.AccidentStrategyReceiver
|
||||
@@ -26,10 +27,12 @@ class StrategyShareProvider : IProvider {
|
||||
blockStrategy = BlockStrategy(context, apis)
|
||||
// 注册事故
|
||||
apis.getSocketManagerApi(context).registerOnMessageListener(ACCIDENT_STRATEGY_SHARE_PUSH_TYPE, AccidentStrategyReceiver(apis))
|
||||
apis.registerCenterApi.registerMogoLocationListener(MogoServicePaths.PATH_STRATEGY_SHARE){
|
||||
if(!DebugConfig.isLauncher()) {
|
||||
apis.registerCenterApi.registerMogoLocationListener(MogoServicePaths.PATH_STRATEGY_SHARE) {
|
||||
// Logger.d(S_TAG,"定位发生变化,准备记录速度: ${it.speed}")
|
||||
|
||||
blockStrategy.recordSpeed(it.speed * 3.6F)
|
||||
blockStrategy.recordSpeed(it.speed * 3.6F)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,32 +19,45 @@ import com.mogo.utils.logger.Logger
|
||||
* 上报工具类
|
||||
*/
|
||||
object UploadHelper {
|
||||
fun upload(context:Context, type: TanluUploadParams,forcePlayVoice:Boolean = false) {
|
||||
if(ServiceApisManager.serviceApis.statusManagerApi.isUploading){
|
||||
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
|
||||
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
|
||||
// Logger.d("UploadHelper", "正在上报===")
|
||||
// TipToast.tip("正在上报,请稍后重试")
|
||||
}else {
|
||||
// 判断当前网络状态
|
||||
if(NetworkUtils.isConnected(context)) {
|
||||
// 有网就正常上报
|
||||
fun upload(context: Context, type: TanluUploadParams, forcePlayVoice: Boolean = false) {
|
||||
if (DebugConfig.isLauncher()) {
|
||||
if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
|
||||
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
|
||||
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("感谢分享,正在上传")
|
||||
// }
|
||||
// 上报即成功
|
||||
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
|
||||
if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ || forcePlayVoice) {
|
||||
// 因为思必驰语音分享时,语音助手会自己播报一段文字
|
||||
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)
|
||||
}else{
|
||||
// 没网就直接提示失败
|
||||
AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络")
|
||||
TipToast.tip("分享失败,请检查网络", TipDrawable(context.resources.getDrawable(R.drawable.module_share_upload_fail)))
|
||||
}
|
||||
} else {
|
||||
if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
|
||||
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
|
||||
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
|
||||
} else {
|
||||
// 判断当前网络状态
|
||||
if (NetworkUtils.isConnected(context)) {
|
||||
// 有网就正常上报
|
||||
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
|
||||
// 上报即成功
|
||||
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("分享失败,请检查网络")
|
||||
TipToast.tip("分享失败,请检查网络", TipDrawable(context.resources.getDrawable(R.drawable.module_share_upload_fail)))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.module.tanlu.model.event.MarkerInfo
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
@@ -20,8 +21,9 @@ 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)
|
||||
// 此处不接收抓取完成的广播,1.1.5的需求是触发即分享成功,所以此处逻辑暂时注释,待日后看情况放开
|
||||
// EventBus.getDefault().post(MarkerInfo(type, imageUrl,lon, lat, custom, fromType))
|
||||
if(DebugConfig.isLauncher()) {
|
||||
EventBus.getDefault().post(MarkerInfo(type, imageUrl, lon, lat, custom, fromType))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.commons.debug.DebugConfig.getSpGuide;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-10
|
||||
@@ -79,7 +81,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
// TODO: 2020/9/4 和引导模块交互
|
||||
if ( DebugConfig.isLoadGuideModule() ) {
|
||||
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( "HAS_GUIDE", false ) ) {
|
||||
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( getSpGuide(), false ) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class SkinSupportInstaller implements IMogoSkinSupportInstaller {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppCompatDelegate getSkinAppCompatDelegate( AppCompatActivity activity, AppCompatCallback callback ) {
|
||||
public AppCompatDelegate getSkinAppCompatDelegate( AppCompatActivity activity,AppCompatDelegate superDelegate, AppCompatCallback callback ) {
|
||||
return SkinAppCompatDelegateImpl.get( activity, callback );
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ class SkinSupportInstaller implements IMogoSkinSupportInstaller {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppCompatDelegate getSkinAppCompatDelegate( AppCompatActivity activity, AppCompatCallback callback ) {
|
||||
return activity.getDelegate();
|
||||
public AppCompatDelegate getSkinAppCompatDelegate( AppCompatActivity activity,AppCompatDelegate superDelegate, AppCompatCallback callback ) {
|
||||
return superDelegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,5 +21,5 @@ interface IMogoSkinSupportInstaller extends IProvider {
|
||||
|
||||
void loadSkin( SkinMode skinMode );
|
||||
|
||||
AppCompatDelegate getSkinAppCompatDelegate( AppCompatActivity activity, AppCompatCallback callback );
|
||||
AppCompatDelegate getSkinAppCompatDelegate( AppCompatActivity activity,AppCompatDelegate superDelegate, AppCompatCallback callback );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user