opt search

This commit is contained in:
lixiaopeng
2021-04-12 18:11:04 +08:00
parent 4bc8afccd9
commit 92cba09cef
3 changed files with 97 additions and 31 deletions

View File

@@ -155,19 +155,19 @@ LOGLIB_VERSION = 1.0.4
######## MogoAiCloudSDK Version
# 网络请求
MOGO_NETWORK_VERSION=1.0.67
MOGO_NETWORK_VERSION=1.0.69
# 鉴权
MOGO_PASSPORT_VERSION=1.0.67
MOGO_PASSPORT_VERSION=1.0.69
# 常链接
MOGO_SOCKET_VERSION=1.0.67
MOGO_SOCKET_VERSION=1.0.69
# 数据采集
MOGO_REALTIME_VERSION=1.0.67
MOGO_REALTIME_VERSION=1.0.69
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.0.67
MOGO_TANLU_VERSION=1.0.69
# 直播推流
MOGO_LIVE_VERSION=1.0.67
MOGO_LIVE_VERSION=1.0.69
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.0.67
MOGO_TRAFFICLIVE_VERSION=1.0.69
######## Foundation MogoAiCloud Module
# mogoAiCloud apk services

View File

@@ -12,8 +12,8 @@ import android.view.animation.AccelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import com.mogo.cloud.tanlu.bean.MarkerExploreWay;
import com.mogo.cloud.tanlu.bean.location.MarkerLocation;
import com.mogo.cloud.tanlu.bean.MarkerExploreWayCloud;
import com.mogo.cloud.tanlu.bean.MarkerExploreWayItemCloud;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.location.MogoLocation;
@@ -33,8 +33,11 @@ import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
import com.mogo.map.search.poisearch.MogoPoiResult;
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
import com.mogo.map.uicontroller.IMogoMapUIController;
//import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerExploreWayItem;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.MarkerUserInfo;
import com.mogo.module.share.bean.VoiceCmdData;
import com.mogo.module.share.bean.event.MarkerInfo;
import com.mogo.module.share.callback.RoadInfoCallback;
@@ -290,14 +293,15 @@ public class TanluManager implements IMogoMarkerClickListener,
if (voiceData != null) {
mTanluModelData.queryRodeInfo(mContext, mKeywords, voiceData, new RoadInfoCallback() {
@Override
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWayCloud> roadInfoList) {
if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
Logger.e(TAG, "onQueryRoadInfoSuccess roadInfoList == null ");
if (TextUtils.equals(mKeywords, "附近")) {
speakFailVoice("未发现附近的特殊路况");
} else {
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
}
moveToMarcker(currentLat, currentLon);
moveToMarker(currentLat, currentLon);
return;
}
Logger.d(TAG, "onQueryRoadInfoSuccess roadInfoList.size() = " + roadInfoList.size()
@@ -306,7 +310,8 @@ public class TanluManager implements IMogoMarkerClickListener,
if (location != null) {
mCity = location.getCityName();
}
addMarkersAction((List<MarkerExploreWay>) roadInfoList, currentLat, currentLon);
addMarkersAction(convertMarkerExploreWayList((List<MarkerExploreWayCloud>) roadInfoList), currentLat, currentLon);
}
@Override
@@ -318,7 +323,7 @@ public class TanluManager implements IMogoMarkerClickListener,
} else {
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
}
moveToMarcker(currentLat, currentLon);
moveToMarker(currentLat, currentLon);
}
@Override
@@ -330,6 +335,79 @@ public class TanluManager implements IMogoMarkerClickListener,
}
}
/**
* 列表转换
* @param list
* @return
*/
private List<MarkerExploreWay> convertMarkerExploreWayList(List<MarkerExploreWayCloud> list) {
List<MarkerExploreWay> convertList = new ArrayList<>();
if (list != null && list.size() != 0) {
Log.d(TAG, "--------1--------");
for (int i = 0; i < list.size(); i++) {
MarkerExploreWayCloud exploreWayCloud = list.get(i);
Log.d(TAG, "--------2--------");
if (exploreWayCloud != null) {
Log.d(TAG, "--------3--------");
MarkerExploreWay exploreWay = new MarkerExploreWay();
exploreWay.setInfoId(exploreWayCloud.getInfoId());
exploreWay.setType(exploreWayCloud.getType());
exploreWay.setPoiType(exploreWayCloud.getPoiType());
exploreWay.setSn(exploreWayCloud.getSn());
MarkerLocation location = new MarkerLocation();
location.setLon(exploreWayCloud.getLocation().getLon());
location.setLat(exploreWayCloud.getLocation().getLat());
exploreWay.setLocation(location);
exploreWay.setDirection((int)exploreWayCloud.getDirection());
exploreWay.setCanLive(exploreWayCloud.getCanLive());
exploreWay.setFileType((int)exploreWayCloud.getFileType());
exploreWay.setAddr(exploreWayCloud.getAddr());
exploreWay.setGenerateTime(exploreWayCloud.getGenerateTime());
exploreWay.setCityName(exploreWayCloud.getCityName());
exploreWay.setDistance(exploreWayCloud.getDistance());
exploreWay.setFabulous(exploreWayCloud.isFabulous());
exploreWay.setInfoCheckNode(exploreWayCloud.getInfoCheckNode());
exploreWay.setUploadType(exploreWayCloud.getUploadType());
MarkerUserInfo userInfo = new MarkerUserInfo();
userInfo.setAge(Integer.valueOf(exploreWayCloud.getUserInfo().getAge()));
userInfo.setGender(exploreWayCloud.getUserInfo().getGender());
userInfo.setLastActiveweekAvgscore(exploreWayCloud.getUserInfo().getLastActiveweekAvgscore());
userInfo.setSafeLabel(exploreWayCloud.getUserInfo().getSafeLabel());
userInfo.setSn(exploreWayCloud.getUserInfo().getSn());
userInfo.setUserHead(exploreWayCloud.getUserInfo().getUserHead());
userInfo.setUserId(exploreWayCloud.getUserInfo().getUserId());
userInfo.setUserName(exploreWayCloud.getUserInfo().getUserName());
exploreWay.setUserInfo(userInfo);
List<MarkerExploreWayItem> items = new ArrayList<>();
if (exploreWayCloud.getItems() != null && exploreWayCloud.getItems().size() > 0) {
Log.d(TAG, "--------4----------");
for (int j = 0; j < exploreWayCloud.getItems().size(); j++) {
MarkerExploreWayItemCloud cloudItem = exploreWayCloud.getItems().get(j);
MarkerExploreWayItem item = new MarkerExploreWayItem();
item.setContent(cloudItem.getContent());
item.setIllegalCount(cloudItem.getIllegalCount());
item.setThumbnail(cloudItem.getThumbnail());
item.setUrl(cloudItem.getUrl());
items.add(item);
}
}
convertList.add(exploreWay);
}
}
markerExploreWayList.addAll(convertList);
Log.d(TAG, "--------5--------- markerExploreWayList.size() =" + markerExploreWayList.size());
} else {
Logger.e(TAG, "convertMarkerExploreWayList list == null ");
}
return convertList;
}
/**
* 添加marker
*/
@@ -341,7 +419,7 @@ public class TanluManager implements IMogoMarkerClickListener,
if (mMogoStatusManager != null) {
mMogoStatusManager.setUserInteractionStatus(ShareConstants.MODEL_NAME, true, true);
}
moveToMarcker(lat, lon);
moveToMarker(lat, lon);
inputlon = lon;
inputlat = lat;
@@ -364,7 +442,7 @@ public class TanluManager implements IMogoMarkerClickListener,
markerShowEntity.setBindObj(markerExploreWayList.get(i));
markerShowEntity.setTextContent(list.get(i).getAddr());
markerShowEntity.setMarkerLocation(getLocation(markerExploreWayList.get(i).getLocation()));
markerShowEntity.setMarkerLocation(markerExploreWayList.get(i).getLocation());
markerShowEntity.setMarkerType(ShareConstants.MODEL_NAME);
TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity);
@@ -383,16 +461,6 @@ public class TanluManager implements IMogoMarkerClickListener,
//直接使用当前数据list作为切换的数据源切换左侧列表到最新的数据
}
private com.mogo.module.common.entity.MarkerLocation getLocation(MarkerLocation location) {
com.mogo.module.common.entity.MarkerLocation markerLocation = new com.mogo.module.common.entity.MarkerLocation();
markerLocation.setLat(location.getLat());
markerLocation.setLon(location.getLon());
markerLocation.setAddress(location.getAddress());
markerLocation.setAngle(location.getAngle());
return markerLocation;
}
/**
* marker动画
@@ -426,7 +494,7 @@ public class TanluManager implements IMogoMarkerClickListener,
}, delay);
}
private void moveToMarcker(double lat, double lon) {
private void moveToMarker(double lat, double lon) {
Logger.d(TAG, "moveToMarcker lat = " + lat + " >>>>lon = " + lon);
MogoLatLng latLng = new MogoLatLng(lat, lon);
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);

View File

@@ -1,13 +1,11 @@
package com.mogo.module.share.callback
//import com.mogo.module.common.entity.MarkerExploreWay
import com.mogo.cloud.tanlu.bean.MarkerExploreWay
import com.mogo.cloud.tanlu.bean.MarkerExploreWayCloud
interface RoadInfoCallback {
fun onLocatSuccess(lat: Double, lon: Double)
fun onQueryRoadInfoSuccess(roadInfoList:List<MarkerExploreWay>)
fun onQueryRoadInfoSuccess(roadInfoList:List<MarkerExploreWayCloud>)
fun onQueryRoadInfoFail(msg: String, code: Int)
}