Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0
This commit is contained in:
@@ -203,20 +203,16 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
//地图marker
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getActivity());
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getContext());
|
||||
|
||||
//切换卡片操作
|
||||
iMogoCardManager = (IMogoCardManager) ARouter.getInstance().build(MogoServicePaths.PATH_CARD_MANAGER).navigation(getActivity());
|
||||
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
|
||||
mMogoRegisterCenter.registerMogoModuleLifecycle(TanluConstants.MODEL_NAME, this);
|
||||
|
||||
//唤醒
|
||||
mogoIntentManager = (IMogoIntentManager) ARouter.getInstance().build(MogoServicePaths.PATH_INTENT_MANAGER).navigation(getContext());
|
||||
|
||||
//地图操作
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getContext());
|
||||
mMApUIController = mMogoMapService.getMapUIController();
|
||||
mGeocodeSearch = new GeocodeSearch(getContext());
|
||||
|
||||
mMogoStatusManager = (IMogoStatusManager) ARouter.getInstance().build(MogoServicePaths.PATH_STATUS_MANAGER).navigation(getContext());
|
||||
|
||||
//poi查询
|
||||
@@ -314,7 +310,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化导航 TODO
|
||||
* 初始化导航
|
||||
*/
|
||||
private void initMap() {
|
||||
mMogoRegisterCenter.registerMogoNaviListener(TanluConstants.MODEL_NAME, new IMogoNaviListener() {
|
||||
@@ -328,7 +324,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -339,22 +334,18 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoCalculateFailed() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic( MogoTraffic traffic ) {
|
||||
|
||||
public void onUpdateTraffic(MogoTraffic traffic) {
|
||||
}
|
||||
});
|
||||
|
||||
@@ -417,7 +408,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
//唤醒
|
||||
mogoIntentManager.registerIntentListener(TanluConstants.UPLOAD_ROAD_CONDITION, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(TanluConstants.SPECIFIEDROAD_SEARCH, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(TanluConstants.PLAY_VIDEO, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(TanluConstants.SHARE_ROAD_CLOSURE, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(TanluConstants.SHARE_TRAFFIC_CHECK, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(TanluConstants.GO_TO_SHARE, mogoIntentListener);
|
||||
@@ -432,7 +422,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
String data = intent.getStringExtra("data");
|
||||
Logger.e(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
|
||||
if (intentStr.equals(TanluConstants.SPECIFIEDROAD_SEARCH)) { //地点堵不堵 ok
|
||||
if (intentStr.equals(TanluConstants.SPECIFIEDROAD_SEARCH)) { //地点堵不堵 --ok
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(data);
|
||||
mKeywords = jsonObject.get("location").toString();
|
||||
@@ -441,20 +431,17 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (intentStr.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) { //上报路况 免唤醒 ok
|
||||
} else if (intentStr.equals(TanluConstants.UPLOAD_ROAD_CONDITION)) { //上报路况 免唤醒 --ok
|
||||
sendShareReceiver("1");
|
||||
Logger.d(TAG, "mogoIntentListener 上报路况 ----> ");
|
||||
} else if (intentStr.equals(TanluConstants.PLAY_VIDEO)) { //播放视频 免唤醒
|
||||
Logger.d(TAG, "mogoIntentListener 播放视频 ----> ");
|
||||
//TODO
|
||||
|
||||
} else if (intentStr.equals(TanluConstants.SHARE_ROAD_CLOSURE)) { //分享封路
|
||||
} else if (intentStr.equals(TanluConstants.SHARE_ROAD_CLOSURE)) { //分享封路 --ok
|
||||
sendShareReceiver("3");
|
||||
Logger.d(TAG, "mogoIntentListener 分享封路 ----> ");
|
||||
} else if (intentStr.equals(TanluConstants.SHARE_TRAFFIC_CHECK)) { //分享交通检查
|
||||
} else if (intentStr.equals(TanluConstants.SHARE_TRAFFIC_CHECK)) { //分享交通检查 --ok
|
||||
sendShareReceiver("2");
|
||||
Logger.d(TAG, "mogoIntentListener 分享交通检查 ----> ");
|
||||
} else if (intentStr.equals(TanluConstants.GO_TO_SHARE)) { //我要分享
|
||||
} else if (intentStr.equals(TanluConstants.GO_TO_SHARE)) { //我要分享 --ok
|
||||
ShareControl shareControl = new ShareControl();
|
||||
shareControl.showDialog(getActivity());
|
||||
Logger.d(TAG, "mogoIntentListener 我要分享 ----> ");
|
||||
@@ -469,8 +456,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() {
|
||||
@Override
|
||||
public void onCmdSelected(String cmd) {
|
||||
Logger.e(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd);
|
||||
if (cmd.equals(TanluConstants.PLAY_VIDEO)) {
|
||||
Logger.d(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd);
|
||||
if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok
|
||||
//TODO
|
||||
|
||||
}
|
||||
@@ -478,22 +465,18 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
@Override
|
||||
public void onCmdAction(String speakText) {
|
||||
Logger.d(TAG, "免唤醒 onCmdAction speakText =" + speakText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdCancel(String speakText) {
|
||||
Logger.d(TAG, "免唤醒 onCmdCancel speakText =" + speakText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeakEnd(String speakText) {
|
||||
Logger.e(TAG, "免唤醒 onSpeakEnd speakText =" + speakText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeakSelectTimeOut(String speakText) {
|
||||
Logger.e(TAG, "免唤醒 onSpeakSelectTimeOut speakText =" + speakText);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -678,7 +661,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
}
|
||||
|
||||
/**
|
||||
* C位事件,如何获取数据,需要有默认数据 TODO
|
||||
* C位事件,如何获取数据,需要有默认数据
|
||||
* 如果只有一个数据,不显示上下切换按钮,没有数据显示空页面
|
||||
*/
|
||||
@Override
|
||||
@@ -802,7 +785,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter);
|
||||
TanluServiceHandler.getLocationClient().removeLocationListener(this);
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME);
|
||||
mogoIntentManager.unregisterIntentListener(MogoReceiver.ACTIION_ADAS );
|
||||
mogoIntentManager.unregisterIntentListener(MogoReceiver.ACTIION_ADAS);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -813,30 +796,36 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMarkerInfo(final MarkerInfo event) {
|
||||
Logger.d(TAG, "onMarkerInfo ------------>");
|
||||
if (event.type.equals("1")) { //上报路况
|
||||
if (event == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String poiType = "";
|
||||
if (event.type.equals("1")) { //上报路况 TODO 修改探路
|
||||
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up);
|
||||
} else if (event.type.equals("2")) { //交通检查
|
||||
} else if (event.type.equals("2")) { //交通检查 10002
|
||||
poiType = "10002";
|
||||
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_traffic_check);
|
||||
} else if (event.type.equals("3")) { //封路
|
||||
} else if (event.type.equals("3")) { //封路 10003
|
||||
poiType = "10003";
|
||||
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_road_closure);
|
||||
} else {
|
||||
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up);
|
||||
}
|
||||
|
||||
Logger.d(TAG, "onMarkerInfo onCompleted ------>");
|
||||
Logger.d(TAG, "onMarkerInfo share onCompleted ------>");
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon(mMarkerIcon)
|
||||
.latitude(event.lat)
|
||||
.owner(TanluConstants.MODEL_NAME)
|
||||
.longitude(event.lon);
|
||||
IMogoMarker marker = mMarkerManager.addMarker("share_tag", options); //随便传tag,不可点击
|
||||
//TODO 请求分享接口
|
||||
//请求分享接口
|
||||
MarkerExploreWay markerExploreWay = markerExploreWayList.get(0);
|
||||
if (markerExploreWay.getUserInfo() != null) {
|
||||
|
||||
uploadShareInfo(poiType, event.imageUrl, markerExploreWay.getUserInfo().getUserName(),
|
||||
markerExploreWay.getUserInfo().getUserHead());
|
||||
}
|
||||
uploadShareInfo(markerExploreWay.getType(), "", markerExploreWay.getUserInfo().getUserName(),
|
||||
markerExploreWay.getUserInfo().getUserHead());
|
||||
}
|
||||
|
||||
|
||||
@@ -858,7 +847,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
@Override
|
||||
public void onFail(String message, int code) {
|
||||
Logger.d(TAG, "uploadShareInfo onFail ----->");
|
||||
Logger.e(TAG, "uploadShareInfo onFail ----->");
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(getString(R.string.tanlu_share_failed), null);
|
||||
}
|
||||
});
|
||||
@@ -948,7 +937,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制线路 TODO
|
||||
* 绘制线路
|
||||
*/
|
||||
private void drawMapLine(List<Center> pointList) {
|
||||
int intervalNum = Utils.getIntervalValue(pointList.size());
|
||||
@@ -986,6 +975,10 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
String discription = o.getResult().getDescription();
|
||||
Logger.d(TAG, "getVoiceControlRoadData discription = " + discription);
|
||||
if (o.getResult().getInformations() != null && o.getResult().getInformations().size() > 0) {
|
||||
if (markerExploreWayList != null && markerExploreWayList.size() > 0) {
|
||||
markerExploreWayList.clear(); //
|
||||
}
|
||||
|
||||
//切换到探路卡片
|
||||
if (!isCurrentPage) {
|
||||
//切换探路卡片
|
||||
|
||||
@@ -244,7 +244,7 @@ public class TanluModelData {
|
||||
|
||||
|
||||
/**
|
||||
* 上报交通检查和封路 TODO
|
||||
* 上报交通检查和封路
|
||||
*/
|
||||
public void addTrafficCheckInfo(String poiType, String poiImgUrl, String nickname, String headImgUrl,
|
||||
double lat, double lon, String address, final UploadShareCallback callback) {
|
||||
@@ -252,12 +252,11 @@ public class TanluModelData {
|
||||
UploadShareRoadInfo uploadShareRoadInfo = new UploadShareRoadInfo(poiType, poiImgUrl, nickname, headImgUrl, new Center(lat, lon), address);
|
||||
String uploadShareStr = gson.toJson(uploadShareRoadInfo);
|
||||
Logger.d(TAG, "addTrafficCheckInfo sn= " + getSn() + ">> uploadShareStr =" + uploadShareStr);
|
||||
|
||||
final Map<String, Object> params = new ParamsProvider.Builder(mContext)
|
||||
.append("sn", Utils.getSn())
|
||||
.append("data", uploadShareStr)
|
||||
.build();
|
||||
mTanluApiService.searchOnLineInformation(params)
|
||||
mTanluApiService.uploadCheckTrafficInfor(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(mContext)) {
|
||||
@@ -278,6 +277,7 @@ public class TanluModelData {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
e.printStackTrace();
|
||||
Logger.d(TAG, "addTrafficCheckInfo onError ------> e= " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -9,11 +9,11 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class MarkerInfo implements Serializable {
|
||||
public String type; //封路,还是上报
|
||||
public String imageUrl;
|
||||
public String imageUrl; //上传完cos图片
|
||||
public Long lon; //经度
|
||||
public Long lat; //纬度
|
||||
|
||||
public MarkerInfo(String type, /*String imageUrl,*/ Long lon, Long lat) {
|
||||
public MarkerInfo(String type, String imageUrl, Long lon, Long lat) {
|
||||
this.type = type;
|
||||
this.imageUrl = imageUrl;
|
||||
this.lon = lon;
|
||||
|
||||
@@ -14,10 +14,12 @@ class MarkerInfoReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == "com.zhidao.roadcondition.marker.info"){
|
||||
var type = intent.getStringExtra("type")
|
||||
var imageUrl = intent.getStringExtra("imageUrl")
|
||||
var lat = intent.getLongExtra("lat",0)
|
||||
var lon = intent.getLongExtra("lon",0) //经度
|
||||
Log.d("MarkerInfoReceiver", "type = $type ---->lat = $lat ---->lon = $lon")
|
||||
EventBus.getDefault().post(MarkerInfo(type, lon, lat))
|
||||
Log.d("MarkerInfoReceiver", "type = $type ---->lat = $lat ---->lon = $lon + " )
|
||||
Log.d("MarkerInfoReceiver", "")
|
||||
EventBus.getDefault().post(MarkerInfo(type, imageUrl,lon, lat))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.tanlu.video
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.mogo.module.tanlu.R
|
||||
@@ -102,6 +103,7 @@ class FullMediaActivity : AppCompatActivity(), View.OnClickListener {
|
||||
video_view.onCompletionListener(object :
|
||||
MediaCoverVideoPlayer.CompletionListener {
|
||||
override fun onCompletion() {
|
||||
Log.d("liyz", "FullMediaActivity ---- onCompletion ");
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
finish()
|
||||
}
|
||||
|
||||
@@ -136,15 +136,18 @@ class MediaCoverVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 多次回调? TODO
|
||||
* 多次回调 TODO
|
||||
*/
|
||||
override fun onCompletion() {
|
||||
Log.d("liyz", "onCompletion --------->")
|
||||
// completionListener.let {
|
||||
// it.onCompletion()
|
||||
// }
|
||||
super.onCompletion()
|
||||
Log.d("liyz", "MediaCoverVideoPlayer onCompletion --------->")
|
||||
completionListener.let {
|
||||
it.onCompletion()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
mFullPauseBitmap?.let {
|
||||
@@ -153,7 +156,9 @@ class MediaCoverVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
}
|
||||
mFullPauseBitmap = null
|
||||
Log.d("MediaCoverVideoPlayer", "recycle.")
|
||||
Log.d("liyz", "recycle.")
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user