Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
This commit is contained in:
@@ -16,15 +16,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.amap.api.services.core.LatLonPoint;
|
||||
import com.amap.api.services.core.PoiItem;
|
||||
import com.amap.api.services.geocoder.GeocodeAddress;
|
||||
import com.amap.api.services.geocoder.GeocodeQuery;
|
||||
import com.amap.api.services.geocoder.GeocodeResult;
|
||||
import com.amap.api.services.geocoder.GeocodeSearch;
|
||||
import com.amap.api.services.geocoder.RegeocodeResult;
|
||||
import com.amap.api.services.poisearch.PoiResult;
|
||||
import com.amap.api.services.poisearch.PoiSearch;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
@@ -33,7 +24,6 @@ import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -44,9 +34,17 @@ import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
import com.mogo.map.search.geo.MogoGeocodeResult;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeResult;
|
||||
import com.mogo.map.search.geo.query.MogoGeocodeQuery;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
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.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
@@ -56,9 +54,7 @@ import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.MarkerUserInfo;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.module.tanlu.R;
|
||||
import com.mogo.module.tanlu.callback.AlongTheWayCallback;
|
||||
import com.mogo.module.tanlu.callback.NaviCallback;
|
||||
import com.mogo.module.tanlu.callback.RoadLineCallback;
|
||||
import com.mogo.module.tanlu.callback.UploadShareCallback;
|
||||
@@ -66,7 +62,6 @@ import com.mogo.module.tanlu.callback.VoiceSearchCallback;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.module.tanlu.model.Center;
|
||||
import com.mogo.module.tanlu.model.Information;
|
||||
import com.mogo.module.tanlu.model.InformationAndLiveCarResult;
|
||||
import com.mogo.module.tanlu.model.Items;
|
||||
import com.mogo.module.tanlu.model.NaviResult;
|
||||
import com.mogo.module.tanlu.model.PathLineResult;
|
||||
@@ -75,13 +70,11 @@ import com.mogo.module.tanlu.model.VoiceSearchResult;
|
||||
import com.mogo.module.tanlu.model.event.MarkerInfo;
|
||||
import com.mogo.module.tanlu.model.event.PushTypeInfo;
|
||||
import com.mogo.module.tanlu.util.Utils;
|
||||
import com.mogo.module.tanlu.video.FullMediaActivity;
|
||||
import com.mogo.module.tanlu.video.SimpleCoverVideoPlayer;
|
||||
import com.mogo.module.tanlu.view.AutoZoomInImageView;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
@@ -127,17 +120,14 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
SimpleCoverVideoPlayer simpleCoverVideoPlayer;
|
||||
AutoZoomInImageView autoZoomInImageView;
|
||||
//map
|
||||
private IMogoMarker mPoiMarker;
|
||||
private IMogoMarkerManager mMarkerManager;
|
||||
private IMogoMapService mMogoMapService;
|
||||
private IMogoSocketManager mMogoSocketManager;
|
||||
private IMogoLocationClient mLocationClient;
|
||||
private IMogoCardManager iMogoCardManager;
|
||||
private IMogoStatusManager mMogoStatusManager;
|
||||
private IMogoIntentManager mogoIntentManager; //免唤醒
|
||||
private IMogoMapUIController mMApUIController;
|
||||
private GeocodeSearch mGeocodeSearch;
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private IMogoGeoSearch mIMogoGeoSearch;
|
||||
|
||||
//声音控制文字
|
||||
private String voiceGetInfoMationTts;
|
||||
@@ -196,51 +186,42 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
|
||||
autoZoomInImageView.setVisibility(View.GONE);
|
||||
|
||||
//视频点击
|
||||
// simpleCoverVideoPlayer.getStartButton().setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// Logger.d(TAG, "simpleCoverVideoPlayer onClick -------> ");
|
||||
// FullMediaActivity.Companion.launch(getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
private void initInterface() {
|
||||
//图片配置
|
||||
mogoImageloader = (IMogoImageloader) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_IMAGE_LOADER).navigation();
|
||||
//地图marker
|
||||
//地图marker,地图操作
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getActivity());
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getContext());
|
||||
mMApUIController = mMogoMapService.getMapUIController();
|
||||
//地图逆序
|
||||
mIMogoGeoSearch = mMogoMapService.getGeoSearch(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());
|
||||
mAnalytics = (IMogoAnalytics) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation(getContext());
|
||||
|
||||
//poi查询
|
||||
mGeocodeSearch.setOnGeocodeSearchListener(new GeocodeSearch.OnGeocodeSearchListener() {
|
||||
mIMogoGeoSearch.setGeoSearchListener(new IMogoGeoSearchListener() {
|
||||
@Override
|
||||
public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) {
|
||||
public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) {
|
||||
Logger.d(TAG, "onRegeocodeSearched -----> ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGeocodeSearched(GeocodeResult p0, int p1) {
|
||||
Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords + ">>p1 =" + p1);
|
||||
if (p1 == 1000) {
|
||||
if (p0.getGeocodeAddressList() != null && p0.getGeocodeAddressList().size() != 0) {
|
||||
GeocodeAddress geocodeAddress = p0.getGeocodeAddressList().get(0);
|
||||
LatLonPoint latLon = geocodeAddress.getLatLonPoint();
|
||||
public void onGeocodeSearched(MogoGeocodeResult geocodeResult) {
|
||||
Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords);
|
||||
if (geocodeResult != null) {
|
||||
if (geocodeResult.getAddresses() != null && geocodeResult.getAddresses().size() != 0) {
|
||||
MogoGeocodeAddress geocodeAddress = geocodeResult.getAddresses().get(0);
|
||||
MogoLatLng latLon = geocodeAddress.getLatlng();
|
||||
Double longit; //经度
|
||||
Double lat; //维度
|
||||
if (mKeywords.equals("附近")) {
|
||||
@@ -249,23 +230,22 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
} else {
|
||||
Logger.d(TAG, "其他 ---1----");
|
||||
longit = latLon.getLongitude();
|
||||
lat = latLon.getLatitude();
|
||||
longit = latLon.lng;
|
||||
lat = latLon.lat;
|
||||
}
|
||||
Log.d(TAG, "geoSearch keywords =" + mKeywords + ">>longitude= " + longit + "--latitude= " + lat);
|
||||
getVoiceControlRoadData(mKeywords, lat, longit);
|
||||
} else {
|
||||
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
|
||||
PoiSearch.Query query = new PoiSearch.Query(mKeywords, "", cityCode);
|
||||
PoiSearch poiSearch = new PoiSearch(getContext(), query);
|
||||
poiSearch.setOnPoiSearchListener(new PoiSearch.OnPoiSearchListener() {
|
||||
MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(mKeywords, "", cityCode);
|
||||
IMogoPoiSearch poiSearch = mMogoMapService.getPoiSearch(getContext(), poiSearchQuery);
|
||||
poiSearch.setPoiSearchListener(new IMogoPoiSearchListener() {
|
||||
@Override
|
||||
public void onPoiSearched(PoiResult p0, int p1) {
|
||||
Logger.d(TAG, "setOnPoiSearchListener--mKeywords =" + mKeywords + ">>p1 =" + p1);
|
||||
public void onPoiSearched(MogoPoiResult p0, int p1) {
|
||||
if (p1 == 1000) {
|
||||
if (p0.getPois() != null && p0.getPois().size() != 0) {
|
||||
PoiItem poi = p0.getPois().get(0);
|
||||
LatLonPoint latLon = poi.getLatLonPoint();
|
||||
MogoPoiItem poi = p0.getPois().get(0);
|
||||
MogoLatLng latLon = poi.getPoint();
|
||||
Double longit; //经度
|
||||
Double lat; //维度
|
||||
if (mKeywords.equals("附近")) {
|
||||
@@ -274,8 +254,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
} else {
|
||||
Logger.d(TAG, "其他 --2----");
|
||||
longit = latLon.getLongitude();
|
||||
lat = latLon.getLatitude();
|
||||
longit = latLon.lng;
|
||||
lat = latLon.lat;
|
||||
}
|
||||
getVoiceControlRoadData(mKeywords, lat, longit);
|
||||
Log.d(TAG, "setOnPoiSearchListener keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat);
|
||||
@@ -288,7 +268,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched(PoiItem poiItem, int i) {
|
||||
public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
|
||||
|
||||
}
|
||||
});
|
||||
@@ -407,14 +387,14 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
* @return
|
||||
*/
|
||||
private void handleActionFoo(String keywords) {
|
||||
Log.d(TAG, "handleActionFoo keywords = " + keywords);
|
||||
speakSearchingVoice();
|
||||
GeocodeQuery geocodeQuery;
|
||||
MogoGeocodeQuery geocodeQuery;
|
||||
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
|
||||
|
||||
geocodeQuery = new GeocodeQuery(keywords, cityCode);
|
||||
geocodeQuery = new MogoGeocodeQuery();
|
||||
geocodeQuery.setLocationName(keywords);
|
||||
mGeocodeSearch.getFromLocationNameAsyn(geocodeQuery);
|
||||
geocodeQuery.setCity(cityCode);
|
||||
mIMogoGeoSearch.getFromLocationNameAsyn(geocodeQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -435,7 +415,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
String data = intent.getStringExtra("data");
|
||||
Logger.e(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
|
||||
Logger.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
|
||||
if (intentStr.equals(TanluConstants.SPECIFIEDROAD_SEARCH)) { //地点堵不堵 --ok
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(data);
|
||||
@@ -475,12 +455,11 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() {
|
||||
@Override
|
||||
public void onCmdSelected(String cmd) {
|
||||
Log.d(TAG, "com.zhidao.tanlu.play ------->" + cmd);
|
||||
Log.d(TAG, "mogoVoiceListener cmd = " + cmd);
|
||||
if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok
|
||||
gsyVideoOptionBuilder.setUrl(mVideoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
.build(simpleCoverVideoPlayer);
|
||||
simpleCoverVideoPlayer.getStartButton().performClick();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,7 +640,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
mGenerateTime = markerExploreWay.getGenerateTime();
|
||||
mTitle = markerExploreWay.getAddr();
|
||||
mAddressTv.setText(markerExploreWay.getAddr());
|
||||
Log.d(TAG, "refreshVideoData addr = " + markerExploreWay.getAddr());
|
||||
mDistanceTv.setText(handleDistance(markerExploreWay.getDistance()));
|
||||
mTimeTv.setText(formatDate(markerExploreWay.getGenerateTime()));
|
||||
//判断是图片还是视频,第一个时,上一个不可点击
|
||||
@@ -669,7 +647,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
|
||||
//视频配置
|
||||
mVideoUrl = videoUrl;
|
||||
Log.d(TAG, "refreshVideoData mVideoUrl = " + mVideoUrl);
|
||||
simpleCoverVideoPlayer.loadCoverImage(mImageUrl, getContext());
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
.build(simpleCoverVideoPlayer);
|
||||
@@ -1141,7 +1118,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
.longitude(informationList.get(i).lon);
|
||||
|
||||
optionList.add(options);
|
||||
Log.d(TAG, "lat =" + informationList.get(i).lat + ">>>lon =" + informationList.get(i).lon);
|
||||
// Log.d(TAG, "getVoiceControlRoadData lat =" + informationList.get(i).lat + ">>>lon =" + informationList.get(i).lon);
|
||||
}
|
||||
Logger.d(TAG, "getVoiceControlRoadData optionList.size() = " + optionList.size());
|
||||
mMarkerManager.addMarkers(TanluConstants.MODEL_NAME, optionList, true);
|
||||
|
||||
Reference in New Issue
Block a user