diff --git a/app/build.gradle b/app/build.gradle index 536d5ac6c6..48cda21e4a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -86,6 +86,9 @@ android { // 是否作为 launcher 运行 buildConfigField 'boolean', 'IS_LAUNCHER', 'false' buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"' + // 是否支持目的地导航策略 + buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'true' + } // launcher app launcher { @@ -95,6 +98,8 @@ android { // 是否作为 launcher 运行 buildConfigField 'boolean', 'IS_LAUNCHER', 'true' buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"' + // 是否支持目的地导航策略 + buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'false' } // f系列-分体机全系列,未细分 f8xx { @@ -115,6 +120,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false' } // f系列-分体机 f80x { @@ -135,6 +142,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false' } // e系列,采用Launcher方案 e8xx { @@ -155,6 +164,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false' } // 同上 em4 { @@ -175,6 +186,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false' } // e系列-2+32,对标D系列2+32,采用独立app的形式 em3 { @@ -195,6 +208,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true' } // e系列-1+16,对标D系列1+16,采用独立app形式 em1 { @@ -215,6 +230,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true' } // d系列 d8xx { @@ -255,6 +272,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true' } // d系列 1+16 版本 d82x { @@ -275,6 +294,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true' } // 比亚迪 bydauto { @@ -295,6 +316,8 @@ android { buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'false' // 是否支持查询导航目的地车友 buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'false' + // 是否支持桌面卡片刷新 + buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false' } qa { dimension "env" diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index 7abefd176e..c5c04bd683 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -132,6 +132,8 @@ public class MogoApplication extends AbsMogoApplication { DebugConfig.setLoadGuideModule( BuildConfig.LOAD_GUIDE_MODULE ); DebugConfig.setSkinSupported( BuildConfig.IS_SKIN_SUPPORTED ); DebugConfig.setSupportedSearchDestinationOnlineCarList( BuildConfig.IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST ); + DebugConfig.setScheduleCalculateNotHomeCompanyDistanceForPush( BuildConfig.IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH ); + DebugConfig.setSupportLauncherCardRefreshStrategy( BuildConfig.IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY ); } @Override diff --git a/config.gradle b/config.gradle index fd07584843..ce651c5fef 100644 --- a/config.gradle +++ b/config.gradle @@ -133,7 +133,7 @@ targetSdkVersion : 22, jetbrainsannotationsjava5 : "org.jetbrains:annotations-java5:15.0", // 统一登录 - accountsdk : "com.zhidao.accountservice:account-sdk:1.0.11", + accountsdk : "com.zhidao.accountservice:account-sdk:1.0.14", // crash crashSdk : "com.zhidaoauto.crash.log:library:1.0.5", kotlinstdlibjdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}", diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java index 91bcb237ec..2b37445066 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java @@ -290,4 +290,30 @@ public class DebugConfig { public static boolean isSupportedSearchDestinationOnlineCarList() { return isSupportedSearchDestinationOnlineCarList; } + + /** + * 是否支持目的地导航推送策略 + */ + private static boolean isScheduleCalculateNotHomeCompanyDistanceForPush = false; + + public static void setScheduleCalculateNotHomeCompanyDistanceForPush( boolean isScheduleCalculateNotHomeCompanyDistanceForPush ) { + DebugConfig.isScheduleCalculateNotHomeCompanyDistanceForPush = isScheduleCalculateNotHomeCompanyDistanceForPush; + } + + public static boolean isIsScheduleCalculateNotHomeCompanyDistanceForPush() { + return isScheduleCalculateNotHomeCompanyDistanceForPush; + } + + /** + * 是否支持刷新桌面卡片 + */ + private static boolean isSupportLauncherCardRefreshStrategy = false; + + public static void setSupportLauncherCardRefreshStrategy( boolean isSupportLauncherCardRefreshStrategy ) { + DebugConfig.isSupportLauncherCardRefreshStrategy = isSupportLauncherCardRefreshStrategy; + } + + public static boolean isIsSupportLauncherCardRefreshStrategy() { + return isSupportLauncherCardRefreshStrategy; + } } diff --git a/modules/mogo-module-common/build.gradle b/modules/mogo-module-common/build.gradle index 3a8b6d5986..bf000cacf7 100644 --- a/modules/mogo-module-common/build.gradle +++ b/modules/mogo-module-common/build.gradle @@ -33,6 +33,7 @@ dependencies { implementation rootProject.ext.dependencies.androidxrecyclerview implementation rootProject.ext.dependencies.androidxconstraintlayout implementation rootProject.ext.dependencies.arouter + implementation rootProject.ext.dependencies.carcallprovider if (Boolean.valueOf(RELEASE)) { api rootProject.ext.dependencies.mogomap api rootProject.ext.dependencies.mogomapapi diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/api/CallChatApi.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/api/CallChatApi.java new file mode 100644 index 0000000000..ffea53dfd0 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/api/CallChatApi.java @@ -0,0 +1,78 @@ +package com.mogo.module.common.api; + +import android.content.Context; + +import com.alibaba.android.arouter.launcher.ARouter; +import com.mogo.module.carchattingprovider.ICarsChattingProvider; +import com.mogo.module.common.entity.MarkerOnlineCar; +import com.mogo.utils.logger.Logger; +import com.zhidao.carchattingprovider.MogoDriverInfo; + +public +/** + * @author congtaowang + * @since 2020/9/24 + * + * 车聊聊接口 + */ +class CallChatApi { + + private static final String TAG = "CallChatApi"; + + private static volatile CallChatApi sInstance; + + private CallChatApi() { + mApiProvider = ARouter.getInstance().navigation( ICarsChattingProvider.class ); + } + + public static CallChatApi getInstance() { + if ( sInstance == null ) { + synchronized ( CallChatApi.class ) { + if ( sInstance == null ) { + sInstance = new CallChatApi(); + } + } + } + return sInstance; + } + + public synchronized void release() { + mApiProvider = null; + sInstance = null; + } + + private Object readResolve() { + // 阻止反序列化,必须实现 Serializable 接口 + return sInstance; + } + + private ICarsChattingProvider mApiProvider; + + public void showUserWindow( Context context, MarkerOnlineCar onlineCar ) throws Exception { + if ( mApiProvider == null ) { + Logger.e( TAG, "no call chat api instance." ); + return; + } + MogoDriverInfo driverInfo = new MogoDriverInfo(); + driverInfo.setAge( onlineCar.getUserInfo().getAgeNumber() ); + driverInfo.setCarTypeName( onlineCar.getCarInfo().getCarTypeName() ); + driverInfo.setGender( onlineCar.getUserInfo().getGender() ); + driverInfo.setLat( onlineCar.getLocation().getLat() ); + driverInfo.setLon( onlineCar.getLocation().getLon() ); + driverInfo.setLocationInfo( onlineCar.getLocation().getAddress() ); + driverInfo.setSn( onlineCar.getUserInfo().getSn() ); + driverInfo.setUserHead( onlineCar.getUserInfo().getUserHead() ); + driverInfo.setUserName( onlineCar.getUserInfo().getUserName() ); + mApiProvider.showUserWindow( TAG, driverInfo, context ); + } + + public void hideUserWindow( Context context ) { + if ( mApiProvider != null ) { + if ( mApiProvider == null ) { + Logger.e( TAG, "no call chat api instance." ); + return; + } + } + mApiProvider.hideUserWindow( TAG, context, null ); + } +} diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml index b5da488ae6..77074d07cd 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml @@ -48,7 +48,6 @@ android:gravity="center_vertical" android:text="@string/module_ext_destination_online_car_text" android:visibility="gone" - android:layout_marginLeft="@dimen/module_common_shadow_width_pos" android:textColor="@color/module_ext_color_voice_text" android:textSize="@dimen/module_ext_north_textSize" android:textStyle="bold" diff --git a/modules/mogo-module-extensions/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-xhdpi-1920x1000/dimens.xml index a30623fe52..75f2f2b1fa 100644 --- a/modules/mogo-module-extensions/src/main/res/values-xhdpi-1920x1000/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values-xhdpi-1920x1000/dimens.xml @@ -131,7 +131,7 @@ 30px 120px 120px - 30px + 10px 22px 28px 28px diff --git a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml index 33ef63c151..125e839721 100644 --- a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml @@ -131,7 +131,7 @@ 30px 120px 120px - 30px + 10px 22px 28px 28px diff --git a/modules/mogo-module-extensions/src/main/res/values/dimens.xml b/modules/mogo-module-extensions/src/main/res/values/dimens.xml index f92b46b195..e0ccc1e24d 100644 --- a/modules/mogo-module-extensions/src/main/res/values/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values/dimens.xml @@ -137,7 +137,7 @@ 142px 66px 66px - 16px + 10px 12px 14px 14px diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java index aacf70217f..7463f84d34 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java @@ -201,7 +201,7 @@ public class MogoServices implements IMogoMapListener, } break; case ServiceConst.MSG_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH: - handleCalculationNotHomeCompanyDistanceForPush(); + handleCalculationNotHomeCompanyDistanceForPush( msg.arg1 ); break; } } @@ -944,8 +944,12 @@ public class MogoServices implements IMogoMapListener, @Override public void onStartNavi() { - Logger.d( TAG, "onStartNavi: scheduleCalculationNotHomeCompanyDistanceForPush" ); - scheduleCalculationNotHomeCompanyDistanceForPush(); + if ( DebugConfig.isIsScheduleCalculateNotHomeCompanyDistanceForPush() ) { + Logger.d( TAG, "onStartNavi: scheduleCalculationNotHomeCompanyDistanceForPush" ); + scheduleCalculationNotHomeCompanyDistanceForPush( 1, ServiceConst.INTERVAL_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH ); + } else { + Logger.d( TAG, "onStartNavi: scheduleCalculationNotHomeCompanyDistanceForPush un support" ); + } } @Override @@ -957,14 +961,22 @@ public class MogoServices implements IMogoMapListener, /** * 延时一分钟发起计算导航目的地推送策略 */ - private void scheduleCalculationNotHomeCompanyDistanceForPush() { - mHandler.sendEmptyMessageDelayed( ServiceConst.MSG_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH, ServiceConst.INTERVAL_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH ); + private void scheduleCalculationNotHomeCompanyDistanceForPush( int time, long delay ) { + Message msg = Message.obtain(); + msg.what = ServiceConst.MSG_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH; + msg.arg1 = time; + mHandler.sendMessageDelayed( msg, delay ); } /** * 发起计算导航目的地推送策略 + * + * @param time 第x次重试 */ - private void handleCalculationNotHomeCompanyDistanceForPush() { + private void handleCalculationNotHomeCompanyDistanceForPush( final int time ) { + if ( time > 3 ) { + return; + } String json = SpStorage.getNavigationTarget(); if ( !TextUtils.isEmpty( json ) ) { try { @@ -993,6 +1005,9 @@ public class MogoServices implements IMogoMapListener, @Override public void onError( Throwable e ) { super.onError( e ); + Logger.d( TAG, "re scheduleCalculationNotHomeCompanyDistanceForPush after 30s" ); + // 延时30s重试 + scheduleCalculationNotHomeCompanyDistanceForPush( time + 1, 30_000L ); } @Override diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarPanelIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarPanelIntentHandler.java index e48297bf71..0fc9085e6d 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarPanelIntentHandler.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarPanelIntentHandler.java @@ -3,7 +3,10 @@ package com.mogo.module.service.intent; import android.content.Context; import android.content.Intent; import android.net.Uri; +import android.text.TextUtils; +import com.mogo.commons.storage.SpStorage; +import com.mogo.commons.voice.AIAssist; import com.mogo.module.service.MarkerServiceHandler; public @@ -17,6 +20,12 @@ class OnlineCarPanelIntentHandler implements IntentHandler { @Override public void handle( Context context, Intent intent ) { + String json = SpStorage.getNavigationTarget(); + if ( TextUtils.isEmpty( json ) ) { + AIAssist.getInstance( context ).speakTTSVoice( "没有导航目的地" ); + return; + } + AIAssist.getInstance( context ).speakTTSVoice( "正在查询" ); if ( MarkerServiceHandler.getMogoStatusManager().isMainPageOnResume() ) { MarkerServiceHandler.getApis().getOnlineCarPanelApi().showPanel(); } else { diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java index ceee0204a2..42614860ee 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java @@ -76,6 +76,11 @@ class LauncherCardRefresher { */ private int mDefaultConfigCounter = 0; + /** + * 事件/车友播报次数 + */ + private int mMsgExplorerWayOrOnlineCarDataCounter = 0; + /** * 因为缓存ticket失效导致失败的情况,需要重新请求ticket然后再次获取数据,这里重试3次 */ @@ -151,18 +156,18 @@ class LauncherCardRefresher { private ZhidaoRefreshModel mZhidaoRefreshModel; private LauncherCardRefreshStrategy mExplorerWayOrOnlineCarDataStrategy = new LauncherCardRefreshStrategy( - 40 * ONE_MINUTE,null, MSG_EXPLORER_WAY_OR_ONLINE_CAR_DATA + 40 * ONE_MINUTE, null, MSG_EXPLORER_WAY_OR_ONLINE_CAR_DATA ); private LauncherCardRefreshStrategy mInduceStrategy = new LauncherCardRefreshStrategy( - 3 * ONE_MINUTE,mExplorerWayOrOnlineCarDataStrategy, MSG_INDUCE + 3 * ONE_MINUTE, mExplorerWayOrOnlineCarDataStrategy, MSG_INDUCE ); private LauncherCardRefreshStrategy mLauncherCardConfigStrategy = new LauncherCardRefreshStrategy( - 2 * ONE_MINUTE,mInduceStrategy, MSG_REFRESH_DEFAULT_CARD + 2 * ONE_MINUTE, mInduceStrategy, MSG_REFRESH_DEFAULT_CARD ); private LauncherCardRefreshStrategy mRefreshStrategy = mLauncherCardConfigStrategy; public void start() { - if ( DebugConfig.isLauncher() || DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ) { + if ( !DebugConfig.isIsSupportLauncherCardRefreshStrategy() ) { return; } if ( mStart ) { @@ -172,6 +177,7 @@ class LauncherCardRefresher { mLaunchTTSText = mContext.getString( R.string.module_service_open_app_tip ); mDefaultConfigCounter = 0; mRefreshTicketCounter = 0; + mMsgExplorerWayOrOnlineCarDataCounter = 0; mRefreshStrategy = mLauncherCardConfigStrategy; // 延时加载数据,已保证accOn之后网络恢复正常 long delay = ONE_MINUTE; @@ -238,6 +244,10 @@ class LauncherCardRefresher { restart(); return; } + mMsgExplorerWayOrOnlineCarDataCounter++; + if ( mMsgExplorerWayOrOnlineCarDataCounter > 2 ) { + return; + } MogoLatLng latLng = new MogoLatLng( location.getLatitude(), location.getLongitude() ); handleRefreshExplorerWayOrOnlineCarData( latLng, mRefreshStrategy.getType() ); } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java index eccbd1b862..591a3e5695 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java @@ -3,6 +3,7 @@ package com.mogo.module.service.marker; import android.content.Context; import android.graphics.Rect; import android.text.TextUtils; +import android.util.Log; import android.view.animation.AccelerateInterpolator; import android.view.animation.LinearInterpolator; @@ -16,6 +17,7 @@ import com.mogo.map.marker.MogoMarkerOptions; import com.mogo.map.marker.anim.OnMarkerAnimationListener; import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.module.common.ModuleNames; +import com.mogo.module.common.api.CallChatApi; import com.mogo.module.common.entity.MarkerCarPois; import com.mogo.module.common.entity.MarkerCardResult; import com.mogo.module.common.entity.MarkerExploreWay; @@ -187,9 +189,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener, // 在线车辆点击使用infoWindow if ( TextUtils.equals( mogoMarker.getOwner(), ModuleNames.CARD_TYPE_USER_DATA ) ) { if ( !mogoMarker.isDestroyed() ) { - mogoMarker.setInfoWindowAdapter( UserDataMarkerInfoWindowAdapter.getInstance( mContext ) ); - mogoMarker.showInfoWindow(); - Logger.d( TAG, "打开info window" ); + try { + MarkerOnlineCar onlineCar = ( MarkerOnlineCar ) ( ( MarkerShowEntity ) mogoMarker.getObject() ).getBindObj(); + CallChatApi.getInstance().showUserWindow( mContext, onlineCar ); + } catch ( Exception e ) { + Logger.e( TAG, e, "openMarker" ); + } } } else { Object object = mogoMarker.getObject(); @@ -220,7 +225,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, } // 在线车辆点击使用infoWindow if ( TextUtils.equals( mogoMarker.getOwner(), ModuleNames.CARD_TYPE_USER_DATA ) ) { - mogoMarker.hideInfoWindow(); +// mogoMarker.hideInfoWindow(); Logger.d( TAG, "关闭info window" ); } else { Object object = mogoMarker.getObject(); @@ -792,7 +797,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, } Logger.d( TAG, "内部 - 请求开始" ); - mRefreshModel.queryOnLineCarWithRoute( latLng, onlyFocus, onlySameCity, radius, limit,false, new RefreshCallback() { + mRefreshModel.queryOnLineCarWithRoute( latLng, onlyFocus, onlySameCity, radius, limit, false, new RefreshCallback() { @Override public void onSuccess( Object o ) { MarkerResponse data = ( MarkerResponse ) o; @@ -977,7 +982,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, return; } if ( mLastDataResult != null ) { - runOnTargetThread( ()->{ + runOnTargetThread( () -> { MarkerServiceHandler.getMarkerManager().removeMarkers( ModuleNames.CARD_TYPE_ROAD_CONDITION ); drawMarkerByCurrentType( mLastDataResult ); mLastCheckMarker = null; diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java index 356ec9bfac..fa93ca300a 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java @@ -198,6 +198,14 @@ public class RefreshModel { } } + @Override + public void onError( Throwable e ) { + super.onError( e ); + if ( callback != null ) { + callback.onFail(); + } + } + @Override public void onError( String message, int code ) { super.onError( message, code ); diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelAdapter.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelAdapter.java index 9a6c35a81f..55da33b57a 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelAdapter.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelAdapter.java @@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.request.RequestOptions; import com.mogo.map.location.MogoLocation; 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.glide.SkinAbleBitmapTarget; @@ -21,6 +22,7 @@ import com.mogo.module.service.Utils; import com.mogo.utils.ResourcesHelper; import com.mogo.utils.WindowUtils; import com.mogo.utils.glide.GlideApp; +import com.mogo.utils.logger.Logger; import java.util.List; @@ -32,6 +34,8 @@ import java.util.List; */ class OnlineCarPanelAdapter extends RecyclerView.Adapter< OnlineCarPanelAdapter.VH > { + private static final String TAG = "OnlineCarPanelAdapter"; + private List< MarkerOnlineCar > mDatums; private double mToLon; private double mToLat; @@ -89,6 +93,11 @@ class OnlineCarPanelAdapter extends RecyclerView.Adapter< OnlineCarPanelAdapter. 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" ); + } } ); } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelFragment.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelFragment.java index 9a35ffedcd..0975324f90 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelFragment.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/onlinecar/panel/OnlineCarPanelFragment.java @@ -113,6 +113,7 @@ public class OnlineCarPanelFragment extends MvpFragment< IOnlineCarPanelView, On mRefreshPanel.setVisibility( View.VISIBLE ); mLoading.setVisibility( View.GONE ); + AIAssist.getInstance( getContext() ).speakTTSVoice( "未找到车友" ); if ( strategy == null ) { m20KMStrategy.setVisibility( View.GONE ); m40KMStrategy.setVisibility( View.GONE ); diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_services_online_car_panel_background.9.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_services_online_car_panel_background.9.png index d4a8803684..b3149721b1 100644 Binary files a/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_services_online_car_panel_background.9.png and b/modules/mogo-module-service/src/main/res/drawable-xhdpi/module_services_online_car_panel_background.9.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable/module_services_online_car_panel_background.9.png b/modules/mogo-module-service/src/main/res/drawable/module_services_online_car_panel_background.9.png index 80ab4b841f..f19ee05db1 100644 Binary files a/modules/mogo-module-service/src/main/res/drawable/module_services_online_car_panel_background.9.png and b/modules/mogo-module-service/src/main/res/drawable/module_services_online_car_panel_background.9.png differ diff --git a/modules/mogo-module-service/src/main/res/drawable/module_services_panel_item_detail_bkg.xml b/modules/mogo-module-service/src/main/res/drawable/module_services_panel_item_detail_bkg.xml index 536a7a8e09..9a503568e3 100644 --- a/modules/mogo-module-service/src/main/res/drawable/module_services_panel_item_detail_bkg.xml +++ b/modules/mogo-module-service/src/main/res/drawable/module_services_panel_item_detail_bkg.xml @@ -2,7 +2,7 @@ - + diff --git a/modules/mogo-module-service/src/main/res/layout/module_services_fragment_online_car_panel.xml b/modules/mogo-module-service/src/main/res/layout/module_services_fragment_online_car_panel.xml index 9fa4b9aafb..5fd663bd11 100644 --- a/modules/mogo-module-service/src/main/res/layout/module_services_fragment_online_car_panel.xml +++ b/modules/mogo-module-service/src/main/res/layout/module_services_fragment_online_car_panel.xml @@ -35,10 +35,10 @@ android:layout_height="43dp" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" - android:indeterminateTint="#256BFF" - app:layout_constraintEnd_toEndOf="parent" 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" @@ -57,6 +57,7 @@ android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" + tools:visibility="visible" android:visibility="gone"> + android:textColor="@color/module_services_error_textColor" + android:textSize="@dimen/module_services_empty_tip_textSize" /> \ No newline at end of file diff --git a/modules/mogo-module-service/src/main/res/values/colors.xml b/modules/mogo-module-service/src/main/res/values/colors.xml index f770bfe69f..aa88d40e7f 100644 --- a/modules/mogo-module-service/src/main/res/values/colors.xml +++ b/modules/mogo-module-service/src/main/res/values/colors.xml @@ -8,4 +8,5 @@ #FFFFFF #3081A4DC #B2FFFFFF + #FFFFFF \ No newline at end of file diff --git a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java b/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java index ab99a79fd5..0032be1ef0 100644 --- a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java +++ b/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/MogoWidgetManger.java @@ -83,7 +83,6 @@ class MogoWidgetManger implements IMogoNaviListener2, IMogoIntentListener, IMogo @Override public void onStopNavi() { - SpStorage.setNavigationTarget( "" ); AutoNaviIntentHandler.getInstance().closeEntrance(); } diff --git a/skin/mogo-skin-light/src/main/module-commons-res/drawable-xhdpi/module_common_default_user_head_light.png b/skin/mogo-skin-light/src/main/module-commons-res/drawable-xhdpi/module_common_default_user_head_light.png new file mode 100644 index 0000000000..eb26174ed6 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-commons-res/drawable-xhdpi/module_common_default_user_head_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-commons-res/drawable/module_common_default_user_head_light.png b/skin/mogo-skin-light/src/main/module-commons-res/drawable/module_common_default_user_head_light.png new file mode 100644 index 0000000000..21805b2ff7 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-commons-res/drawable/module_common_default_user_head_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable-mdpi/module_services_close_light.png b/skin/mogo-skin-light/src/main/module-services-res/drawable-mdpi/module_services_close_light.png new file mode 100755 index 0000000000..d25aa13032 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-services-res/drawable-mdpi/module_services_close_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable-mdpi/module_services_online_car_panel_background_light.9.png b/skin/mogo-skin-light/src/main/module-services-res/drawable-mdpi/module_services_online_car_panel_background_light.9.png new file mode 100644 index 0000000000..36ea7d6655 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-services-res/drawable-mdpi/module_services_online_car_panel_background_light.9.png differ diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable-xhdpi/module_services_close_light.png b/skin/mogo-skin-light/src/main/module-services-res/drawable-xhdpi/module_services_close_light.png new file mode 100755 index 0000000000..cbf14c5566 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-services-res/drawable-xhdpi/module_services_close_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable-xhdpi/module_services_online_car_panel_background_light.9.png b/skin/mogo-skin-light/src/main/module-services-res/drawable-xhdpi/module_services_online_car_panel_background_light.9.png new file mode 100644 index 0000000000..51a1e27744 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-services-res/drawable-xhdpi/module_services_online_car_panel_background_light.9.png differ diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_close_light.png b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_close_light.png new file mode 100755 index 0000000000..d25aa13032 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_close_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_online_car_panel_background_light.9.png b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_online_car_panel_background_light.9.png new file mode 100644 index 0000000000..5ff5526ff8 Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_online_car_panel_background_light.9.png differ diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_item_bkg_light.xml b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_item_bkg_light.xml new file mode 100644 index 0000000000..d126dfc22a --- /dev/null +++ b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_item_bkg_light.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_item_detail_bkg_light.xml b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_item_detail_bkg_light.xml new file mode 100644 index 0000000000..9a503568e3 --- /dev/null +++ b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_item_detail_bkg_light.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_strategy_button_bkg_light.xml b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_strategy_button_bkg_light.xml new file mode 100644 index 0000000000..743e40ec7f --- /dev/null +++ b/skin/mogo-skin-light/src/main/module-services-res/drawable/module_services_panel_strategy_button_bkg_light.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/skin/mogo-skin-light/src/main/module-services-res/values/colors.xml b/skin/mogo-skin-light/src/main/module-services-res/values/colors.xml index 823423c2f2..4d908261d8 100644 --- a/skin/mogo-skin-light/src/main/module-services-res/values/colors.xml +++ b/skin/mogo-skin-light/src/main/module-services-res/values/colors.xml @@ -1,4 +1,12 @@ #333333 + #FF333333 + #FF333333 + #FF333333 + #000000 + + #333333 + #333333 + #666666