opt
This commit is contained in:
@@ -10,4 +10,5 @@ public class TanluConstants {
|
||||
|
||||
public static final String TAG = "/tanlu/ui";
|
||||
public static final String NAVI_INFO = "navi_info";
|
||||
public static final String MODEL_NAME = "mogo-module-tanlu";
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
@@ -36,6 +38,8 @@ import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.tanlu.callback.AlongTheWayCallback;
|
||||
import com.mogo.module.tanlu.callback.RoadLineCallback;
|
||||
import com.mogo.module.tanlu.callback.VoiceSearchCallback;
|
||||
import com.mogo.module.tanlu.constant.HttpConst;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.module.tanlu.model.Information;
|
||||
import com.mogo.module.tanlu.model.InformationAndLiveCarResult;
|
||||
import com.mogo.module.tanlu.model.PathLineResult;
|
||||
@@ -54,6 +58,9 @@ import com.mogo.module.tanlu.model.event.MarkerInfo;
|
||||
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.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
@@ -117,6 +124,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
private Bitmap mMarkerIcon;
|
||||
private TanluModelData mTanluModelData;
|
||||
private List<MogoLatLng> passedByPoints;
|
||||
private IMogoRegisterCenter mMogoRegisterCenter;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -170,14 +178,61 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
EventBus.getDefault().register(this);
|
||||
mTanluModelData = new TanluModelData(getContext());
|
||||
handleRoadLineMessage();
|
||||
initMap();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理路线数据信息 TODO
|
||||
* 初始化导航 TODO
|
||||
*/
|
||||
private void initMap() {
|
||||
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
|
||||
mMogoRegisterCenter.registerMogoNaviListener(TanluConstants.MODEL_NAME, new IMogoNaviListener() {
|
||||
@Override
|
||||
public void onInitNaviFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitNaviSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
getNavigationLineData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoCalculateFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理路线数据信息,msgType TODO
|
||||
*/
|
||||
private void handleRoadLineMessage() {
|
||||
mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation();
|
||||
mMogoSocketManager.registerOnMessageListener(401001, new IMogoOnMessageListener<MarkerResponse>() {
|
||||
mMogoSocketManager.registerOnMessageListener(1, new IMogoOnMessageListener<MarkerResponse>() {
|
||||
@Override
|
||||
public Class<MarkerResponse> target() {
|
||||
return MarkerResponse.class;
|
||||
@@ -254,6 +309,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
MarkerExploreWay exploreWay = (MarkerExploreWay) marker.getObject();
|
||||
handleData(exploreWay);
|
||||
|
||||
//TODO 更新位置currentPosition
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -463,6 +520,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
EventBus.getDefault().unregister(this);
|
||||
getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter);
|
||||
TanluServiceHandler.getLocationClient().removeLocationListener(this);
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -540,7 +598,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
Logger.d(TAG, "passedByPoints.size() ----> " + passedByPoints.size());
|
||||
MogoLatLng startLatLng = new MogoLatLng(o.getPointList().get(0).getLat(), o.getPointList().get(0).getLon());
|
||||
MogoLatLng endLatLng = new MogoLatLng(o.getPointList().get(listSize - 1).getLat(), o.getPointList().get(listSize - 1).getLon());
|
||||
|
||||
mMarkerManager.addRouteWay(getContext(), startLatLng, endLatLng, passedByPoints);
|
||||
}
|
||||
}
|
||||
@@ -582,7 +639,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void speakSuccessVoice(List<Information> informations, String trafficStatus) {
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.mogo.module.tanlu.view;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.tanlu.R;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 通用分享dialog
|
||||
* @since 2020-01-10
|
||||
*/
|
||||
public class LaucherShareDialog extends Dialog implements View.OnClickListener {
|
||||
|
||||
private TextView txtOk;
|
||||
|
||||
|
||||
public LaucherShareDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public LaucherShareDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, R.style.Theme_AppCompat_Dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
initView();
|
||||
initListener();
|
||||
|
||||
txtOk.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// if (onOkListener != null) {
|
||||
// onOkListener.onClick(v);
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
setContentView(R.layout.launcher_dialog_share);
|
||||
txtOk = findViewById(R.id.btn_share_title);
|
||||
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
txtOk.setOnClickListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.btn_share_title) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setOnOkClickListener(View.OnClickListener onOkClickListener) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void setOnCancelListener(View.OnClickListener onCancelListener) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user