Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
This commit is contained in:
@@ -73,6 +73,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.modulepush,{
|
||||
exclude group:'com.mogo.module',module:'module-common'
|
||||
}
|
||||
implementation rootProject.ext.dependencies.moduleadcard
|
||||
|
||||
implementation rootProject.ext.dependencies.moduleonlinecar
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.multidex.MultiDex;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.adcard.AdCardConstants;
|
||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
@@ -30,24 +31,26 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
super.onCreate();
|
||||
// MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) );
|
||||
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
|
||||
DebugConfig.setNetMode( BuildConfig.NET_ENV );
|
||||
MogoModulePaths.addModule( new MogoModule( OnLineCarConstants.TAG, OnLineCarConstants.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
||||
DebugConfig.setNetMode(BuildConfig.NET_ENV);
|
||||
//运营位卡片,需要默认显示,放在第一个加载
|
||||
MogoModulePaths.addModule(new MogoModule(AdCardConstants.TAG, AdCardConstants.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, OnLineCarConstants.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
|
||||
MogoModulePaths.addModule( new MogoModule( PushUIConstants.TAG, PushUIConstants.TAG ) );
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
IMogoSocketManager mMogoSocketManager = ( IMogoSocketManager ) ARouter.getInstance().build( MogoServicePaths.PATH_SOCKET_MANAGER ).navigation();
|
||||
mMogoSocketManager.init( getApplicationContext(), BuildConfig.APPLICATION_ID );
|
||||
IMogoSocketManager mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation();
|
||||
mMogoSocketManager.init(getApplicationContext(), BuildConfig.APPLICATION_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext( Context base ) {
|
||||
super.attachBaseContext( base );
|
||||
MultiDex.install( base );
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(base);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ ext {
|
||||
modulemedia : "com.mogo.module:module-media:${MOGO_MODULE_MEDIA_VERSION}",
|
||||
modulesearch : "com.mogo.module:module-search:${MOGO_MODULE_SEARCH_VERSION}",
|
||||
modulepush : "com.mogo.module:module-push:${MOGO_MODULE_PUSH_VERSION}",
|
||||
//运营位卡片
|
||||
moduleadcard : "com.mogo.module:module-adcard:${MOGO_MODULE_AD_CARD_VERSION}",
|
||||
// 长链
|
||||
socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.0',
|
||||
socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23',
|
||||
@@ -112,6 +114,6 @@ ext {
|
||||
jetbrainsannotationsjava5: "org.jetbrains:annotations-java5:15.0",
|
||||
|
||||
// 统一登录
|
||||
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.4",
|
||||
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.5",
|
||||
]
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
/**
|
||||
* 使用Glide加载图片时,使该图片进行高斯模糊
|
||||
* 基本用法:Glide.with(this).load(userInfo.headImgurl).apply(RequestOptions.bitmapTransform(GlideBlurTransformation(this))).into(ivCardBg)
|
||||
*
|
||||
* 如果想用多个Transform可以使用{@link com.bumptech.glide.load.MultiTransformation} 进行Transform的融合
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class GlideBlurTransformation extends CenterCrop {
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.mogo.utils.glide;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.mogo.utils.BuildConfig;
|
||||
import com.mogo.utils.R;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* Glide加载图片,使图片变成圆角图片工具
|
||||
* 基本用法Glide.with(this).load(imgUrl).apply(RequestOptions.bitmapTransform(GlideRoundedCornersTransform(this))).into(imageView)
|
||||
* 如果想用多个Transform可以使用{@link com.bumptech.glide.load.MultiTransformation} 进行Transform的融合
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class GlideRoundedCornersTransform extends CenterCrop {
|
||||
private float mRadius;
|
||||
private CornerType mCornerType;
|
||||
private static final int VERSION = 1;
|
||||
private static final String ID = BuildConfig.LIBRARY_PACKAGE_NAME + "GlideRoundedCornersTransform." + VERSION;
|
||||
private static final byte[] ID_BYTES = ID.getBytes(CHARSET);
|
||||
|
||||
/**
|
||||
* 待处理的圆角枚举
|
||||
*/
|
||||
public enum CornerType {
|
||||
ALL,
|
||||
TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT,
|
||||
TOP, BOTTOM, LEFT, RIGHT,
|
||||
TOP_LEFT_BOTTOM_RIGHT,
|
||||
TOP_RIGHT_BOTTOM_LEFT,
|
||||
TOP_LEFT_TOP_RIGHT_BOTTOM_RIGHT,
|
||||
TOP_RIGHT_BOTTOM_RIGHT_BOTTOM_LEFT,
|
||||
TOP_LEFT_TOP_RIGHT
|
||||
}
|
||||
|
||||
public GlideRoundedCornersTransform(float radius, CornerType cornerType) {
|
||||
super();
|
||||
mRadius = radius;
|
||||
mCornerType = cornerType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Bitmap transform(@NonNull BitmapPool pool,@NonNull Bitmap toTransform, int outWidth, int outHeight) {
|
||||
Bitmap transform = super.transform(pool, toTransform, outWidth, outHeight);
|
||||
return roundCrop(pool, transform);
|
||||
}
|
||||
|
||||
private Bitmap roundCrop(BitmapPool pool, Bitmap source) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
int width = source.getWidth();
|
||||
int height = source.getHeight();
|
||||
Bitmap result = pool.get(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
|
||||
if (result == null) {
|
||||
result = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Bitmap.Config
|
||||
.ARGB_8888);
|
||||
}
|
||||
Canvas canvas = new Canvas(result);
|
||||
Paint paint = new Paint();
|
||||
paint.setShader(new BitmapShader(source, BitmapShader.TileMode.CLAMP, BitmapShader
|
||||
.TileMode.CLAMP));
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
Path path = new Path();
|
||||
drawRoundRect(canvas, paint, path, width, height);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void drawRoundRect(Canvas canvas, Paint paint, Path path, int width, int height) {
|
||||
float[] rids;
|
||||
switch (mCornerType) {
|
||||
case ALL:
|
||||
rids = new float[]{mRadius, mRadius, mRadius, mRadius, mRadius, mRadius, mRadius, mRadius};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP_LEFT:
|
||||
rids = new float[]{mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP_RIGHT:
|
||||
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case BOTTOM_RIGHT:
|
||||
rids = new float[]{0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case BOTTOM_LEFT:
|
||||
rids = new float[]{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP:
|
||||
rids = new float[]{mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case BOTTOM:
|
||||
rids = new float[]{0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius, mRadius, mRadius};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case LEFT:
|
||||
rids = new float[]{mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case RIGHT:
|
||||
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP_LEFT_BOTTOM_RIGHT:
|
||||
rids = new float[]{mRadius, mRadius, 0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP_RIGHT_BOTTOM_LEFT:
|
||||
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f, mRadius, mRadius};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP_LEFT_TOP_RIGHT_BOTTOM_RIGHT:
|
||||
rids = new float[]{mRadius, mRadius, mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP_RIGHT_BOTTOM_RIGHT_BOTTOM_LEFT:
|
||||
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, mRadius, mRadius, mRadius, mRadius};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
case TOP_LEFT_TOP_RIGHT:
|
||||
rids = new float[]{mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f};
|
||||
drawPath(rids, canvas, paint, path, width, height);
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("RoundedCorners type not belong to CornerType");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rids 圆角的半径,依次为左上角xy半径,右上角,右下角,左下角
|
||||
*/
|
||||
private void drawPath(float[] rids, Canvas canvas, Paint paint, Path path, int width, int height) {
|
||||
path.addRoundRect(new RectF(0, 0, width, height), rids, Path.Direction.CW);
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof GlideRoundedCornersTransform;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ID.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDiskCacheKey(MessageDigest messageDigest) {
|
||||
messageDigest.update(ID_BYTES);
|
||||
}
|
||||
}
|
||||
@@ -51,5 +51,6 @@ MOGO_MODULE_ONLINECAR_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_MEDIA_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_PUSH_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_SEARCH_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.0-SNAPSHOT
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.amap.api.services.core.LatLonPoint;
|
||||
import com.amap.api.services.route.DriveRouteResult;
|
||||
import com.amap.api.services.route.RouteSearch;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.impl.amap.AMapWrapper;
|
||||
import com.mogo.map.impl.amap.InterceptorHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -74,7 +75,7 @@ public class RouteOverlayHelper {
|
||||
Logger.e( TAG, "算路失败. code = %d", i );
|
||||
return;
|
||||
}
|
||||
mDrivingRouteOverlay = new DrivingRouteOverlay( context, null,
|
||||
mDrivingRouteOverlay = new DrivingRouteOverlay( context, AMapWrapper.getAMap(),
|
||||
driveRouteResult.getPaths().get( 0 ),
|
||||
driveRouteResult.getStartPos(),
|
||||
driveRouteResult.getTargetPos(),
|
||||
|
||||
@@ -58,8 +58,8 @@ import java.util.List;
|
||||
* 数据刷新策略
|
||||
* <p>
|
||||
* 1. 位置移动触发刷新
|
||||
* 2. 用户手势交互导致地图视图移动跨过当前视图
|
||||
* 3. 用户手势缩小比例尺级别达2级
|
||||
* 2. 用户手势交互导致地图视图移动跨过当前视图,延时 1 分钟,不累加
|
||||
* 3. 用户手势缩小比例尺级别达2级,延时 1 分钟,不累加
|
||||
* 4. 用户交互语音导致地图视图移动,缩放,不触发刷新
|
||||
*/
|
||||
@Route( path = ServiceConst.PATH_REFRESH_STRATEGY )
|
||||
@@ -146,6 +146,7 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
private RefreshCallback mCustomRefreshCallback = new RefreshCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
mRefreshRemainingTimeStatus = false;
|
||||
// 用户手动操作地图刷新成功后,设置状态为 true,引发延时策略
|
||||
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, true );
|
||||
}
|
||||
@@ -180,6 +181,9 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
}
|
||||
};
|
||||
|
||||
// 延时状态
|
||||
private boolean mRefreshRemainingTimeStatus = false;
|
||||
|
||||
@Override
|
||||
public final Fragment createFragment( Context context, Bundle data ) {
|
||||
return null;
|
||||
@@ -386,6 +390,7 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
public void onMapChanged( MogoLatLng latLng, float zoom, float tilt, float bearing ) {
|
||||
|
||||
if ( mIsCameraInited ) {
|
||||
mLastZoomLevel = zoom;
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
mIsCameraInited = false;
|
||||
return;
|
||||
@@ -395,6 +400,12 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
refreshCameraPosition();
|
||||
}
|
||||
|
||||
// 部分非用户操作导致地图视图变化:绘线、圈点等不触发用户刷新
|
||||
// 消费状态
|
||||
if ( mStatusManager.isUserInteracted() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 手动刷新触发
|
||||
if ( mLastZoomLevel - zoom > mCustomRefreshStrategy.getZoomOutLevel() ) {
|
||||
// 缩放级别缩小
|
||||
@@ -403,7 +414,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
mLastZoomLevel = zoom;
|
||||
} else if ( mLastZoomLevel - zoom < 0 ) {
|
||||
mLastZoomLevel = zoom;
|
||||
|
||||
} else if ( mLastZoomLevel == zoom ) {
|
||||
// 手动平移
|
||||
if ( invokeRefreshWhenTranslationByUser( latLng ) ) {
|
||||
@@ -450,16 +460,18 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
return;
|
||||
}
|
||||
// 自动刷新触发
|
||||
final MogoLatLng point = new MogoLatLng( location.getLatitude(), location.getLongitude() );
|
||||
if ( mLastAutoRefreshLocation == null ) {
|
||||
mLastAutoRefreshLocation = new MogoLatLng( location.getLatitude(), location.getLongitude() );
|
||||
mLastAutoRefreshLocation = point;
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
return;
|
||||
}
|
||||
mLastAutoRefreshLocation = point;
|
||||
float distance = Utils.calculateLineDistance( mLastAutoRefreshLocation, new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
|
||||
if ( distance > mAutoRefreshStrategy.getDistance() ) {
|
||||
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, true );
|
||||
mUiController.moveToCenter( mLastAutoRefreshLocation );
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
} else {
|
||||
float distance = Utils.calculateLineDistance( mLastAutoRefreshLocation, new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
|
||||
if ( distance > mAutoRefreshStrategy.getDistance() ) {
|
||||
// 触发自动刷新之前,将未消费的用户状态清除
|
||||
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, false, false );
|
||||
notifyRefreshData( mLastAutoRefreshLocation, getQueryRadius(), mAutoRefreshCallback );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,9 +482,6 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
if ( mStatusManager.isUserInteracted() ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, mAutoRefreshCallback == callback ? "触发自动刷新" : "触发手动刷新" );
|
||||
int amount = mLastZoomLevel >= 10 ? 5 : 10;
|
||||
mRefreshModel.refreshData( latLng, radius, mLastZoomLevel >= 10 ? 5 : 10, callback );
|
||||
@@ -505,7 +514,8 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
switch ( descriptor ) {
|
||||
case USER_INTERACTED:
|
||||
if ( isTrue ) {
|
||||
if ( isTrue && !mRefreshRemainingTimeStatus ) {
|
||||
mRefreshRemainingTimeStatus = true;
|
||||
mRefreshRemainingTime += mAutoRefreshStrategy.getInterruptInterval();
|
||||
Logger.i( TAG, "用户状态改变,自动刷新时间延时,%s ms后自动刷新", mRefreshRemainingTime );
|
||||
}
|
||||
|
||||
@@ -463,7 +463,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
public void onCmdSelected(String cmd) {
|
||||
Logger.d(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd);
|
||||
if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok
|
||||
//TODO
|
||||
FullMediaActivity.Companion.launch(getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime);
|
||||
}
|
||||
}
|
||||
@@ -709,17 +708,11 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
refreshVideoData(markerExploreWay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
mEmptyLayout.setVisibility(View.VISIBLE);
|
||||
mRootLayout.setVisibility(View.GONE);
|
||||
mEmptyTv.setText(Html.fromHtml(getContext().getString(R.string.main_empty_content)));
|
||||
}
|
||||
|
||||
//TODO liyz
|
||||
getRoadLineData();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -868,17 +861,21 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
|
||||
/**
|
||||
* push 类型,1为导航数据,2为通勤族 TODO
|
||||
* push 类型,1为导航数据,2为通勤族
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onPushInfo(final PushTypeInfo event) {
|
||||
Logger.d(TAG, " onPushInfo event.type =" + event.type);
|
||||
if (event.type.equals("1")) {
|
||||
getNaviRoadLineInfo();
|
||||
} else if (event.type.equals("2")) {
|
||||
getRoadLineData();
|
||||
if (event != null && TextUtils.isEmpty(event.type)) {
|
||||
Logger.d(TAG, " onPushInfo event.type =" + event.type);
|
||||
if (event.type.equals("1")) {
|
||||
getNaviRoadLineInfo();
|
||||
} else if (event.type.equals("2")) {
|
||||
getRoadLineData();
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "event == null ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -913,16 +910,17 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
@Override
|
||||
public void onSuccess(PathLineResult o) {
|
||||
//绘制线路线
|
||||
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
|
||||
drawMapLine(o.getPointList());
|
||||
if (o != null && o.getResult() != null && o.getResult().getPointList() != null
|
||||
&& o.getResult().getPointList().size() > 0) {
|
||||
drawMapLine(o.getResult().getPointList());
|
||||
} else {
|
||||
Logger.e(TAG, "getRoadLineData onSuccess o.getPointList() == null");
|
||||
Log.e(TAG, "getRoadLineData onSuccess o.getPointList() == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String message, int code) {
|
||||
Logger.d(TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code);
|
||||
Log.e(TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -935,16 +933,17 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
@Override
|
||||
public void onSuccess(PathLineResult o) {
|
||||
//绘制线路线
|
||||
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
|
||||
drawMapLine(o.getPointList());
|
||||
if (o != null && o.getResult() != null && o.getResult().getPointList() != null
|
||||
&& o.getResult().getPointList().size() > 0) {
|
||||
drawMapLine(o.getResult().getPointList());
|
||||
} else {
|
||||
Logger.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null");
|
||||
Log.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String message, int code) {
|
||||
Logger.d(TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code);
|
||||
Log.e(TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -953,8 +952,11 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
* 绘制线路
|
||||
*/
|
||||
private void drawMapLine(List<Center> pointList) {
|
||||
//避免人为操作,刷新
|
||||
mMogoStatusManager.setUserInteractionStatus(TanluConstants.MODEL_NAME, true, true);
|
||||
|
||||
int intervalNum = Utils.getIntervalValue(pointList.size());
|
||||
Logger.d(TAG, "drawMapLine intervalNum = $intervalNum -- pointList.size = ${pointList.size}");
|
||||
Logger.d(TAG, "drawMapLine intervalNum = " + intervalNum + ">>> pointList.size =" + pointList.size());
|
||||
int listSize = pointList.size();
|
||||
passedByPoints = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -9,22 +9,35 @@ import java.util.List;
|
||||
* @since 2020-01-08
|
||||
*/
|
||||
public class PathLineResult extends BaseData {
|
||||
private List<Information> informations;
|
||||
private List<Center> pointList;
|
||||
|
||||
public List<Information> getInformations() {
|
||||
return informations;
|
||||
private PathResult result;
|
||||
|
||||
public PathResult getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setInformations(List<Information> informations) {
|
||||
this.informations = informations;
|
||||
public void setResult(PathResult result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public List<Center> getPointList() {
|
||||
return pointList;
|
||||
}
|
||||
public static class PathResult {
|
||||
private List<Information> informations;
|
||||
private List<Center> pointList;
|
||||
|
||||
public void setPointList(List<Center> pointList) {
|
||||
this.pointList = pointList;
|
||||
public List<Information> getInformations() {
|
||||
return informations;
|
||||
}
|
||||
|
||||
public void setInformations(List<Information> informations) {
|
||||
this.informations = informations;
|
||||
}
|
||||
|
||||
public List<Center> getPointList() {
|
||||
return pointList;
|
||||
}
|
||||
|
||||
public void setPointList(List<Center> pointList) {
|
||||
this.pointList = pointList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ public class TanluModelData {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
e.printStackTrace();
|
||||
Logger.d(TAG, "getRoadLineData onError ------> e= " + e.getMessage());
|
||||
}
|
||||
});
|
||||
@@ -165,6 +166,7 @@ public class TanluModelData {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
e.printStackTrace();
|
||||
Logger.d(TAG, "getNaviRoadLineInfo onError ------> e= " + e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.tanlu.receiver
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.util.Log
|
||||
import com.mogo.module.tanlu.model.event.PushTypeInfo
|
||||
import com.mogo.module.tanlu.model.event.VoiceRoadInfo
|
||||
@@ -14,9 +15,9 @@ import org.greenrobot.eventbus.EventBus
|
||||
class PushReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == "com.zhidao.roadcondition.split"){
|
||||
var type = intent.getStringExtra("type")
|
||||
Log.d("PushReceiver", "type = $type")
|
||||
EventBus.getDefault().post(PushTypeInfo(type))
|
||||
var uri = Uri.parse(intent.getStringExtra("uri"))
|
||||
Log.d("PushReceiver", "uri = $uri")
|
||||
EventBus.getDefault().post(PushTypeInfo(uri.getQueryParameter("type")))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user