目的地车友白天模式及其他
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<dimen name="module_ext_common_corner">30px</dimen>
|
||||
<dimen name="module_ext_button_width">120px</dimen>
|
||||
<dimen name="module_ext_button_height">120px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">30px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">10px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">22px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize_large">28px</dimen>
|
||||
<dimen name="module_ext_north_textSize">28px</dimen>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<dimen name="module_ext_common_corner">30px</dimen>
|
||||
<dimen name="module_ext_button_width">120px</dimen>
|
||||
<dimen name="module_ext_button_height">120px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">30px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">10px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">22px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize_large">28px</dimen>
|
||||
<dimen name="module_ext_north_textSize">28px</dimen>
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
<dimen name="module_ext_north_goneMarginTop">142px</dimen>
|
||||
<dimen name="module_ext_button_width">66px</dimen>
|
||||
<dimen name="module_ext_button_height">66px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">16px</dimen>
|
||||
<dimen name="module_ext_camera_button_marginTop">10px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize">12px</dimen>
|
||||
<dimen name="module_ext_display_overview_textSize_large">14px</dimen>
|
||||
<dimen name="module_ext_north_textSize">14px</dimen>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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" );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 583 B After Width: | Height: | Size: 587 B |
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient android:angle="0" android:endColor="#676982" android:startColor="#8384A9" />
|
||||
<gradient android:angle="0" android:endColor="#66676982" android:startColor="#668384A9" />
|
||||
<corners android:radius="@dimen/module_services_panel_item_detail_bkg_corner" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -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">
|
||||
|
||||
<ImageView
|
||||
@@ -124,7 +125,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="加载失败,请点击重试"
|
||||
android:textColor="#FFFFFF" />
|
||||
android:textColor="@color/module_services_error_textColor"
|
||||
android:textSize="@dimen/module_services_empty_tip_textSize" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -8,4 +8,5 @@
|
||||
<color name="module_services_panel_item_detail_textColor">#FFFFFF</color>
|
||||
<color name="module_services_id_panel_item_avatar_border_color">#3081A4DC</color>
|
||||
<color name="module_services_empty_tip_textColor">#B2FFFFFF</color>
|
||||
<color name="module_services_error_textColor">#FFFFFF</color>
|
||||
</resources>
|
||||
@@ -83,7 +83,6 @@ class MogoWidgetManger implements IMogoNaviListener2, IMogoIntentListener, IMogo
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
SpStorage.setNavigationTarget( "" );
|
||||
AutoNaviIntentHandler.getInstance().closeEntrance();
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 444 B |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 444 B |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#DDDDDD"/>
|
||||
<corners android:radius="@dimen/module_services_panel_item_corner"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient android:angle="0" android:endColor="#66676982" android:startColor="#668384A9" />
|
||||
<corners android:radius="@dimen/module_services_panel_item_detail_bkg_corner" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient android:angle="0" android:endColor="#66585E8B" android:startColor="#662E324B" />
|
||||
<corners android:radius="@dimen/module_services_panel_strategy_button_bkg_corner" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,4 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_service_info_window_content_textColor_light">#333333</color>
|
||||
<color name="module_services_online_car_panel_title_textColor_light">#FF333333</color>
|
||||
<color name="module_services_empty_tip_textColor_light">#FF333333</color>
|
||||
<color name="module_services_error_textColor_light">#FF333333</color>
|
||||
<color name="module_services_load_strategy_textColor_light">#000000</color>
|
||||
|
||||
<color name="module_services_panel_item_nickname_textColor_light">#333333</color>
|
||||
<color name="module_services_panel_item_detail_textColor_light">#333333</color>
|
||||
<color name="module_services_panel_item_distance_textColor_light">#666666</color>
|
||||
</resources>
|
||||
|
||||