opt
This commit is contained in:
@@ -25,9 +25,6 @@ class StrategyShareProvider : IProvider {
|
||||
private lateinit var blockStrategy: BlockStrategy
|
||||
|
||||
override fun init(context: Context) {
|
||||
TanluServiceManager.init(context)
|
||||
TanluManager.getInstance(context).init()
|
||||
|
||||
Logger.d(S_TAG, "策略上报Provider初始化====")
|
||||
val apis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context) as IMogoServiceApis
|
||||
blockStrategy = BlockStrategy(context, apis)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.module.share.bean.event.MarkerInfo;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.service.share.IMogoTanluUiProvider;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = ShareConstants.TAG )
|
||||
public class TanluCardViewProvider implements IMogoTanluUiProvider {
|
||||
|
||||
private static final String TAG = "TanluCardViewProvider";
|
||||
private Context mContext;
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
mContext = context;
|
||||
TanluServiceManager.init(context);
|
||||
TanluManager.getInstance(context).init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
|
||||
Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
|
||||
Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
|
||||
"city: " + city + " keywords: " + keywords);
|
||||
Intent intent = new Intent(intentStr);
|
||||
intent.putExtra("data", data);
|
||||
intent.putExtra("city", city);
|
||||
intent.putExtra("keywords", keywords);
|
||||
Thread.sleep(3000);
|
||||
emitter.onSuccess(intent);
|
||||
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
|
||||
Logger.d(TAG, "searchRoadCondition---go real share");
|
||||
TanluManager.getInstance(mContext).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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -62,12 +62,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.mogo.module.share.constant.ShareConstants.SPECIFIEDROAD_SEARCH;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TXZ_SPECIFIEDROAD_SEARCH;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_NAME_BLOCK;
|
||||
@@ -82,6 +76,7 @@ import static com.mogo.module.share.constant.ShareConstants.VOICE_COMMAND_QUERY_
|
||||
* @description 探路和新鲜事的view
|
||||
* @since 2020/5/19
|
||||
*/
|
||||
|
||||
public class TanluManager implements IMogoMarkerClickListener,
|
||||
IMogoPoiSearchListener,
|
||||
IMogoGeoSearchListener {
|
||||
@@ -139,27 +134,33 @@ public class TanluManager implements IMogoMarkerClickListener,
|
||||
initListener();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void init(Context context) {
|
||||
//
|
||||
// }
|
||||
|
||||
public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
|
||||
Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
|
||||
Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
|
||||
"city: " + city + " keywords: " + keywords);
|
||||
Intent intent = new Intent(intentStr);
|
||||
intent.putExtra("data", data);
|
||||
intent.putExtra("city", city);
|
||||
intent.putExtra("keywords", keywords);
|
||||
Thread.sleep(3000);
|
||||
emitter.onSuccess(intent);
|
||||
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
|
||||
Logger.d(TAG, "searchRoadCondition---go real share");
|
||||
realShare(intentStr, intent);
|
||||
});
|
||||
}
|
||||
|
||||
public void shareSuccess(String poiType, MogoLatLng location) {
|
||||
MarkerInfo markerInfo = new MarkerInfo(poiType, "", location.lon, location.lat, true, "1");
|
||||
EventBus.getDefault().post(markerInfo);
|
||||
}
|
||||
// @Override
|
||||
// public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
|
||||
// Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
|
||||
// Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
|
||||
// "city: " + city + " keywords: " + keywords);
|
||||
// Intent intent = new Intent(intentStr);
|
||||
// intent.putExtra("data", data);
|
||||
// intent.putExtra("city", city);
|
||||
// intent.putExtra("keywords", keywords);
|
||||
// Thread.sleep(3000);
|
||||
// emitter.onSuccess(intent);
|
||||
// }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
|
||||
// Logger.d(TAG, "searchRoadCondition---go real share");
|
||||
// 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);
|
||||
// }
|
||||
|
||||
private void initInterface() {
|
||||
//地图marker,地图操作
|
||||
|
||||
@@ -47,7 +47,8 @@ object UploadHelper {
|
||||
// 有网就正常上报
|
||||
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
|
||||
// 上报即成功
|
||||
TanluManager.getInstance(context).shareSuccess(type.eventType, type.location)
|
||||
// TanluManager.getInstance(context).shareSuccess(type.eventType, type.location)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user