Merge branch 'dev_1.1.5' into dev

# Conflicts:
#	.idea/codeStyles/Project.xml
This commit is contained in:
tongchenfei
2020-08-31 15:28:58 +08:00
5 changed files with 45 additions and 27 deletions

View File

@@ -3,18 +3,9 @@
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
<package name="java.util" withSubpackages="false" static="false" />
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
<package name="io.ktor" withSubpackages="true" static="false" />
</value>
</option>
</JetCodeStyleSettings>

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
@@ -21,21 +22,26 @@ object UploadHelper {
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)) {
// 有网就正常上报
// 1.1.5的需求,上报即成功,所以不需要设定下面这个变量
// 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

@@ -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

@@ -1,6 +1,7 @@
package com.mogo.service.tanlu;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.map.MogoLatLng;
/**
* 探路相关ui provider
@@ -16,4 +17,11 @@ public interface IMogoTanluUiProvider extends IProvider {
* @param keywords 同行者-xx堵不堵-中关村
*/
void searchRoadCondition(String intentStr, String data, String city, String keywords);
/**
* 分享成功在界面上绘制分享的poi点只是用于打点并且这个点无法点击所以没有特别详细的信息
* @param poiType 事件类型
* @param location 事件坐标
*/
void shareSuccess(String poiType, MogoLatLng location);
}