[Upload]
删除目的地车友相关功能 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -27,7 +27,7 @@ import com.mogo.commons.debug.DebugConfig.getNetMode
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.BadCaseEntity.Reason
|
||||
import com.mogo.eagle.core.network.RetrofitFactory
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
@@ -127,11 +127,11 @@ class PostResult {
|
||||
private fun getHost(): String = if (getNetMode() == DebugConfig.NET_MODE_RELEASE) "http://dzt.zhidaozhixing.com" else "http://front.zdjs-private-test.myghost.zhidaoauto.com"
|
||||
|
||||
internal suspend fun post(map: Map<String, String>): Response<PostResult> {
|
||||
return RetrofitFactory.getInstance(getHost()).create(BadCaseApi::class.java).post(map)
|
||||
return MoGoRetrofitFactory.getInstance(getHost()).create(BadCaseApi::class.java).post(map)
|
||||
}
|
||||
|
||||
private suspend fun get(): Response<BadCaseEntity>? {
|
||||
return try { RetrofitFactory.getInstance(getHost()).create(BadCaseApi::class.java).get() } catch (t: Throwable) { t.printStackTrace(); null}
|
||||
return try { MoGoRetrofitFactory.getInstance(getHost()).create(BadCaseApi::class.java).get() } catch (t: Throwable) { t.printStackTrace(); null}
|
||||
}
|
||||
|
||||
private suspend fun updateCache(entity: BadCaseEntity) = suspendCancellableCoroutine<Unit> {
|
||||
|
||||
@@ -306,9 +306,8 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addBaseModule(new MogoModule(UpgradeReportConstants.PATH, UpgradeReportConstants.NAME));
|
||||
// 初始化 apm 日志采集
|
||||
MogoModulePaths.addBaseModule(new MogoModule(CrashReportConstants.PATH, CrashReportConstants.NAME));
|
||||
if (DebugConfig.isMapBased()) {
|
||||
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
}
|
||||
// 车聊聊,IM
|
||||
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder"));
|
||||
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
|
||||
@@ -331,8 +330,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, "PUSH_UI"));
|
||||
// ADAS模块(旧,慢慢被 域控制器模块 替换掉)
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider"));
|
||||
// 全局语音唤醒
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake"));
|
||||
// ADAS模块(旧,慢慢被 域控制器模块 替换掉)
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider"));
|
||||
|
||||
|
||||
@@ -72,8 +72,6 @@ internal object BridgeApi {
|
||||
|
||||
fun map() = apis?.mapServiceApi
|
||||
|
||||
fun onlineCarPanelApi(): IMogoOnlineCarListPanelProvider? = apis?.onlineCarPanelApi
|
||||
|
||||
fun statusManager(): IMogoStatusManager? = apis?.statusManagerApi
|
||||
|
||||
fun topViewManager() = apis?.topViewManager
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.scenario.scene.destination.V2XRecommendRouteScenario;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -159,14 +158,6 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
}
|
||||
|
||||
private void hidOtherPanel() {
|
||||
try {
|
||||
// 与其它面板互斥
|
||||
IMogoOnlineCarListPanelProvider onlineCarListPanelProvider = BridgeApi.INSTANCE.onlineCarPanelApi();
|
||||
if (onlineCarListPanelProvider != null) {
|
||||
onlineCarListPanelProvider.hidePanel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,13 +138,6 @@ public class MogoServicePaths {
|
||||
@Deprecated
|
||||
public static final String PATH_ACTION_APIS = "/mogoaction/api";
|
||||
|
||||
/**
|
||||
* 刷新策略控制
|
||||
*/
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_REFRESH_STRATEGY_API = "/refreshstrategy/api";
|
||||
|
||||
/**
|
||||
* 顶部1/2屏管理
|
||||
*/
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.mogo.eagle.core.network;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/11/18
|
||||
*
|
||||
* 将HOST转换为HttpDNS的ip
|
||||
*/
|
||||
interface HttpDns {
|
||||
|
||||
List< InetAddress > lookup( String hostname ) throws UnknownHostException;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mogo.eagle.core.network;
|
||||
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public final class MoGoRetrofitFactory {
|
||||
|
||||
private MoGoRetrofitFactory() {
|
||||
}
|
||||
|
||||
public static synchronized Retrofit getInstance(String baseUrl) {
|
||||
return RetrofitFactory.INSTANCE.getInstance(baseUrl);
|
||||
}
|
||||
|
||||
public static synchronized Retrofit getInstanceNoCallAdapter(String baseUrl) {
|
||||
return RetrofitFactory.INSTANCE.getInstanceNoCallAdapter(baseUrl);
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,6 @@ public final class NetConfig {
|
||||
|
||||
private SSLContext sslContext;
|
||||
|
||||
private HttpDns httpDns;
|
||||
|
||||
private NetConfig() {
|
||||
}
|
||||
|
||||
@@ -172,12 +170,4 @@ public final class NetConfig {
|
||||
this.sslContext = sslContext;
|
||||
}
|
||||
|
||||
public HttpDns getHttpDns() {
|
||||
return httpDns;
|
||||
}
|
||||
|
||||
public NetConfig setHttpDns( HttpDns httpDns ) {
|
||||
this.httpDns = httpDns;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.mogo.eagle.core.network;
|
||||
|
||||
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
public final class RetrofitFactory {
|
||||
|
||||
private RetrofitFactory() {
|
||||
}
|
||||
|
||||
public static synchronized Retrofit getInstance(String baseUrl) {
|
||||
return com.mogo.cloud.network.RetrofitFactory.INSTANCE.getInstance(baseUrl);
|
||||
}
|
||||
|
||||
public static synchronized Retrofit getInstanceNoCallAdapter(String baseUrl) {
|
||||
return com.mogo.cloud.network.RetrofitFactory.INSTANCE.getInstanceNoCallAdapter(baseUrl);
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,6 @@ public class NetConfigUtils {
|
||||
Logger.d("DomainExchange", "oriHost: " + request.url().host() + " newHost: " + host + " \r\n newUrl: " + url);
|
||||
return chain.proceed(request.newBuilder().url(url).build());
|
||||
})
|
||||
.setHttpDns(null)
|
||||
.setLoggable(DebugConfig.isDebug());
|
||||
}
|
||||
|
||||
|
||||
@@ -425,7 +425,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "锁车");
|
||||
// mMapView.getMapAutoViewHelper().setZoom(mLockZoom);
|
||||
mMapView.getMapAutoViewHelper().setLockMode(true);
|
||||
mIsCarLocked = true;
|
||||
}
|
||||
@@ -668,9 +667,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
|
||||
// Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged:location");
|
||||
MogoLocation mLastLocation = ObjectUtils.fromLocation(location);
|
||||
// Log.w("DHY-location", mLastLocation.getLongitude() + "," + mLastLocation.getLatitude() + " AMapViewWrapper-onLocationChanged:mLastLocation");
|
||||
UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation));
|
||||
|
||||
Location sysLocation = new Location(location.getProvider());
|
||||
@@ -732,8 +729,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onMapLoaded() {
|
||||
Logger.i(TAG, "autoop--onMapLoaded: ");
|
||||
MapAutoApi.INSTANCE.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true); //修改自车模型,未来需区分车的类型
|
||||
//mMapView.getMapAutoViewHelper().setRenderFrequency(true, 50);// 地图刷新频率
|
||||
//MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
|
||||
@@ -57,18 +57,18 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
@Override
|
||||
public IMogoMapView getMapView(Context context) {
|
||||
Log.d(TAG, "setDebugMode==true");
|
||||
|
||||
MapParams mapParams = MapParams.Companion.init();
|
||||
mapParams.setDebugMode(false)
|
||||
//.setDataFileSource(1) //todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
//todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
//.setDataFileSource(1)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_3D)
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
.setPointToCenter(0.5f, 0.5f) //todo 2D模式下需要注意ADAS部分遮挡
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
.setPointToCenter(0.5f, 0.5f)
|
||||
.setStyleMode(MapParams.MAP_STYLE_VR);
|
||||
|
||||
|
||||
MapAutoApi.INSTANCE.init(context, mapParams);
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
//mapAutoView.registerRenderListener(l -> Log.i(TAG, "renderTime: " + l));
|
||||
|
||||
@@ -358,7 +358,6 @@ class CallChatCenter private constructor() : IBizCallChat.IBizCallBack, IVoiceCo
|
||||
@Synchronized
|
||||
private fun showLauncherCallingView() {
|
||||
Logger.d(TAG, "showLauncherCallingView : onlineCarPanelApi hidePanel")
|
||||
serviceApi?.onlineCarPanelApi?.hidePanel()
|
||||
if (!showCallWindowFromDefault) {
|
||||
Logger.d(TAG, "showLauncherCallingView : 接听电话,隐藏用户信息窗口")
|
||||
hideUserWindow()
|
||||
|
||||
@@ -73,7 +73,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
|
||||
protected View mEntrance;
|
||||
protected View mEventPanel;
|
||||
protected View mHistoryMessagePanel;
|
||||
protected FrameLayout mFloatingLayout;
|
||||
protected View mCoverUpLayout;
|
||||
|
||||
@@ -99,13 +98,11 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
mEventPanel = findViewById(R.id.module_main_id_event_panel_fragment_container);
|
||||
mFloatingLayout = findViewById(R.id.module_main_id_floating_view);
|
||||
mCoverUpLayout = findViewById(R.id.module_main_id_cover_up);
|
||||
mHistoryMessagePanel = findViewById(R.id.module_main_id_message_history_fragment_container);
|
||||
|
||||
clSpecialEffect = findViewById(R.id.cl_special_effect);
|
||||
|
||||
FloatingViewHandler.init(mFloatingLayout);
|
||||
|
||||
mServiceApis.getOnlineCarPanelApi().initContainer(R.id.module_main_id_message_history_fragment_container, this);
|
||||
if (CallChatApi.getInstance().getApiProvider() != null) {
|
||||
CallChatApi.getInstance().getApiProvider().initVehicleTeamContainer("init", R.id.module_main_id_message_history_fragment_container, this);
|
||||
}
|
||||
@@ -419,8 +416,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
AdasConfigApiController.getInstance().release();
|
||||
mServiceApis.getAdasControllerApi().release();
|
||||
Logger.d(TAG, "destroy.");
|
||||
mServiceApis.getRefreshStrategyControllerApi().clearAllData();
|
||||
mServiceApis.getOnlineCarPanelApi().clear();
|
||||
ContextHolderUtil.releaseContext();
|
||||
MogoModulesManager.getInstance().onDestroy();
|
||||
SchemeIntent.getInstance().clear();
|
||||
|
||||
@@ -151,9 +151,6 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
case TYPE_LAUNCH:
|
||||
handleLaunchIntent(target);
|
||||
break;
|
||||
case TYPE_SHOW_ONLINE_CAR_PANEL:
|
||||
handleShowOnlineCarPanel(target);
|
||||
break;
|
||||
case TYPE_SHOW_HISTORY_PANEL:
|
||||
handleShowEventPanel(0);
|
||||
break;
|
||||
@@ -178,10 +175,6 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
mApis.getAnalyticsApi().track("appenterfront", properties);
|
||||
}
|
||||
|
||||
private void handleShowOnlineCarPanel(Uri uri) {
|
||||
mApis.getOnlineCarPanelApi().showPanel();
|
||||
}
|
||||
|
||||
/*
|
||||
* 语音打开事件面板
|
||||
* */
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
-keep interface com.mogo.module.service.intent.IntentHandler{*;}
|
||||
-keep interface com.mogo.module.service.network.RefreshApiService{*;}
|
||||
-keep interface com.mogo.module.service.network.RefreshCallback{*;}
|
||||
-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity{*;}
|
||||
-keep interface com.mogo.module.service.ttsConfig.TtsConfigApiService{*;}
|
||||
-keep class com.mogo.module.service.ServiceConst{*;}
|
||||
-keep class com.mogo.module.service.ServiceConst{*;}
|
||||
@@ -23,9 +23,7 @@
|
||||
#-----ServiceModule-----
|
||||
-keep class com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo.*{*;}
|
||||
-keep class com.mogo.module.service.network.RefreshBody.*{*;}
|
||||
-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
|
||||
-keep interface com.mogo.module.service.intent.IntentHandler
|
||||
-keep interface com.mogo.module.service.network.RefreshApiService
|
||||
-keep interface com.mogo.module.service.network.RefreshCallback
|
||||
-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity
|
||||
-keep class com.mogo.module.service.ServiceConst
|
||||
@@ -10,16 +10,13 @@ import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.dispatch.DispatchAutoPilotManager;
|
||||
import com.mogo.module.service.location.MogoRTKLocation;
|
||||
import com.mogo.module.service.routeoverlay.MogoRouteOverlayManager;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.service.autopilot.AutoPilotRemoteController;
|
||||
import com.mogo.module.service.handler.MainLooperHandler;
|
||||
import com.mogo.module.service.handler.RefreshWorkThreadHandler;
|
||||
import com.mogo.module.service.intent.IntentHandlerFactory;
|
||||
@@ -350,8 +349,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
mFragmentManager.addMainFragmentStackTransactionListener( this );
|
||||
|
||||
AutoPilotRemoteController.getInstance().start();
|
||||
|
||||
Intent intent = new Intent( "com.freedom.ser.ACTION" );
|
||||
intent.addFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
|
||||
mContext.sendBroadcast( intent );
|
||||
@@ -671,11 +668,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
* 刷新数据
|
||||
*/
|
||||
private void notifyRefreshData( MogoLatLng latLng, int radius, RefreshCallback callback ) {
|
||||
|
||||
if ( !DebugConfig.isMapBased() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !mStatusManager.isMainPageLaunched() ) {
|
||||
return;
|
||||
}
|
||||
@@ -847,7 +839,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
SpStorage.setNavigationTarget( "" );
|
||||
Logger.d( TAG, "onStopNavi: remove MSG_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH msg" );
|
||||
mHandler.removeMessages( ServiceConst.MSG_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH );
|
||||
}
|
||||
|
||||
@@ -107,8 +107,6 @@ abstract class StatusChangedAdapter implements IMogoStatusChangedListener {
|
||||
}
|
||||
};
|
||||
}
|
||||
//MogoApisHandler.getInstance().getApis().getShareManager().dismissShareDialog();
|
||||
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().hidePanel();
|
||||
MogoApisHandler.getInstance().getApis().getEventPanelManager().hidePanel();
|
||||
if (mCarsChattingProvider == null) {
|
||||
mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
|
||||
|
||||
@@ -3,37 +3,16 @@ package com.mogo.module.service.handler;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.network.ParamsProvider;
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.module.service.MogoServices;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.network.RefreshApiService;
|
||||
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushData;
|
||||
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushResponse;
|
||||
import com.mogo.module.service.onlinecar.panel.NavigationTargetInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/14
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
abstract class MainLooperHandler extends Handler {
|
||||
public abstract class MainLooperHandler extends Handler {
|
||||
|
||||
private static final String TAG = "MainLooperHandler";
|
||||
|
||||
@@ -52,9 +31,6 @@ abstract class MainLooperHandler extends Handler {
|
||||
case ServiceConst.MSG_LOOP_REQUEST:
|
||||
handleLoopRequestMessage( msg );
|
||||
break;
|
||||
case ServiceConst.MSG_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH:
|
||||
handleScheduleCalculateNotHomeCompanyDistanceForPushMessage( msg );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,62 +38,4 @@ abstract class MainLooperHandler extends Handler {
|
||||
|
||||
protected abstract void handleLoopRequestMessage( Message msg );
|
||||
|
||||
protected void handleScheduleCalculateNotHomeCompanyDistanceForPushMessage( Message msg ) {
|
||||
handleCalculationNotHomeCompanyDistanceForPush( msg.arg1 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发起计算导航目的地推送策略
|
||||
*
|
||||
* @param time 第x次重试
|
||||
*/
|
||||
private void handleCalculationNotHomeCompanyDistanceForPush( final int time ) {
|
||||
if ( time > 3 ) {
|
||||
return;
|
||||
}
|
||||
String json = SpStorage.getNavigationTarget();
|
||||
if ( !TextUtils.isEmpty( json ) ) {
|
||||
try {
|
||||
NavigationTargetInfo info = GsonUtil.objectFromJson( json, NavigationTargetInfo.class );
|
||||
|
||||
Logger.d( TAG, "info = %s", info );
|
||||
|
||||
HomeCompanyDistanceForPushData data = new HomeCompanyDistanceForPushData();
|
||||
data.lat = Double.valueOf( info.getToPoiLatitude() );
|
||||
data.lon = Double.valueOf( info.getToPoiLongitude() );
|
||||
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( AbsMogoApplication.getApp() ).build();
|
||||
query.put( "data", GsonUtil.jsonFromObject( data ) );
|
||||
MogoApisHandler.getInstance().getApis().getNetworkApi().create(RefreshApiService.class, HostConst.TRAVEL_CONDITION_HOST).calculationNotHomeCompanyDistanceForPush( query )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< HomeCompanyDistanceForPushResponse >( RequestOptions.create( AbsMogoApplication.getApp() ) ) {
|
||||
@Override
|
||||
public void onSuccess( HomeCompanyDistanceForPushResponse o ) {
|
||||
super.onSuccess( o );
|
||||
if ( o != null && o.result != null ) {
|
||||
Logger.d( TAG, "calculationNotHomeCompanyDistanceForPush result %s", o.result.pushFlag );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( Throwable e ) {
|
||||
super.onError( e );
|
||||
Logger.d( TAG, "re scheduleCalculationNotHomeCompanyDistanceForPush after 30s" );
|
||||
// 延时30s重试
|
||||
MogoServices.getInstance().scheduleCalculationNotHomeCompanyDistanceForPush( time + 1, 30_000L );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( String message, int code ) {
|
||||
super.onError( message, code );
|
||||
}
|
||||
} );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "handleCalculationNotHomeCompanyDistanceForPush" );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.mogo.module.service.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/5
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class ADASStatusIntentHandler implements IntentHandler {
|
||||
|
||||
private static volatile ADASStatusIntentHandler sInstance;
|
||||
|
||||
private ADASStatusIntentHandler() {
|
||||
}
|
||||
|
||||
public static ADASStatusIntentHandler getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (ADASStatusIntentHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new ADASStatusIntentHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(Context context, Intent intent) {
|
||||
if (intent == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (MogoReceiver.ACTIION_ADAS.equals(intent.getAction())) {
|
||||
|
||||
int status = intent.getIntExtra(MogoReceiver.PARAM_ADAS_STATUS, 0);
|
||||
MarkerServiceHandler.getMogoStatusManager().setADASUIShow(ServiceConst.TYPE, status == 1);
|
||||
}
|
||||
// 由于adas可能调高此处的调用频率,存在anr风险,且此处没有作用,所以暂时注释掉
|
||||
else {
|
||||
String msg = intent.getStringExtra("adasMsg");
|
||||
if (TextUtils.isEmpty(msg)) {
|
||||
return;
|
||||
}
|
||||
Logger.d("ADAS COOR", msg);
|
||||
|
||||
AutopilotCarStateInfo stateInfo = GsonUtil.objectFromJson(msg, AutopilotCarStateInfo.class);
|
||||
if (stateInfo != null && stateInfo.getValues() != null) {
|
||||
JSONObject data = new JSONObject();
|
||||
try {
|
||||
data.putOpt("lon", stateInfo.getValues().getLon());
|
||||
data.putOpt("lat", stateInfo.getValues().getLat());
|
||||
data.putOpt("alt", stateInfo.getValues().getAlt());
|
||||
data.putOpt("speed", stateInfo.getValues().getGnss_speed());
|
||||
data.putOpt("satelliteTime", stateInfo.getValues().getSatelliteTime());
|
||||
data.putOpt("heading", stateInfo.getValues().getHeading());
|
||||
data.putOpt("acceleration", stateInfo.getValues().getAcceleration());
|
||||
data.putOpt("yawRate", stateInfo.getValues().getYaw_rate());
|
||||
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(data);
|
||||
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,13 @@ import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.launchercard.LauncherCardRefresher;
|
||||
import com.mogo.module.service.receiver.AccStatusReceiver;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/5
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class AccStatusIntentHandler implements IntentHandler {
|
||||
public class AccStatusIntentHandler implements IntentHandler {
|
||||
|
||||
public static final byte ACC_ON = 1;
|
||||
public static final byte ACC_OFF = 0;
|
||||
|
||||
@@ -27,8 +27,6 @@ public class IntentHandlerFactory {
|
||||
mHandlers.put( Intent.ACTION_POWER_CONNECTED, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( Intent.ACTION_POWER_DISCONNECTED, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( AccStatusReceiver.ACTION_NWD_ACC, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_ADAS_STATUS, ADASStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTIION_ADAS, ADASStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() );
|
||||
mHandlers.put( ServiceConst.COMMAND_BACK, WholeVoiceCommandIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_MOGO, new MogoControllerIntentHandler() );
|
||||
|
||||
@@ -248,7 +248,6 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.owner(TAG)
|
||||
.autoManager(false);
|
||||
int duration = intent.getIntExtra("duration", 30);
|
||||
MarkerServiceHandler.getApis().getRefreshStrategyControllerApi().restartAutoRefreshAtTime(duration);
|
||||
IMogoMarker marker = MarkerServiceHandler.getMarkerManager().addMarker(TAG, options);
|
||||
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus(TAG, true, false);
|
||||
if (!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()) {
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.mogo.module.service.location;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.location.Criteria;
|
||||
import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.location.LocationManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.service.cloud.location.CloudLocationInfo;
|
||||
|
||||
public class MogoRTKLocation {
|
||||
|
||||
private static final String TAG = "MogoRTKLocation";
|
||||
private LocationManager locationManager;
|
||||
|
||||
public static MogoRTKLocation getInstance() {
|
||||
return RTKHolder.rtkLoc;
|
||||
}
|
||||
|
||||
private static class RTKHolder {
|
||||
private static final MogoRTKLocation rtkLoc = new MogoRTKLocation();
|
||||
}
|
||||
|
||||
private MogoRTKLocation() {
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
public void init() {
|
||||
locationManager = (LocationManager) AbsMogoApplication.getApp().getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
|
||||
String provider = locationManager.getBestProvider(getCriteria(), true);
|
||||
Logger.d(TAG, "init provider : " + provider);
|
||||
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
|
||||
try {
|
||||
locationManager.requestLocationUpdates(provider, 0, 0, locationListener);
|
||||
Location location = locationManager.getLastKnownLocation(provider);
|
||||
if (location != null) {
|
||||
Logger.i(TAG, "location : " + location.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Logger.d(TAG, "RTK LocationManager requestLocationUpdates has Exception : " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
Logger.d(TAG, "RTK LocationManager Provider GPS_PROVIDER unable");
|
||||
}
|
||||
}
|
||||
|
||||
private Criteria getCriteria() {
|
||||
Criteria criteria = new Criteria();
|
||||
criteria.setAccuracy(Criteria.ACCURACY_FINE); //高精
|
||||
criteria.setAltitudeRequired(false);
|
||||
criteria.setBearingRequired(true);
|
||||
criteria.setSpeedRequired(true);
|
||||
criteria.setPowerRequirement(Criteria.POWER_LOW);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
private final LocationListener locationListener = new LocationListener() {
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
if (location != null) {
|
||||
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
|
||||
if (location.getLatitude() != 0.0 && location.getLongitude() != 0.0) {
|
||||
cloudLocationInfo.setAlt(location.getAltitude());
|
||||
cloudLocationInfo.setHeading(location.getBearing());
|
||||
cloudLocationInfo.setLat(location.getLatitude());
|
||||
cloudLocationInfo.setLon(location.getLongitude());
|
||||
cloudLocationInfo.setSpeed(location.getSpeed());
|
||||
cloudLocationInfo.setSatelliteTime(location.getTime());
|
||||
cloudLocationInfo.setSystemTime(System.currentTimeMillis());
|
||||
cloudLocationInfo.setTileId(String.valueOf(MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
|
||||
.getTileId(location.getLongitude(), location.getLatitude())));
|
||||
SnapshotLocationDataCenter.getInstance().syncLocationInfo(cloudLocationInfo);
|
||||
}
|
||||
} else {
|
||||
Logger.e(TAG, "location == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
Logger.d(TAG, "onStatusChanged status: " + status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderEnabled(String provider) {
|
||||
Logger.d(TAG, "onProviderEnabled");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderDisabled(String provider) {
|
||||
Logger.d(TAG, "onProviderEnabled");
|
||||
}
|
||||
};
|
||||
|
||||
public void stop() {
|
||||
Logger.d(TAG, "stop RTK Location");
|
||||
if (locationManager != null && locationListener != null) {
|
||||
locationManager.removeUpdates(locationListener);
|
||||
} else {
|
||||
Logger.d(TAG, "stop failed , listener: " + locationListener + " is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,64 +152,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 实时绘制连线
|
||||
// *
|
||||
// * @param result
|
||||
// */
|
||||
// private void drawLimberCollisionPolyline(ADASRecognizedResult result) {
|
||||
// if (result != null) {
|
||||
// IMogoPolyline polyLine = LimberCollisionPolyline.getInstance().getPolyLine();
|
||||
// MogoLatLng startLatLng = new MogoLatLng(result.lat, result.lon);
|
||||
// MogoLatLng endLatlng = Trigonometric.getNewLocation(startLatLng, 20, result.heading);
|
||||
// Log.d(TAG, "红色区域起始点 = " + startLatLng.lon + "," + startLatLng.lat
|
||||
// + "终点" + endLatlng.lon + "," + endLatlng.lat + "--heading =" + result.heading);
|
||||
// if (polyLine != null) {
|
||||
// Log.d(TAG, "drawStopLine polyLine != null");
|
||||
// polyLine.setPoints(Arrays.asList(startLatLng, endLatlng));
|
||||
// } else {
|
||||
// List<MogoLatLng> latLngs = new ArrayList<>();
|
||||
// latLngs.add(startLatLng);
|
||||
// latLngs.add(endLatlng);
|
||||
// LimberCollisionPolyline.getInstance().draw((float) result.roadWidth, latLngs);
|
||||
// }
|
||||
// } else {
|
||||
// LimberCollisionPolyline.getInstance().clearLine();
|
||||
// }
|
||||
// }
|
||||
|
||||
// private final static int MSG_SNAPSHOT = 1;
|
||||
// private final static int MSG_ADAS = 2;
|
||||
//
|
||||
// /**
|
||||
// * todo 后续从云端和adas侧拿到的数据 需求对数据流进行重新架构以扩展除添加marker外的其他预警类业务
|
||||
// * todo (应需要模块主动注册adas或云端数据回调,在具体模块内添加绘制需求,需要与地图侧确认是否支持并发)
|
||||
// */
|
||||
// private final Handler mSnapshotHandler = new Handler(WorkThreadHandler.newInstance("snapshot-thread").getLooper()) {
|
||||
// @Override
|
||||
// public void handleMessage(Message msg) {
|
||||
// super.handleMessage(msg);
|
||||
// switch (msg.what) {
|
||||
// case MSG_SNAPSHOT:
|
||||
// if (msg.obj instanceof SocketDownData.LauncherSnapshotProto) {
|
||||
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(((SocketDownData.LauncherSnapshotProto) msg.obj));
|
||||
// } else {
|
||||
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(null);
|
||||
// }
|
||||
// break;
|
||||
// case MSG_ADAS:
|
||||
// // 绘制近景识别到的车辆
|
||||
// if (msg.obj instanceof List) {
|
||||
// List<ADASRecognizedResult> recognizedResults = (List<ADASRecognizedResult>) msg.obj;
|
||||
// AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult(recognizedResults);
|
||||
// }
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
/**
|
||||
* 地图上的Marker点击回调
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.module.service.network;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.service.network.bean.DemoUserInfoEntity;
|
||||
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushResponse;
|
||||
import com.mogo.module.service.network.bean.TtsConfigData;
|
||||
|
||||
@@ -11,7 +10,6 @@ import java.util.Map;
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
@@ -40,12 +38,6 @@ public interface RefreshApiService {
|
||||
@POST( "/yycp-launcherSnapshot/user/queryOnLineCarWithRoute" )
|
||||
Observable< MarkerResponse > queryOnLineCarWithRoute( @FieldMap Map< String, Object > parameters );
|
||||
|
||||
/**
|
||||
* 查询演示车用户信息
|
||||
*/
|
||||
@GET( "/yycp-launcherSnapshot/mock/getMockUserInfos" )
|
||||
Observable< DemoUserInfoEntity > getMockUsers();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST( "/yycp-travel-condition/trajectoryPrediction/calculationNotHomeCompanyDistanceForPush" )
|
||||
Observable< HomeCompanyDistanceForPushResponse > calculationNotHomeCompanyDistanceForPush( @FieldMap Map< String, Object > parameters );
|
||||
|
||||
@@ -1,267 +0,0 @@
|
||||
package com.mogo.module.service.network.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/4/24 4:20 PM
|
||||
* desc : TODO 前瞻需求演示使用的用户数据
|
||||
* version: 1.0
|
||||
*/
|
||||
public class DemoUserInfoEntity extends BaseData {
|
||||
|
||||
/**
|
||||
* code : 0
|
||||
* msg :
|
||||
* detailMsg :
|
||||
* result : {"userList":[{"sceneType":"1","location":{"lat":39.97541,"lon":116.41782761},"userInfo":{"sn":"ZD801B1920L00818","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}},{"sceneType":"2","location":{"lat":39.97541,"lon":116.41782761},"userInfo":{"sn":"ZD802B1932L00779","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}},{"sceneType":"3","location":{"lat":39.97541,"lon":116.41782761},"userInfo":{"sn":"ZD802B1932L00779","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}}]}
|
||||
*/
|
||||
|
||||
private String detailMsg;
|
||||
private ResultBean result;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getDetailMsg() {
|
||||
return detailMsg;
|
||||
}
|
||||
|
||||
public void setDetailMsg(String detailMsg) {
|
||||
this.detailMsg = detailMsg;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
private List<UserListBean> userList;
|
||||
|
||||
public List<UserListBean> getUserList() {
|
||||
return userList;
|
||||
}
|
||||
|
||||
public void setUserList(List<UserListBean> userList) {
|
||||
this.userList = userList;
|
||||
}
|
||||
|
||||
public static class UserListBean {
|
||||
/**
|
||||
* sceneType : 1
|
||||
* location : {"lat":39.97541,"lon":116.41782761}
|
||||
* userInfo : {"sn":"ZD801B1920L00818","userId":1,"userName":"用户昵称","userHead":"https://www.baidu.com/img/baidu_jgylogo3.png","gender":"男","age":20,"lastActiveweekAvgscore":"96","safeLabel":"老司机","safeLabelType":1}
|
||||
*/
|
||||
|
||||
private String sceneType;
|
||||
private LocationBean location;
|
||||
private UserInfoBean userInfo;
|
||||
|
||||
public String getSceneType() {
|
||||
return sceneType;
|
||||
}
|
||||
|
||||
public void setSceneType(String sceneType) {
|
||||
this.sceneType = sceneType;
|
||||
}
|
||||
|
||||
public LocationBean getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(LocationBean location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public UserInfoBean getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(UserInfoBean userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
public static class LocationBean {
|
||||
/**
|
||||
* lat : 39.97541
|
||||
* lon : 116.41782761
|
||||
*/
|
||||
|
||||
private double lat;
|
||||
private double lon;
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LocationBean{" +
|
||||
"lat=" + lat +
|
||||
", lon=" + lon +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public static class UserInfoBean {
|
||||
/**
|
||||
* sn : ZD801B1920L00818
|
||||
* userId : 1
|
||||
* userName : 用户昵称
|
||||
* userHead : https://www.baidu.com/img/baidu_jgylogo3.png
|
||||
* gender : 男
|
||||
* age : 20
|
||||
* lastActiveweekAvgscore : 96
|
||||
* safeLabel : 老司机
|
||||
* safeLabelType : 1
|
||||
*/
|
||||
|
||||
private String sn;
|
||||
private int userId;
|
||||
private String userName;
|
||||
private String userHead;
|
||||
private String gender;
|
||||
private int age;
|
||||
private String lastActiveweekAvgscore;
|
||||
private String safeLabel;
|
||||
private int safeLabelType;
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserHead() {
|
||||
return userHead;
|
||||
}
|
||||
|
||||
public void setUserHead(String userHead) {
|
||||
this.userHead = userHead;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public String getLastActiveweekAvgscore() {
|
||||
return lastActiveweekAvgscore;
|
||||
}
|
||||
|
||||
public void setLastActiveweekAvgscore(String lastActiveweekAvgscore) {
|
||||
this.lastActiveweekAvgscore = lastActiveweekAvgscore;
|
||||
}
|
||||
|
||||
public String getSafeLabel() {
|
||||
return safeLabel;
|
||||
}
|
||||
|
||||
public void setSafeLabel(String safeLabel) {
|
||||
this.safeLabel = safeLabel;
|
||||
}
|
||||
|
||||
public int getSafeLabelType() {
|
||||
return safeLabelType;
|
||||
}
|
||||
|
||||
public void setSafeLabelType(int safeLabelType) {
|
||||
this.safeLabelType = safeLabelType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserInfoBean{" +
|
||||
"sn='" + sn + '\'' +
|
||||
", userId=" + userId +
|
||||
", userName='" + userName + '\'' +
|
||||
", userHead='" + userHead + '\'' +
|
||||
", gender='" + gender + '\'' +
|
||||
", age=" + age +
|
||||
", lastActiveweekAvgscore='" + lastActiveweekAvgscore + '\'' +
|
||||
", safeLabel='" + safeLabel + '\'' +
|
||||
", safeLabelType=" + safeLabelType +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserListBean{" +
|
||||
"sceneType='" + sceneType + '\'' +
|
||||
", location=" + location +
|
||||
", userInfo=" + userInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "V2XDemoUserInfoEntity{" +
|
||||
"detailMsg='" + detailMsg + '\'' +
|
||||
", result=" + result +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.mogo.module.service.network.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
/**
|
||||
* @author :zhuangyan
|
||||
* @date : 2020/11/17 11:43
|
||||
* @desc :分体机tts播报信息返回
|
||||
*/
|
||||
public class TtsConfigEntity extends BaseData {
|
||||
public Result result;
|
||||
|
||||
public Result getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(Result result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class Result {
|
||||
private String word;
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
}
|
||||
|
||||
public void setWord(String word) {
|
||||
this.word = word;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class ContainerHandler {
|
||||
|
||||
public static int sContainerId = 0;
|
||||
public static FragmentActivity sAttachContext;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
interface IOnlineCarPanelView extends IView {
|
||||
|
||||
void showLoading(boolean visible);
|
||||
|
||||
void renderOnlineCarList( List< MarkerOnlineCar > onlineCars, double lon, double lat );
|
||||
|
||||
void renderEmptyUi( OnlineCarStrategy strategy );
|
||||
|
||||
void renderNoNavigationInfoUi();
|
||||
|
||||
void renderErrorUi();
|
||||
|
||||
void removeSelf();
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class NavigationTargetInfo {
|
||||
|
||||
|
||||
/**
|
||||
* FromPoiName : 东城区小黄庄北街2号
|
||||
* FromPoiAddr : 在中国银行(北京安贞桥支行)附近
|
||||
* FromPoiLongitude : 116.41082763671875
|
||||
* FromPoiLatitude : 39.96831130981445
|
||||
* ToPoiName : 北京市北京市北小营镇宏大工业开发中心A座7号
|
||||
* ToPoiLongitude : 116.74490356445312
|
||||
* ToPoiLatitude : 40.19820785522461
|
||||
*/
|
||||
private String FromPoiName;
|
||||
private String FromPoiAddr;
|
||||
private String FromPoiLongitude;
|
||||
private String FromPoiLatitude;
|
||||
private String ToPoiName;
|
||||
private String ToPoiLongitude;
|
||||
private String ToPoiLatitude;
|
||||
|
||||
public String getFromPoiName() {
|
||||
return FromPoiName;
|
||||
}
|
||||
|
||||
public void setFromPoiName( String FromPoiName ) {
|
||||
this.FromPoiName = FromPoiName;
|
||||
}
|
||||
|
||||
public String getFromPoiAddr() {
|
||||
return FromPoiAddr;
|
||||
}
|
||||
|
||||
public void setFromPoiAddr( String FromPoiAddr ) {
|
||||
this.FromPoiAddr = FromPoiAddr;
|
||||
}
|
||||
|
||||
public String getFromPoiLongitude() {
|
||||
return FromPoiLongitude;
|
||||
}
|
||||
|
||||
public void setFromPoiLongitude( String FromPoiLongitude ) {
|
||||
this.FromPoiLongitude = FromPoiLongitude;
|
||||
}
|
||||
|
||||
public String getFromPoiLatitude() {
|
||||
return FromPoiLatitude;
|
||||
}
|
||||
|
||||
public void setFromPoiLatitude( String FromPoiLatitude ) {
|
||||
this.FromPoiLatitude = FromPoiLatitude;
|
||||
}
|
||||
|
||||
public String getToPoiName() {
|
||||
return ToPoiName;
|
||||
}
|
||||
|
||||
public void setToPoiName( String ToPoiName ) {
|
||||
this.ToPoiName = ToPoiName;
|
||||
}
|
||||
|
||||
public String getToPoiLongitude() {
|
||||
return ToPoiLongitude;
|
||||
}
|
||||
|
||||
public void setToPoiLongitude( String ToPoiLongitude ) {
|
||||
this.ToPoiLongitude = ToPoiLongitude;
|
||||
}
|
||||
|
||||
public String getToPoiLatitude() {
|
||||
return ToPoiLatitude;
|
||||
}
|
||||
|
||||
public void setToPoiLatitude( String ToPoiLatitude ) {
|
||||
this.ToPoiLatitude = ToPoiLatitude;
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_ONLINE_CAR_PANEL )
|
||||
class OnlineCarListPanelProvider implements IMogoOnlineCarListPanelProvider {
|
||||
|
||||
private static final String TAG = "OnlineCarListPanelProvider";
|
||||
|
||||
@Override
|
||||
public void initContainer( int containerId, FragmentActivity activity ) {
|
||||
ContainerHandler.sContainerId = containerId;
|
||||
ContainerHandler.sAttachContext = activity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPanel() {
|
||||
if ( ContainerHandler.sAttachContext == null ) {
|
||||
return;
|
||||
}
|
||||
Fragment fragment = new OnlineCarPanelFragment();
|
||||
Logger.d( TAG, "showPanel" );
|
||||
ContainerHandler.sAttachContext
|
||||
.getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace( ContainerHandler.sContainerId, fragment, TAG )
|
||||
.commitNowAllowingStateLoss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hidePanel() {
|
||||
if ( ContainerHandler.sAttachContext == null ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "hidePanel" );
|
||||
Fragment fragment = ContainerHandler.sAttachContext.getSupportFragmentManager().findFragmentByTag( TAG );
|
||||
if ( fragment != null ) {
|
||||
ContainerHandler.sAttachContext
|
||||
.getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.remove( fragment )
|
||||
.commitNowAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
ContainerHandler.sContainerId = 0;
|
||||
ContainerHandler.sAttachContext = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerUserInfo;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.Utils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
|
||||
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
import com.zhidao.carchattingprovider.ICarsChattingProvider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class OnlineCarPanelAdapter extends RecyclerView.Adapter<OnlineCarPanelAdapter.VH> {
|
||||
|
||||
private static final String TAG = "OnlineCarPanelAdapter";
|
||||
|
||||
private List<MarkerOnlineCar> mDatums;
|
||||
private double mToLon;
|
||||
private double mToLat;
|
||||
|
||||
public OnlineCarPanelAdapter(List<MarkerOnlineCar> mDatums, double mToLon, double mToLat) {
|
||||
this.mDatums = mDatums;
|
||||
this.mToLon = mToLon;
|
||||
this.mToLat = mToLat;
|
||||
}
|
||||
|
||||
public void setDatums(List<MarkerOnlineCar> mDatums) {
|
||||
this.mDatums = mDatums;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public OnlineCarPanelAdapter.VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.module_services_online_car_panel_item, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull OnlineCarPanelAdapter.VH holder, int position) {
|
||||
holder.bind(mDatums.get(position), mToLon, mToLat);
|
||||
holder.call.setOnClickListener(view -> {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
MarkerUserInfo userInfo = mDatums.get(position).getUserInfo();
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_SN, userInfo.getSn());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_USER_IMG, userInfo.getUserHead());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_USER_AGE, userInfo.getAgeNumber() + "");
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_NICK_NAME, userInfo.getUserName());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_USER_SEX, userInfo.getGender() + "");
|
||||
MarkerLocation location = mDatums.get(position).getLocation();
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_ADDRESS, location.getAddress());
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_LAT, location.getLat() + "");
|
||||
params.put(CallChattingProviderConstant.CCPROVIDER_LON, location.getLon() + "");
|
||||
ICarsChattingProvider carChatting = MarkerServiceHandler.getCarChatting();
|
||||
if ( carChatting != null ) {
|
||||
carChatting.call(params);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDatums == null ? 0 : mDatums.size();
|
||||
}
|
||||
|
||||
public static class VH extends RecyclerView.ViewHolder {
|
||||
|
||||
private ImageView avatar;
|
||||
private TextView nickname;
|
||||
private TextView distance;
|
||||
private TextView detail;
|
||||
private TextView call;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
params.bottomMargin = ResourcesHelper.getDimensionPixelSize(itemView.getContext(), R.dimen.module_services_panel_item_marginBottom);
|
||||
itemView.setLayoutParams(params);
|
||||
avatar = itemView.findViewById(R.id.module_services_id_panel_item_avatar);
|
||||
nickname = itemView.findViewById(R.id.module_services_id_panel_item_nickname);
|
||||
distance = itemView.findViewById(R.id.module_services_id_panel_item_distance);
|
||||
detail = itemView.findViewById(R.id.module_services_id_panel_item_detail);
|
||||
call = itemView.findViewById(R.id.module_services_id_panel_item_call);
|
||||
}
|
||||
|
||||
public void bind(MarkerOnlineCar car, double lon, double lat) {
|
||||
RequestOptions options = new RequestOptions().circleCrop().placeholder(R.drawable.module_common_default_user_head).error(R.drawable.module_common_default_user_head);
|
||||
GlideApp.with(itemView.getContext()).asBitmap().apply(options).load(car.getUserInfo().getUserHead()).into(new SkinAbleBitmapTarget(avatar, options));
|
||||
nickname.setText(car.getUserInfo().getUserName());
|
||||
String content = getDistanceStr(car.getLocation(), lon, lat);
|
||||
distance.setText(content);
|
||||
detail.setOnClickListener(view -> {
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("Mogoer_List_click", null);
|
||||
try {
|
||||
CallChatApi.getInstance().showUserWindow(itemView.getContext(), car);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "detail.OnClick");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getDistanceStr(MarkerLocation location, double lon, double lat) {
|
||||
if (location == null) {
|
||||
return "未知";
|
||||
}
|
||||
float distance = Utils.calculateLineDistance(location.getLon(), location.getLat(), lon, lat);
|
||||
if (distance >= 1000) {
|
||||
return String.format("%.1f公里", distance / 1000);
|
||||
} else {
|
||||
return String.format("%.1f米", distance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class OnlineCarPanelFragment extends MvpFragment< IOnlineCarPanelView, OnlineCarPanelPresenter > implements IOnlineCarPanelView {
|
||||
private String TAG = "OnlineCarPanelFragment";
|
||||
|
||||
private RecyclerView mList;
|
||||
private View mErrorPanel;
|
||||
|
||||
private View mRefreshPanel;
|
||||
private TextView mEmptyTip;
|
||||
private View m20KMStrategy;
|
||||
private View m40KMStrategy;
|
||||
|
||||
private ProgressBar mLoading;
|
||||
|
||||
private OnlineCarPanelAdapter mOnlineCarPanelAdapter;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_services_fragment_online_car_panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTagName() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
findViewById( R.id.module_services_id_close ).setOnClickListener( new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl( View v ) {
|
||||
removeSelf();
|
||||
}
|
||||
} );
|
||||
mList = findViewById( R.id.module_services_id_recycler_view );
|
||||
mRefreshPanel = findViewById( R.id.module_services_id_load_strategy_container );
|
||||
mErrorPanel = findViewById( R.id.module_services_id_error_container );
|
||||
m20KMStrategy = findViewById( R.id.module_services_id_20Km_radius );
|
||||
m40KMStrategy = findViewById( R.id.module_services_id_40Km_radius );
|
||||
mEmptyTip = findViewById( R.id.module_services_empty_tip );
|
||||
mLoading = findViewById( R.id.module_services_id_loading );
|
||||
|
||||
mList.setLayoutManager( new LinearLayoutManager( getContext(), LinearLayoutManager.VERTICAL, false ) );
|
||||
|
||||
m20KMStrategy.setOnClickListener( new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl( View v ) {
|
||||
mPresenter.next20KMStrategy();
|
||||
}
|
||||
} );
|
||||
m40KMStrategy.setOnClickListener( new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl( View v ) {
|
||||
mPresenter.next40KMStrategy();
|
||||
}
|
||||
} );
|
||||
mErrorPanel.setOnClickListener( new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl( View v ) {
|
||||
mPresenter.loadOnlineCar();
|
||||
}
|
||||
} );
|
||||
|
||||
mRootView.setOnClickListener( view -> {
|
||||
} );
|
||||
}
|
||||
|
||||
public void refreshPanel() {
|
||||
mPresenter.refreshPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoading( boolean visible ) {
|
||||
if ( visible ) {
|
||||
mRefreshPanel.setVisibility( View.GONE );
|
||||
mList.setVisibility( View.GONE );
|
||||
mErrorPanel.setVisibility( View.GONE );
|
||||
mLoading.setVisibility( View.VISIBLE );
|
||||
} else {
|
||||
mLoading.setVisibility( View.GONE );
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected OnlineCarPanelPresenter createPresenter() {
|
||||
return new OnlineCarPanelPresenter( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOnlineCarList( List< MarkerOnlineCar > onlineCars, double lon, double lat ) {
|
||||
mRefreshPanel.setVisibility( View.GONE );
|
||||
mErrorPanel.setVisibility( View.GONE );
|
||||
mList.setVisibility( View.VISIBLE );
|
||||
mLoading.setVisibility( View.GONE );
|
||||
if ( mOnlineCarPanelAdapter == null ) {
|
||||
mOnlineCarPanelAdapter = new OnlineCarPanelAdapter( onlineCars, lon, lat );
|
||||
mList.setAdapter( mOnlineCarPanelAdapter );
|
||||
} else {
|
||||
mOnlineCarPanelAdapter.setDatums( onlineCars );
|
||||
}
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( String.format( "为您找到%s个车友", onlineCars.size() ) );
|
||||
Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "number", onlineCars.size() );
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "Mogoer_List_number", properties );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderEmptyUi( OnlineCarStrategy strategy ) {
|
||||
mErrorPanel.setVisibility( View.GONE );
|
||||
mList.setVisibility( View.GONE );
|
||||
mRefreshPanel.setVisibility( View.VISIBLE );
|
||||
mLoading.setVisibility( View.GONE );
|
||||
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "未找到车友" );
|
||||
if ( strategy == null ) {
|
||||
m20KMStrategy.setVisibility( View.GONE );
|
||||
m40KMStrategy.setVisibility( View.GONE );
|
||||
mEmptyTip.setText( getString( R.string.module_services_online_car_panel_empty_tmpl, OnlineCarStrategy.Strategy3.getRadiusKM() ) );
|
||||
} else {
|
||||
switch ( strategy ) {
|
||||
case Strategy3:
|
||||
m20KMStrategy.setVisibility( View.GONE );
|
||||
m40KMStrategy.setVisibility( View.GONE );
|
||||
case Strategy2:
|
||||
m20KMStrategy.setVisibility( View.GONE );
|
||||
case Default:
|
||||
break;
|
||||
}
|
||||
mEmptyTip.setText( getString( R.string.module_services_online_car_panel_empty_tmpl, strategy.getRadiusKM() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderNoNavigationInfoUi() {
|
||||
mList.setVisibility( View.GONE );
|
||||
mRefreshPanel.setVisibility( View.GONE );
|
||||
mErrorPanel.setVisibility( View.VISIBLE );
|
||||
mLoading.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderErrorUi() {
|
||||
mList.setVisibility( View.GONE );
|
||||
mRefreshPanel.setVisibility( View.GONE );
|
||||
mLoading.setVisibility( View.GONE );
|
||||
mErrorPanel.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSelf() {
|
||||
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().hidePanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if ( mPresenter != null ) {
|
||||
mPresenter.destroy();
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.IDestroyable;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.navi.IMogoNaviListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.service.network.RefreshCallback;
|
||||
import com.mogo.module.service.network.RefreshModel;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class OnlineCarPanelPresenter extends Presenter< IOnlineCarPanelView > implements
|
||||
RefreshCallback< MarkerResponse >,
|
||||
IMogoNaviListener2,
|
||||
IDestroyable {
|
||||
|
||||
private static final String TAG = "OnlineCarPanelPresenter";
|
||||
|
||||
public static final int LIMIT = 20;
|
||||
private RefreshModel mRefreshModel;
|
||||
private OnlineCarStrategy mStrategy;
|
||||
private NavigationTargetInfo mNavigationTargetInfo;
|
||||
private Double mToLat;
|
||||
private Double mToLon;
|
||||
|
||||
public OnlineCarPanelPresenter( IOnlineCarPanelView view ) {
|
||||
super( view );
|
||||
mRefreshModel = new RefreshModel( getContext() );
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoNaviListener( TAG, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
mView.removeSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
refreshPanel();
|
||||
}
|
||||
|
||||
public void next20KMStrategy() {
|
||||
mStrategy = OnlineCarStrategy.Strategy2;
|
||||
loadOnlineCar();
|
||||
}
|
||||
|
||||
public void next40KMStrategy() {
|
||||
mStrategy = OnlineCarStrategy.Strategy3;
|
||||
loadOnlineCar();
|
||||
}
|
||||
|
||||
public void refreshPanel() {
|
||||
mStrategy = OnlineCarStrategy.Default;
|
||||
String json = SpStorage.getNavigationTarget();
|
||||
if ( TextUtils.isEmpty( json ) ) {
|
||||
mView.renderNoNavigationInfoUi();
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, json );
|
||||
mNavigationTargetInfo = GsonUtil.objectFromJson( json, NavigationTargetInfo.class );
|
||||
loadOnlineCar();
|
||||
}
|
||||
|
||||
public void loadOnlineCar() {
|
||||
if ( mNavigationTargetInfo == null ) {
|
||||
mView.renderNoNavigationInfoUi();
|
||||
return;
|
||||
}
|
||||
mView.showLoading( true );
|
||||
try {
|
||||
mToLat = Double.valueOf( mNavigationTargetInfo.getToPoiLatitude() );
|
||||
mToLon = Double.valueOf( mNavigationTargetInfo.getToPoiLongitude() );
|
||||
mRefreshModel.queryOnLineCarWithRoute( new MogoLatLng( mToLat, mToLon ),
|
||||
false,
|
||||
false,
|
||||
mStrategy.getRadius(),
|
||||
LIMIT,
|
||||
true,
|
||||
this
|
||||
);
|
||||
} catch ( Exception e ) {
|
||||
mView.renderNoNavigationInfoUi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess( MarkerResponse o ) {
|
||||
if ( o == null
|
||||
|| o.getResult() == null
|
||||
|| o.getResult().getOnlineCar() == null
|
||||
|| o.getResult().getOnlineCar().isEmpty() ) {
|
||||
mView.renderEmptyUi( mStrategy );
|
||||
} else {
|
||||
mView.renderOnlineCarList( o.getResult().getOnlineCar(), mToLon, mToLat );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail() {
|
||||
mView.renderErrorUi();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoNaviListener( TAG );
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
enum OnlineCarStrategy {
|
||||
|
||||
Strategy3( 40_000, null ),
|
||||
Strategy2( 20_000, Strategy3 ),
|
||||
Default( 10_000, Strategy2 ),
|
||||
;
|
||||
|
||||
private int radius;
|
||||
private OnlineCarStrategy next;
|
||||
|
||||
OnlineCarStrategy( int radius, OnlineCarStrategy next ) {
|
||||
this.radius = radius;
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public int getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public int getRadiusKM() {
|
||||
return radius / 1000;
|
||||
}
|
||||
|
||||
public OnlineCarStrategy getNext() {
|
||||
return next;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.mogo.module.service.strategy;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.service.MogoServices;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-13
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_REFRESH_STRATEGY_API )
|
||||
public class MogoRefreshStrategyController implements IMogoRefreshStrategyController {
|
||||
|
||||
private static final String TAG = "MogoRefreshStrategyController";
|
||||
|
||||
@Override
|
||||
public boolean restartAutoRefreshAtTime( int delay ) {
|
||||
try {
|
||||
MogoServices.getInstance().restartAutoRefreshAtTime( delay );
|
||||
return true;
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "restartAutoRefreshAtTime" );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllData() {
|
||||
MogoServices.getInstance().clearAllData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetLocationUpDelay(long delay) {
|
||||
// MogoRTKLocation.getInstance().resetUploadDelay(delay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.mogo.module.service.unwake;
|
||||
|
||||
/**
|
||||
* 全局免唤醒常量类
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class GlobalUnwakeConst {
|
||||
public static final String MODULE_NAME = "GlobalUnwakeManager";
|
||||
|
||||
// command
|
||||
public static final String VOICE_CMD_GO_TO_SHARE = "com.zhidao.share";
|
||||
/**
|
||||
* 这个是实时路况,不是拥堵,拥堵放在了extention模块里面处理
|
||||
*/
|
||||
public static final String VOICE_CMD_PUB_ROAD_CONDITION = "com.zhidao.pathfinder.report.roadCondition";
|
||||
/**
|
||||
* 故障求助
|
||||
*/
|
||||
public static final String VOICE_CMD_PUB_TROUBLE_HELP = "com.zhidao.auxiliaryDriving" +
|
||||
".pubTroubleHelp";
|
||||
/**
|
||||
* 关闭分享框 唤醒
|
||||
*/
|
||||
public static final String VOICE_CMD_SHARE_DIALOG_CLOSE = "com.zhidao.share.close";
|
||||
/**
|
||||
* 两次未回复关闭分享对话框
|
||||
*/
|
||||
public static final String VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE = "com.zhidao.share.dialog" +
|
||||
".close";
|
||||
/**
|
||||
* 免唤醒词上报拥堵,但是现在当唤醒词使用
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_ROAD_CONDITION = "command_upload_roadcondition";
|
||||
/**
|
||||
* 免唤醒词上报实时路况
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_REAL_TIME_TRAFFIC = "command_upload_real_time_traffic";
|
||||
|
||||
/**
|
||||
* 唤醒词查询出行动态
|
||||
*/
|
||||
public static final String VOICE_QUERY_HISTORY_INDEX = "com.zhidao.query.trip.event";
|
||||
/**
|
||||
* 唤醒词查询周边事件
|
||||
*/
|
||||
public static final String VOICE_QUERY_SURROUNDING_INDEX = "com.zhidao.query.nearby.event";
|
||||
/**
|
||||
* 唤醒词查询热心指数
|
||||
*/
|
||||
public static final String VOICE_QUERY_HEART_INDEX = "com.zhidao.query.myshare.index";
|
||||
|
||||
// 词
|
||||
public static final String[] UPLOAD_REAL_TIME_TRAFFIC = {"上报实时路况", "上报路况"};
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
package com.mogo.module.service.unwake;
|
||||
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.UNWAKE_UPLOAD_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.UNWAKE_UPLOAD_ROAD_CONDITION;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.UPLOAD_REAL_TIME_TRAFFIC;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_GO_TO_SHARE;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_PUB_ROAD_CONDITION;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_PUB_TROUBLE_HELP;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_SHARE_DIALOG_CLOSE;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_QUERY_HEART_INDEX;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_QUERY_HISTORY_INDEX;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_QUERY_SURROUNDING_INDEX;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
|
||||
/**
|
||||
* 全局免唤醒管理
|
||||
* 包括唤醒词指令和全局免唤醒词指令
|
||||
* 有几个Module仅仅是因为要注册全局免唤醒词,加到了BaseModule中,为了将这部分Module从BaseModule中去掉,特抽离全局免唤醒词注册监听逻辑
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_GLOBAL_UNWAKE)
|
||||
public class GlobalUnwakeManager implements IProvider, IMogoIntentListener, IMogoVoiceCmdCallBack {
|
||||
private IMogoIntentManager intentManager;
|
||||
private Context context;
|
||||
private static final String TAG = "GlobalUnwakeManager";
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "全局免唤醒模块初始化====");
|
||||
this.context = context;
|
||||
intentManager = MogoApisHandler.getInstance().getApis().getIntentManagerApi();
|
||||
intentManager.registerIntentListener(VOICE_CMD_GO_TO_SHARE, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_PUB_TROUBLE_HELP, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_PUB_ROAD_CONDITION, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(UNWAKE_UPLOAD_ROAD_CONDITION, this);
|
||||
intentManager.registerIntentListener(VOICE_QUERY_HEART_INDEX, this);
|
||||
intentManager.registerIntentListener(VOICE_QUERY_HISTORY_INDEX, this);
|
||||
intentManager.registerIntentListener(VOICE_QUERY_SURROUNDING_INDEX, this);
|
||||
|
||||
// 免唤醒词注册,全局免唤醒
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,
|
||||
UPLOAD_REAL_TIME_TRAFFIC, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
// 此处只接受处理语音相关广播
|
||||
Logger.d(TAG, "收到唤醒词指令: " + intentStr);
|
||||
switch (intentStr) {
|
||||
// 分享相关唤醒词
|
||||
case VOICE_CMD_GO_TO_SHARE:
|
||||
case VOICE_CMD_PUB_TROUBLE_HELP:
|
||||
case VOICE_CMD_PUB_ROAD_CONDITION:
|
||||
case VOICE_CMD_SHARE_DIALOG_CLOSE:
|
||||
case VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE:
|
||||
case UNWAKE_UPLOAD_ROAD_CONDITION:
|
||||
//TODO
|
||||
// MogoApisHandler.getInstance().getApis().getShareManager().onGlobalUnwake(intentStr, intent);
|
||||
break;
|
||||
case VOICE_QUERY_HISTORY_INDEX:
|
||||
Log.d("语音指令","VOICE_QUERY_HISTORY_INDEX");
|
||||
showPanelByStatus("showHistoryPanel", 0);
|
||||
break;
|
||||
case VOICE_QUERY_SURROUNDING_INDEX:
|
||||
Log.d("语音指令","VOICE_QUERY_SURROUNDING_INDEX");
|
||||
showPanelByStatus("showSurroundingPanel", 1);
|
||||
break;
|
||||
case VOICE_QUERY_HEART_INDEX:
|
||||
Log.d("语音指令","VOICE_QUERY_HEART_INDEX");
|
||||
showPanelByStatus("showSharePanel", 2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主页状态调用不同打开方式
|
||||
* @param target 面板类型
|
||||
* @param type 面板位置索引
|
||||
*/
|
||||
private void showPanelByStatus(String target, int type){
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageOnResume() ) {
|
||||
MogoApisHandler.getInstance().getApis().getEventPanelManager().showPanelWithSelectedItem(type);
|
||||
} else {
|
||||
Intent start = new Intent( Intent.ACTION_VIEW );
|
||||
start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
|
||||
start.setData( Uri.parse( "mogo://launcher/main/switch2?type="+target ) );
|
||||
context.startActivity( start );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdSelected(String cmd) {
|
||||
Logger.d(TAG, "收到免唤醒词指令: " + cmd);
|
||||
if (UNWAKE_UPLOAD_REAL_TIME_TRAFFIC.equals(cmd)) {
|
||||
//TODO
|
||||
// MogoApisHandler.getInstance().getApis().getShareManager().onGlobalUnwake(cmd, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_services_online_car_panel_marginRight"
|
||||
android:layout_marginTop="@dimen/module_services_online_car_panel_marginTop"
|
||||
android:layout_marginRight="@dimen/module_services_online_car_panel_marginRight"
|
||||
android:layout_marginBottom="@dimen/module_services_online_car_panel_marginBottom"
|
||||
android:background="@drawable/module_services_online_car_panel_background"
|
||||
android:paddingLeft="@dimen/module_services_online_car_panel_paddingLeft"
|
||||
android:paddingRight="@dimen/module_services_online_car_panel_paddingLeft">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_services_online_car_panel_title_margin_top"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/module_services_online_car_panel_title"
|
||||
android:textColor="@color/module_services_online_car_panel_title_textColor"
|
||||
android:textSize="@dimen/module_services_online_car_panel_title_text_size" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_services_id_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/module_services_online_car_panel_close_margin_top"
|
||||
android:src="@drawable/module_common_close_selector" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/module_services_id_loading"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="43dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminateTint="#256BFF"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.5" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/module_services_id_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/module_services_online_car_panel_recycler_view_margin_top"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_services_id_load_strategy_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/module_services_online_car_panel_empty_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_empty_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_services_empty_tip_marginTop"
|
||||
android:textColor="@color/module_services_empty_tip_textColor"
|
||||
android:textSize="@dimen/module_services_empty_tip_textSize"
|
||||
android:textStyle="bold"
|
||||
tools:text="很抱歉,目的地10公里内未找到车友" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_services_panel_strategy_button_marginTop"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_20Km_radius"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/module_services_load_strategy_marginRight"
|
||||
android:background="@drawable/module_services_panel_strategy_button_bkg"
|
||||
android:paddingLeft="@dimen/module_services_load_strategy_paddingLeft"
|
||||
android:paddingTop="@dimen/module_services_load_strategy_paddingTop"
|
||||
android:paddingRight="@dimen/module_services_load_strategy_paddingLeft"
|
||||
android:paddingBottom="@dimen/module_services_load_strategy_paddingTop"
|
||||
android:text="@string/module_services_str_20Km_radius"
|
||||
android:textColor="@color/module_services_load_strategy_textColor"
|
||||
android:textSize="@dimen/module_services_load_strategy_textSize"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_40Km_radius"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/module_services_panel_strategy_button_bkg"
|
||||
android:paddingLeft="@dimen/module_services_load_strategy_paddingLeft"
|
||||
android:paddingTop="@dimen/module_services_load_strategy_paddingTop"
|
||||
android:paddingRight="@dimen/module_services_load_strategy_paddingLeft"
|
||||
android:paddingBottom="@dimen/module_services_load_strategy_paddingTop"
|
||||
android:text="@string/module_services_str_40Km_radius"
|
||||
android:textColor="@color/module_services_load_strategy_textColor"
|
||||
android:textSize="@dimen/module_services_load_strategy_textSize"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_services_id_error_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/module_services_online_car_panel_recycler_view_margin_top"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/module_services_error_text"
|
||||
android:textColor="@color/module_services_error_textColor"
|
||||
android:textSize="@dimen/module_services_empty_tip_textSize" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/module_services_panel_item_marginBottom"
|
||||
android:background="@drawable/module_services_panel_item_bkg"
|
||||
android:paddingTop="@dimen/module_services_panel_item_padding"
|
||||
android:paddingStart="@dimen/module_services_panel_item_start"
|
||||
android:paddingBottom="@dimen/module_services_panel_item_padding">
|
||||
|
||||
<com.mogo.eagle.core.widget.CustomCircleImageView
|
||||
android:id="@+id/module_services_id_panel_item_avatar"
|
||||
android:layout_width="@dimen/module_services_panel_item_avatar_size"
|
||||
android:layout_height="@dimen/module_services_panel_item_avatar_size"
|
||||
android:src="@drawable/module_common_default_user_head"
|
||||
app:civ_border_color="@color/module_services_id_panel_item_avatar_border_color"
|
||||
app:civ_border_width="@dimen/module_services_id_panel_item_avatar_border_width"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_panel_item_nickname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_services_panel_item_nickname_marginLeft"
|
||||
android:layout_marginTop="@dimen/module_services_panel_item_nickname_marginTop"
|
||||
android:textColor="@color/module_services_panel_item_nickname_textColor"
|
||||
android:textSize="@dimen/module_services_panel_item_nickname_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_services_id_panel_item_avatar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="1111111" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_panel_item_distance_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/module_services_panel_item_distance_textColor"
|
||||
android:textSize="@dimen/module_services_panel_item_distance_textSize"
|
||||
android:layout_marginBottom="@dimen/module_services_panel_item_distance_tag_marginBottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_services_id_panel_item_nickname"
|
||||
android:text="@string/module_services_panel_item_distance_tag_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_panel_item_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_services_id_panel_item_distance_marginLeft"
|
||||
android:textColor="@color/module_services_panel_item_nickname_textColor"
|
||||
android:textSize="@dimen/module_services_panel_item_distance_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_services_id_panel_item_distance_tag"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_services_id_panel_item_distance_tag"
|
||||
tools:text="980M" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_panel_item_call"
|
||||
android:layout_width="@dimen/modle_car_panel_call"
|
||||
android:layout_height="@dimen/modle_car_panel_call"
|
||||
android:layout_marginEnd="@dimen/modle_car_panel_call_margin"
|
||||
android:background="@drawable/module_common_selector_call"
|
||||
android:padding="@dimen/module_services_panel_item_detail_padding"
|
||||
android:textColor="@color/module_services_panel_item_detail_textColor"
|
||||
android:textSize="@dimen/module_services_panel_item_detail_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/module_services_id_panel_item_detail"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_panel_item_detail"
|
||||
android:layout_width="@dimen/modle_car_panel_call"
|
||||
android:background="@drawable/selector_service_car_panel_details"
|
||||
android:layout_height="@dimen/modle_car_panel_call"
|
||||
android:padding="@dimen/module_services_panel_item_detail_padding"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/module_services_panel_item_detail_textColor"
|
||||
android:textSize="@dimen/module_services_panel_item_detail_textSize"
|
||||
android:layout_marginRight="@dimen/module_services_panel_item_start"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="90px"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_status_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="90px"
|
||||
android:textColor="#000"
|
||||
android:textSize="40px" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_services_status_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
android:src="@drawable/module_common_icon_close_vr" />
|
||||
</FrameLayout>
|
||||
@@ -126,13 +126,6 @@ public interface IMogoServiceApis extends IProvider {
|
||||
*/
|
||||
IMogoActionManager getActionManagerApi();
|
||||
|
||||
/**
|
||||
* 获取刷新策略控制接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoRefreshStrategyController getRefreshStrategyControllerApi();
|
||||
|
||||
|
||||
/**
|
||||
* 获取顶部1/2屏界面管理类
|
||||
|
||||
@@ -120,11 +120,6 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance(IMogoActionManager.class, MogoServicePaths.PATH_ACTION_APIS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoRefreshStrategyController getRefreshStrategyControllerApi() {
|
||||
return getApiInstance(IMogoRefreshStrategyController.class, MogoServicePaths.PATH_REFRESH_STRATEGY_API);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoTopViewManager getTopViewManager() {
|
||||
return getApiInstance(IMogoTopViewManager.class, MogoServicePaths.PATH_EXTENSIONS_TOP_VIEW_MANAGER);
|
||||
|
||||
@@ -230,7 +230,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
@Override
|
||||
public void changeAdasControlMode(EnumMapUI ui) {
|
||||
if (ui == null || !DebugConfig.isMapBased()) {
|
||||
if (ui == null ) {
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "new Mode: " + ui.name());
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.network.RetrofitFactory;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
|
||||
/**
|
||||
@@ -23,12 +23,12 @@ public class MogoNetWorkService implements IMogoNetwork {
|
||||
|
||||
@Override
|
||||
public <T> T create(Class<T> service, String baseUrl) {
|
||||
return RetrofitFactory.getInstance(baseUrl).create(service);
|
||||
return MoGoRetrofitFactory.getInstance(baseUrl).create(service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T createNoCallAdapter(Class<T> service, String baseUrl) {
|
||||
return RetrofitFactory.getInstanceNoCallAdapter(baseUrl).create(service);
|
||||
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl).create(service);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user