stash
@@ -9,12 +9,12 @@ import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.gps.simulator.IMogoGpsSimulatorManager;
|
||||
import com.mogo.module.service.marker.MapMarkerManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
@@ -69,7 +69,7 @@ public class MarkerServiceHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
sApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( context );
|
||||
sApis = MogoApisHandler.getInstance().getApis();
|
||||
sMapService = sApis.getMapServiceApi();
|
||||
sImageloader = sApis.getImageLoaderApi();
|
||||
sMogoStatusManager = sApis.getStatusManagerApi();
|
||||
|
||||
@@ -15,6 +15,9 @@ import android.view.MotionEvent;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.ParamsProvider;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -38,6 +41,9 @@ import com.mogo.module.service.launchercard.LauncherCardRefresher;
|
||||
import com.mogo.module.service.marker.MapMarkerManager;
|
||||
import com.mogo.module.service.network.RefreshCallback;
|
||||
import com.mogo.module.service.network.RefreshModel;
|
||||
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 com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.service.refresh.AutoRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.CustomRefreshStrategy;
|
||||
@@ -60,10 +66,16 @@ import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -243,7 +255,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
/**
|
||||
* 自动刷新回调
|
||||
*/
|
||||
private RefreshCallback mAutoRefreshCallback = new RefreshCallback<MarkerResponse>() {
|
||||
private RefreshCallback mAutoRefreshCallback = new RefreshCallback< MarkerResponse >() {
|
||||
@Override
|
||||
public void onSuccess( MarkerResponse o ) {
|
||||
MapMarkerManager.getInstance().onSyncMarkerResponse( o );
|
||||
@@ -390,6 +402,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTION_AUTO_NAVI_RECEIVER, this );
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTION_AUTO_NAVI_SEND, this );
|
||||
mIntentManager.registerIntentListener( MogoReceiver.ACTION_MOGO, this );
|
||||
mIntentManager.registerIntentListener( ServiceConst.COMMAND_ONLINE_CAR_PANEL, this );
|
||||
|
||||
mADASController = MarkerServiceHandler.getADASController();
|
||||
mLauncher = MarkerServiceHandler.getLauncher();
|
||||
@@ -484,7 +497,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
filter.addAction( MogoReceiver.ACTION_AUTO_NAVI_RECEIVER );
|
||||
filter.addAction( MogoReceiver.ACTION_AUTO_NAVI_SEND );
|
||||
filter.addAction( MogoReceiver.ACTION_MOGO );
|
||||
filter.addAction(MogoReceiver.ACTION_TXZ_BLOCK_SEARCH);
|
||||
filter.addAction( MogoReceiver.ACTION_TXZ_BLOCK_SEARCH );
|
||||
try {
|
||||
context.getApplicationContext().registerReceiver( mAIAssistReceiver, filter );
|
||||
Logger.i( TAG, "register voice receiver." );
|
||||
@@ -842,6 +855,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
@Override
|
||||
public void onIntentReceived( String command, Intent intent ) {
|
||||
|
||||
|
||||
if ( ServiceConst.COMMAND_NEXT.equals( command ) ) {
|
||||
onActionDone( MogoAction.Next );
|
||||
} else if ( ServiceConst.COMMAND_PREVIOUS.equals( command ) ) {
|
||||
@@ -925,4 +939,48 @@ public class MogoServices implements IMogoMapListener,
|
||||
AIAssist.getInstance( mContext ).registerUnWakeupCommand( ServiceConst.CMD_BACK, ServiceConst.CMD_BACK_WORDS, this );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
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( mContext ).build();
|
||||
query.put( "data", GsonUtil.jsonFromObject( data ) );
|
||||
mRefreshModel.getRefreshApiService().calculationNotHomeCompanyDistanceForPush( query )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< HomeCompanyDistanceForPushResponse >( RequestOptions.create( mContext ) ) {
|
||||
@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 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( String message, int code ) {
|
||||
super.onError( message, code );
|
||||
}
|
||||
} );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "onStartNavi" );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,6 @@ public class ServiceConst {
|
||||
public static final int MSG_REQUEST_DATA = 0x201;
|
||||
|
||||
/**
|
||||
*
|
||||
* 锁车消息
|
||||
*/
|
||||
public static final int MSG_LOCK_CAR = 0x202;
|
||||
@@ -159,7 +158,7 @@ public class ServiceConst {
|
||||
};
|
||||
|
||||
public static final String CMD_BACK = "back";
|
||||
public static final String[] CMD_BACK_WORDS = new String[]{"关闭", "返回"};
|
||||
public static final String[] CMD_BACK_WORDS = new String[]{"关闭", "返回"};
|
||||
|
||||
|
||||
/**
|
||||
@@ -203,4 +202,10 @@ public class ServiceConst {
|
||||
|
||||
public static final int ONLINE_SEARCH_LIMIT = 20;
|
||||
public static final int ONLINE_SEARCH_RADIUS = 2_000;
|
||||
|
||||
/**
|
||||
* 查找目的地车友
|
||||
*/
|
||||
public static final String COMMAND_ONLINE_CAR_PANEL = "com.zhidao.search.riders";
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public class IntentHandlerFactory {
|
||||
mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() );
|
||||
mHandlers.put( ServiceConst.COMMAND_BACK, WholeVoiceCommandIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_MOGO, new MogoControllerIntentHandler() );
|
||||
mHandlers.put( ServiceConst.COMMAND_ONLINE_CAR_PANEL, new OnlineCarPanelIntentHandler() );
|
||||
}
|
||||
|
||||
private static final class InstanceHolder {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.module.service.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class OnlineCarPanelIntentHandler implements IntentHandler {
|
||||
|
||||
@Override
|
||||
public void handle( Context context, Intent intent ) {
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isMainPageOnResume() ) {
|
||||
MarkerServiceHandler.getApis().getOnlineCarPanelApi().showPanel();
|
||||
} else {
|
||||
Intent start = new Intent( Intent.ACTION_VIEW );
|
||||
start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
|
||||
start.setData( Uri.parse( "mogo://launcher/main/switch2?type=showOnlineCarPanel" ) );
|
||||
context.startActivity( start );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ class LauncherCardRefresher {
|
||||
}
|
||||
|
||||
private void handleRefreshExplorerWayOrOnlineCarData( MogoLatLng latLng, LauncherCardRefreshType type ) {
|
||||
mRefreshModel.refreshDataSync( latLng,
|
||||
mRefreshModel.refreshLauncherCardDataSync( latLng,
|
||||
mRefreshStrategy.getRadius(),
|
||||
mRefreshStrategy.getLimit(),
|
||||
new RefreshCallback< MarkerResponse >() {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.service.network;
|
||||
import com.mogo.commons.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 java.util.Map;
|
||||
|
||||
@@ -37,4 +38,8 @@ public interface RefreshApiService {
|
||||
*/
|
||||
@GET( "/yycp-launcherSnapshot/mock/getMockUserInfos" )
|
||||
Observable< DemoUserInfoEntity > getMockUsers();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-travel-condition/trajectoryPrediction/calculationNotHomeCompanyDistanceForPush")
|
||||
Observable< HomeCompanyDistanceForPushResponse > calculationNotHomeCompanyDistanceForPush( @FieldMap Map< String, Object > parameters);
|
||||
}
|
||||
|
||||
@@ -65,51 +65,6 @@ public class RefreshModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshData( MogoLatLng latLng, int radius, int limit, final RefreshCallback callback ) {
|
||||
if ( mRefreshApiService != null ) {
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
|
||||
final RefreshBody refreshBody = new RefreshBody();
|
||||
refreshBody.limit = limit;
|
||||
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
|
||||
refreshBody.radius = radius;
|
||||
refreshBody.dataType.add( ServiceConst.CARD_TYPE_ROAD_CONDITION );
|
||||
|
||||
String data = GsonUtil.jsonFromObject( refreshBody );
|
||||
query.put( "data", data );
|
||||
Logger.d( TAG, data );
|
||||
|
||||
|
||||
mRefreshApiService.refreshData( query )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( mContext ) ) {
|
||||
@Override
|
||||
public void onSuccess( BaseData o ) {
|
||||
super.onSuccess( o );
|
||||
if ( callback != null ) {
|
||||
callback.onSuccess( o );
|
||||
}
|
||||
}
|
||||
|
||||
@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 );
|
||||
if ( callback != null ) {
|
||||
callback.onFail();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshExplorerWayData( MogoLatLng latLng, int radius, int limit, final RefreshCallback callback ) {
|
||||
if ( mRefreshApiService != null ) {
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
|
||||
@@ -155,7 +110,7 @@ public class RefreshModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshDataSync( MogoLatLng latLng, int radius, int limit, final RefreshCallback callback ) {
|
||||
public void refreshLauncherCardDataSync( MogoLatLng latLng, int radius, int limit, final RefreshCallback callback ) {
|
||||
if ( mRefreshApiService != null ) {
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
|
||||
final RefreshBody refreshBody = new RefreshBody();
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.module.service.network.bean;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/22
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class HomeCompanyDistanceForPushData {
|
||||
|
||||
public double lon;
|
||||
public double lat;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mogo.module.service.network.bean;
|
||||
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/22
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class HomeCompanyDistanceForPushResponse extends BaseData {
|
||||
|
||||
public HomeCompanyDistanceForPushResult result;
|
||||
|
||||
public static class HomeCompanyDistanceForPushResult {
|
||||
public boolean pushFlag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
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 renderOnlineCarList( List< MarkerOnlineCar > onlineCars );
|
||||
|
||||
void renderEmptyUi( OnlineCarStrategy strategy );
|
||||
|
||||
void renderNoNavigationInfoUi();
|
||||
|
||||
void renderErrorUi();
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
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.service.MogoServicePaths;
|
||||
import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
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 ( isFragmentExist( ContainerHandler.sAttachContext ) ) {
|
||||
return;
|
||||
}
|
||||
Fragment fragment = new OnlineCarPanelFragment();
|
||||
ContainerHandler.sAttachContext
|
||||
.getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace( ContainerHandler.sContainerId, fragment, TAG )
|
||||
.commitNowAllowingStateLoss();
|
||||
}
|
||||
|
||||
private boolean isFragmentExist( Context context ) {
|
||||
if ( !( context instanceof FragmentActivity ) ) {
|
||||
Logger.w( TAG, "context is not a instance of FragmentActivity" );
|
||||
return false;
|
||||
}
|
||||
Fragment fragment = null;
|
||||
return ( fragment = ( ( FragmentActivity ) context )
|
||||
.getSupportFragmentManager()
|
||||
.findFragmentByTag( TAG ) ) != null && fragment.isAdded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 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 ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
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.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
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.utils.ResourcesHelper;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class OnlineCarPanelAdapter extends RecyclerView.Adapter< OnlineCarPanelAdapter.VH > {
|
||||
|
||||
private List< MarkerOnlineCar > mDatums;
|
||||
|
||||
public OnlineCarPanelAdapter( List< MarkerOnlineCar > mDatums ) {
|
||||
this.mDatums = mDatums;
|
||||
}
|
||||
|
||||
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 ) );
|
||||
}
|
||||
|
||||
@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;
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
public void bind( MarkerOnlineCar car ) {
|
||||
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() );
|
||||
distance.setText( content );
|
||||
detail.setOnClickListener( view -> {
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "Mogoer_List_click", null );
|
||||
} );
|
||||
}
|
||||
|
||||
private String getDistanceStr( MarkerLocation location ) {
|
||||
MogoLocation mogoLocation = MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( itemView.getContext() ).getLastKnowLocation();
|
||||
if ( location == null ) {
|
||||
return "";
|
||||
}
|
||||
if ( mogoLocation == null ) {
|
||||
return "";
|
||||
}
|
||||
float distance = Utils.calculateLineDistance( location.getLon(), location.getLat(), mogoLocation.getLongitude(), mogoLocation.getLatitude() );
|
||||
if ( distance >= 1000 ) {
|
||||
return String.format( "%.1fKM", distance / 1000 );
|
||||
} else {
|
||||
return String.format( "%.1fM", distance );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.mogo.module.service.onlinecar.panel;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
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.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 RecyclerView mList;
|
||||
private View mRefreshPanel;
|
||||
private View mErrorPanel;
|
||||
|
||||
private OnlineCarPanelAdapter mOnlineCarPanelAdapter;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_services_fragment_online_car_panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
findViewById( R.id.module_services_id_close ).setOnClickListener( view -> {
|
||||
MarkerServiceHandler.getApis().getOnlineCarPanelApi().hidePanel();
|
||||
} );
|
||||
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 );
|
||||
|
||||
mList.setLayoutManager( new LinearLayoutManager( getContext(), LinearLayoutManager.VERTICAL, false ) );
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected OnlineCarPanelPresenter createPresenter() {
|
||||
return new OnlineCarPanelPresenter( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOnlineCarList( List< MarkerOnlineCar > onlineCars ) {
|
||||
mRefreshPanel.setVisibility( View.GONE );
|
||||
mErrorPanel.setVisibility( View.GONE );
|
||||
mList.setVisibility( View.VISIBLE );
|
||||
if ( mOnlineCarPanelAdapter == null ) {
|
||||
mOnlineCarPanelAdapter = new OnlineCarPanelAdapter( onlineCars );
|
||||
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 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderNoNavigationInfoUi() {
|
||||
mList.setVisibility( View.GONE );
|
||||
mRefreshPanel.setVisibility( View.GONE );
|
||||
mErrorPanel.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderErrorUi() {
|
||||
mList.setVisibility( View.GONE );
|
||||
mRefreshPanel.setVisibility( View.GONE );
|
||||
mErrorPanel.setVisibility( View.VISIBLE );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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.map.MogoLatLng;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.service.network.RefreshCallback;
|
||||
import com.mogo.module.service.network.RefreshModel;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class OnlineCarPanelPresenter extends Presenter< IOnlineCarPanelView > implements RefreshCallback< MarkerResponse > {
|
||||
|
||||
public static final int LIMIT = 20;
|
||||
private RefreshModel mRefreshModel;
|
||||
private OnlineCarStrategy mStrategy;
|
||||
private NavigationTargetInfo mNavigationTargetInfo;
|
||||
|
||||
public OnlineCarPanelPresenter( IOnlineCarPanelView view ) {
|
||||
super( view );
|
||||
mRefreshModel = new RefreshModel( getContext() );
|
||||
mStrategy = OnlineCarStrategy.Default;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
String json = SpStorage.getNavigationTarget();
|
||||
if ( TextUtils.isEmpty( json ) ) {
|
||||
mView.renderNoNavigationInfoUi();
|
||||
return;
|
||||
}
|
||||
mNavigationTargetInfo = GsonUtil.objectFromJson( json, NavigationTargetInfo.class );
|
||||
loadOnlineCar();
|
||||
}
|
||||
|
||||
public void loadOnlineCar() {
|
||||
if ( mNavigationTargetInfo == null ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
double toLat = Double.valueOf( mNavigationTargetInfo.getToPoiLatitude() );
|
||||
double toLon = Double.valueOf( mNavigationTargetInfo.getToPoiLongitude() );
|
||||
mRefreshModel.queryOnLineCarWithRoute( new MogoLatLng( toLat, toLon ),
|
||||
false,
|
||||
false,
|
||||
mStrategy.getRadius(),
|
||||
LIMIT,
|
||||
this
|
||||
);
|
||||
} catch ( Exception e ) {
|
||||
mView.renderNoNavigationInfoUi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess( MarkerResponse o ) {
|
||||
if ( o == null || o.getResult() == null ) {
|
||||
mView.renderErrorUi();
|
||||
} else {
|
||||
if ( o.getResult().getOnlineCar() == null || o.getResult().getOnlineCar().isEmpty() ) {
|
||||
mView.renderEmptyUi( mStrategy );
|
||||
} else {
|
||||
mView.renderOnlineCarList( o.getResult().getOnlineCar() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail() {
|
||||
mView.renderErrorUi();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
BIN
modules/mogo-module-service/src/main/res/drawable-ldpi/module_services_close.png
Executable file
|
After Width: | Height: | Size: 434 B |
|
After Width: | Height: | Size: 583 B |
|
After Width: | Height: | Size: 52 KiB |
BIN
modules/mogo-module-service/src/main/res/drawable-mdpi/module_services_close.png
Executable file
|
After Width: | Height: | Size: 434 B |
|
After Width: | Height: | Size: 583 B |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 144 KiB |
BIN
modules/mogo-module-service/src/main/res/drawable/module_services_close.png
Executable file
|
After Width: | Height: | Size: 434 B |
|
After Width: | Height: | Size: 583 B |
@@ -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="#1F2131"/>
|
||||
<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="#676982" android:startColor="#8384A9" />
|
||||
<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="#585E8B" android:startColor="#2E324B" />
|
||||
<corners android:radius="@dimen/module_services_panel_strategy_button_bkg_corner" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,114 @@
|
||||
<?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_close_margin_top"
|
||||
android:text="目的地车友"
|
||||
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_services_close" />
|
||||
|
||||
<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">
|
||||
|
||||
<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_marginTop="@dimen/module_services_empty_tip_marginTop"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/module_services_empty_tip_textColor"
|
||||
android:textSize="@dimen/module_services_empty_tip_textSize"
|
||||
android:textStyle="bold"
|
||||
tools:text="很抱歉,目的地10km内未找到车友" />
|
||||
|
||||
<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="加载失败,请点击重试"
|
||||
android:textColor="#FFFFFF" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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:padding="@dimen/module_services_panel_item_padding">
|
||||
|
||||
<com.mogo.module.common.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:textColor="@color/module_services_panel_item_nickname_textColor"
|
||||
android:textSize="@dimen/module_services_panel_item_nickname_textSize"
|
||||
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"
|
||||
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"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_services_id_panel_item_distance_tag"
|
||||
tools:text="980M" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_services_id_panel_item_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:background="@drawable/module_services_panel_item_detail_bkg"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/module_services_panel_item_detail_padding"
|
||||
android:text="@string/module_services_panel_item_detail_text"
|
||||
android:textColor="@color/module_services_panel_item_detail_textColor"
|
||||
android:textSize="@dimen/module_services_panel_item_detail_textSize"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -22,4 +22,35 @@
|
||||
<dimen name="module_service_content_minWidth">64px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight">6.5px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">10px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">8px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">16px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_text_size">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_recycler_view_margin_top">84px</dimen>
|
||||
<dimen name="module_services_load_strategy_textSize">18px</dimen>
|
||||
<dimen name="module_services_panel_item_avatar_size">58px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_textSize">14px</dimen>
|
||||
<dimen name="module_services_panel_item_distance_textSize">16px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_textSize">18px</dimen>
|
||||
<dimen name="module_services_id_panel_item_avatar_border_width">5px</dimen>
|
||||
<dimen name="module_services_panel_item_padding">20px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_marginLeft">13px</dimen>
|
||||
<dimen name="module_services_id_panel_item_distance_marginLeft">42px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_bkg_corner">8.89px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_padding">13px</dimen>
|
||||
<dimen name="module_services_panel_item_marginBottom">16px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_bkg_corner">25px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingTop">13px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingLeft">26px</dimen>
|
||||
<dimen name="module_services_load_strategy_marginRight">20px</dimen>
|
||||
<dimen name="module_services_empty_tip_textSize">18px</dimen>
|
||||
<dimen name="module_services_empty_tip_marginTop">17px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_marginTop">60px</dimen>
|
||||
<dimen name="module_services_panel_item_corner">12.5px</dimen>
|
||||
</resources>
|
||||
@@ -22,4 +22,35 @@
|
||||
<dimen name="module_service_content_minWidth">64px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight">6.5px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">10px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">8px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">16px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_text_size">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_recycler_view_margin_top">84px</dimen>
|
||||
<dimen name="module_services_load_strategy_textSize">18px</dimen>
|
||||
<dimen name="module_services_panel_item_avatar_size">58px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_textSize">14px</dimen>
|
||||
<dimen name="module_services_panel_item_distance_textSize">16px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_textSize">18px</dimen>
|
||||
<dimen name="module_services_id_panel_item_avatar_border_width">5px</dimen>
|
||||
<dimen name="module_services_panel_item_padding">20px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_marginLeft">13px</dimen>
|
||||
<dimen name="module_services_id_panel_item_distance_marginLeft">42px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_bkg_corner">8.89px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_padding">13px</dimen>
|
||||
<dimen name="module_services_panel_item_marginBottom">16px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_bkg_corner">25px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingTop">13px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingLeft">26px</dimen>
|
||||
<dimen name="module_services_load_strategy_marginRight">40px</dimen>
|
||||
<dimen name="module_services_empty_tip_textSize">18px</dimen>
|
||||
<dimen name="module_services_empty_tip_marginTop">28px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_marginTop">108px</dimen>
|
||||
<dimen name="module_services_panel_item_corner">12.5px</dimen>
|
||||
</resources>
|
||||
@@ -22,4 +22,35 @@
|
||||
<dimen name="module_service_tag_textSize">20px</dimen>
|
||||
<dimen name="module_service_content_minWidth">120px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">50px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">28px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">36px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">50px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_text_size">36px</dimen>
|
||||
<dimen name="module_services_online_car_panel_recycler_view_margin_top">151px</dimen>
|
||||
<dimen name="module_services_load_strategy_textSize">33px</dimen>
|
||||
<dimen name="module_services_panel_item_avatar_size">102px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_textSize">26px</dimen>
|
||||
<dimen name="module_services_panel_item_distance_textSize">30px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_textSize">34px</dimen>
|
||||
<dimen name="module_services_id_panel_item_avatar_border_width">9px</dimen>
|
||||
<dimen name="module_services_panel_item_padding">40px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_marginLeft">20px</dimen>
|
||||
<dimen name="module_services_id_panel_item_distance_marginLeft">70px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_bkg_corner">16px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_padding">21px</dimen>
|
||||
<dimen name="module_services_panel_item_marginBottom">28px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_bkg_corner">45px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingTop">22px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingLeft">42px</dimen>
|
||||
<dimen name="module_services_load_strategy_marginRight">40px</dimen>
|
||||
<dimen name="module_services_empty_tip_textSize">34px</dimen>
|
||||
<dimen name="module_services_empty_tip_marginTop">17px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_marginTop">108px</dimen>
|
||||
<dimen name="module_services_panel_item_corner">22.5px</dimen>
|
||||
</resources>
|
||||
@@ -22,4 +22,35 @@
|
||||
<dimen name="module_service_tag_textSize">20px</dimen>
|
||||
<dimen name="module_service_content_minWidth">120px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">50px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">28px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">36px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">50px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_text_size">36px</dimen>
|
||||
<dimen name="module_services_online_car_panel_recycler_view_margin_top">151px</dimen>
|
||||
<dimen name="module_services_load_strategy_textSize">33px</dimen>
|
||||
<dimen name="module_services_panel_item_avatar_size">102px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_textSize">26px</dimen>
|
||||
<dimen name="module_services_panel_item_distance_textSize">30px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_textSize">34px</dimen>
|
||||
<dimen name="module_services_id_panel_item_avatar_border_width">9px</dimen>
|
||||
<dimen name="module_services_panel_item_padding">40px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_marginLeft">20px</dimen>
|
||||
<dimen name="module_services_id_panel_item_distance_marginLeft">70px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_bkg_corner">16px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_padding">21px</dimen>
|
||||
<dimen name="module_services_panel_item_marginBottom">28px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_bkg_corner">45px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingTop">22px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingLeft">42px</dimen>
|
||||
<dimen name="module_services_load_strategy_marginRight">20px</dimen>
|
||||
<dimen name="module_services_empty_tip_textSize">34px</dimen>
|
||||
<dimen name="module_services_empty_tip_marginTop">28px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_marginTop">60px</dimen>
|
||||
<dimen name="module_services_panel_item_corner">22.5px</dimen>
|
||||
</resources>
|
||||
@@ -1,4 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_service_info_window_content_textColor">#ffffff</color>
|
||||
<color name="module_services_online_car_panel_title_textColor">#FFFFFFFF</color>
|
||||
<color name="module_services_load_strategy_textColor">#FFFFFF</color>
|
||||
<color name="module_services_panel_item_nickname_textColor">#FFFFFF</color>
|
||||
<color name="module_services_panel_item_distance_textColor">#7FFFFFFF</color>
|
||||
<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>
|
||||
</resources>
|
||||
@@ -22,4 +22,35 @@
|
||||
<dimen name="module_service_tag_textSize">20px</dimen>
|
||||
<dimen name="module_service_content_minWidth">120px</dimen>
|
||||
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>
|
||||
<dimen name="module_services_online_car_panel_marginRight">8px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingLeft">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_paddingBottom">16px</dimen>
|
||||
|
||||
<dimen name="module_services_online_car_panel_close_margin_top">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_margin_top">28px</dimen>
|
||||
<dimen name="module_services_online_car_panel_title_text_size">20px</dimen>
|
||||
<dimen name="module_services_online_car_panel_recycler_view_margin_top">84px</dimen>
|
||||
<dimen name="module_services_load_strategy_textSize">18px</dimen>
|
||||
<dimen name="module_services_panel_item_avatar_size">58px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_textSize">14px</dimen>
|
||||
<dimen name="module_services_panel_item_distance_textSize">16px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_textSize">18px</dimen>
|
||||
<dimen name="module_services_id_panel_item_avatar_border_width">5px</dimen>
|
||||
<dimen name="module_services_panel_item_padding">20px</dimen>
|
||||
<dimen name="module_services_panel_item_nickname_marginLeft">13px</dimen>
|
||||
<dimen name="module_services_id_panel_item_distance_marginLeft">42px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_bkg_corner">8.89px</dimen>
|
||||
<dimen name="module_services_panel_item_detail_padding">13px</dimen>
|
||||
<dimen name="module_services_panel_item_marginBottom">16px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_bkg_corner">25px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingTop">13px</dimen>
|
||||
<dimen name="module_services_load_strategy_paddingLeft">26px</dimen>
|
||||
<dimen name="module_services_load_strategy_marginRight">20px</dimen>
|
||||
<dimen name="module_services_empty_tip_textSize">18px</dimen>
|
||||
<dimen name="module_services_empty_tip_marginTop">17px</dimen>
|
||||
<dimen name="module_services_panel_strategy_button_marginTop">60px</dimen>
|
||||
<dimen name="module_services_panel_item_corner">12.5px</dimen>
|
||||
</resources>
|
||||
@@ -4,4 +4,8 @@
|
||||
<string name="module_service_launcher_card_tips">你的周围有%d个%s,请点击查看,你也可以对我说打开蘑菇出行</string>
|
||||
<string name="module_service_launcher_card_info">周围有%d个%s</string>
|
||||
<string name="module_service_open_app_tip">建议开启蘑菇出行,守护你的每一段行程,你可以直接对我说,打开蘑菇出行</string>
|
||||
<string name="module_services_str_20Km_radius">扩大到20KM半径</string>
|
||||
<string name="module_services_str_40Km_radius">扩大到40KM半径</string>
|
||||
<string name="module_services_panel_item_distance_tag_text">距离导航目的地</string>
|
||||
<string name="module_services_panel_item_detail_text">查看车友信息</string>
|
||||
</resources>
|
||||
|
||||