Merge remote-tracking branch 'origin/feature/v1.0.2' into feature/v1.0.2
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -39,13 +39,11 @@ android {
|
||||
debug {
|
||||
signingConfig signingConfigs.release
|
||||
debuggable = true
|
||||
buildConfigField 'int', 'NET_ENV', '2'
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
buildConfigField 'int', 'NET_ENV', '2'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@@ -53,11 +51,12 @@ android {
|
||||
targetCompatibility 1.8
|
||||
}
|
||||
|
||||
flavorDimensions "default"
|
||||
flavorDimensions "product", "env"
|
||||
|
||||
productFlavors {
|
||||
//诺威达
|
||||
nwd {
|
||||
dimension "product"
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'src/nwd/AndroidManifest.xml'
|
||||
@@ -65,12 +64,21 @@ android {
|
||||
}
|
||||
}
|
||||
zhidao {
|
||||
dimension "product"
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'src/main/AndroidManifest.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
qa {
|
||||
dimension "env"
|
||||
buildConfigField 'int', 'NET_ENV', '2'
|
||||
}
|
||||
online {
|
||||
dimension "env"
|
||||
buildConfigField 'int', 'NET_ENV', '3'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,4 @@ MOGO_MODULE_PUSH_VERSION=1.0.0-SNAPSHOT
|
||||
# 广告资源位
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.0-SNAPSHOT
|
||||
# 新鲜水
|
||||
MOGO_MODULE_FRESH_NEWS_VERSION=1.0.2-SNAPSHOT
|
||||
|
||||
# 卡片效果
|
||||
CARD_LIBRARY_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_FRESH_NEWS_VERSION=1.0.2-SNAPSHOT
|
||||
@@ -3,6 +3,7 @@ package com.mogo.map.impl.amap.hook;
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.autonavi.base.amap.api.mapcore.IAMapDelegate;
|
||||
import com.autonavi.base.amap.mapcore.interfaces.IAMapListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
@@ -43,6 +44,9 @@ public class BnHooker implements InvocationHandler {
|
||||
if ( method.getName().equals( "setRenderFps" ) ) {
|
||||
return method.invoke( host, 10 );
|
||||
}
|
||||
if ( method.getName().equals( "drawFrame" ) ) {
|
||||
Logger.d(TAG, "drawFrame");
|
||||
}
|
||||
return method.invoke( host, args );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,9 +164,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setMarkerOptions( options );
|
||||
if ( mMarker.getObject() instanceof IMogoMarker ) {
|
||||
( ( IMogoMarker ) mMarker.getObject() ).setObject( opt.getObject() );
|
||||
}
|
||||
setObject( opt.getObject() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -726,6 +726,9 @@ public class ObjectUtils {
|
||||
target.geodesic( options.isGeodesic() );
|
||||
target.setDottedLine( options.isDottedLine() );
|
||||
target.useGradient( options.isGradient() );
|
||||
if ( options.getColorValues() != null ) {
|
||||
target.colorValues( options.getColorValues() );
|
||||
}
|
||||
target.transparency( options.getTransparency() );
|
||||
target.aboveMaskLayer( options.isAboveMaskLayer() );
|
||||
target.lineCapType( PolylineOptions.LineCapType.LineCapRound );
|
||||
|
||||
@@ -30,6 +30,7 @@ public class MogoPolylineOptions {
|
||||
private float mTransparency = 1.0F;
|
||||
private boolean mIsAboveMaskLayer = false;
|
||||
private boolean mIsPointsUpdated = false;
|
||||
private List< Integer > mColorValues;
|
||||
|
||||
public MogoPolylineOptions() {
|
||||
this.mPoints = new ArrayList<>();
|
||||
@@ -168,6 +169,15 @@ public class MogoPolylineOptions {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param colors
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions colorValues( List< Integer > colors ) {
|
||||
mColorValues = colors;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List< MogoLatLng > getPoints() {
|
||||
return mPoints;
|
||||
}
|
||||
@@ -211,4 +221,8 @@ public class MogoPolylineOptions {
|
||||
public boolean isPointsUpdated() {
|
||||
return mIsPointsUpdated;
|
||||
}
|
||||
|
||||
public List< Integer > getColorValues() {
|
||||
return mColorValues;
|
||||
}
|
||||
}
|
||||
|
||||
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_apps.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_chat.png
Executable file → Normal file
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_chat_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_interest.png
Executable file → Normal file
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_interest_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_media_center_checked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_news.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_news_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_online_car.png
Executable file → Normal file
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_online_car_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_tanlu.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
0
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_tanlu_unchecked.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -2,6 +2,9 @@ package com.mogo.module.common.entity;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -27,6 +30,7 @@ public class MarkerShowEntity {
|
||||
private Object bindObj;
|
||||
//Marker 经纬度位置信息
|
||||
private MarkerLocation markerLocation;
|
||||
private IMogoMarker mMarker;
|
||||
|
||||
public boolean isChecked() {
|
||||
return isChecked;
|
||||
@@ -99,6 +103,14 @@ public class MarkerShowEntity {
|
||||
Objects.equals(markerLocation, that.markerLocation);
|
||||
}
|
||||
|
||||
public void setMarker( IMogoMarker marker ) {
|
||||
this.mMarker = marker;
|
||||
}
|
||||
|
||||
public IMogoMarker getMarker() {
|
||||
return mMarker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(iconUrl, textContent, markerType, bindObj, markerLocation);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ExtensionsModuleConst {
|
||||
public static final String[] CMD_UPLOAD_BLOCK = {"上报拥堵"};
|
||||
public static final String[] CMD_TRAFFIC_CHECK = {"上报交通检查"};
|
||||
public static final String[] CMD_ROAD_CLOSURE = {"上报封路"};
|
||||
public static final String[] CMD_SHARE_OIL_PRICE = {"分享油价"};
|
||||
// public static final String[] CMD_SHARE_OIL_PRICE = {"分享油价"};
|
||||
|
||||
//上报拥堵
|
||||
public static final String UPLOAD_ROAD_BLOCK = "command_upload_block";
|
||||
@@ -48,7 +48,7 @@ public class ExtensionsModuleConst {
|
||||
//上报封路
|
||||
public static final String UPLOAD_ROAD_CLOSURE = "command_upload_road_closure";
|
||||
//分享油价
|
||||
public static final String SHARE_OIL_PRICE = "command_share_oil_price";
|
||||
// public static final String SHARE_OIL_PRICE = "command_share_oil_price";
|
||||
/*** 探路 结束 **/
|
||||
|
||||
//埋点
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -30,6 +29,7 @@ import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.dialog.NaviNoticeDialog;
|
||||
import com.mogo.module.extensions.navi.NaviInfoView;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor;
|
||||
@@ -40,7 +40,6 @@ import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -74,6 +73,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private TextView mSpeedLimitValue;
|
||||
private View mSpeedLimitUnit;
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
private IMogoMapService mService;
|
||||
private IMogoMapUIController mMApUIController;
|
||||
private IMogoLocationClient mMogoLocationClient;
|
||||
@@ -100,12 +100,11 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mMogoFragmentManager = ( IMogoFragmentManager ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_FRAGMENT_MANAGER )
|
||||
.navigation();
|
||||
mMogoAddressManager = ( IMogoAddressManager ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_ADDRESS_MANAGER )
|
||||
.navigation();
|
||||
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
|
||||
|
||||
mMogoFragmentManager = mApis.getFragmentManagerApi();
|
||||
mMogoAddressManager = mApis.getAddressManagerApi();
|
||||
|
||||
mCommonAddress = findViewById( R.id.module_entrance_id_common_address );
|
||||
|
||||
@@ -197,21 +196,13 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
mService = ( IMogoMapService ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_SERVICES_MAP )
|
||||
.navigation( getContext() );
|
||||
mMogoRegisterCenter = ( IMogoRegisterCenter ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_REGISTER_CENTER )
|
||||
.navigation( getContext() );
|
||||
mService = mApis.getMapServiceApi();
|
||||
mMogoRegisterCenter = mApis.getRegisterCenterApi();
|
||||
mMApUIController = mService.getMapUIController();
|
||||
mMogoLocationClient = mService.getSingletonLocationClient( getContext() );
|
||||
mMogoNavi = mService.getNavi( getContext() );
|
||||
mAnalytics = ( IMogoAnalytics ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_UTILS_ANALYTICS )
|
||||
.navigation( getContext() );
|
||||
mMogoStatusManager = ( IMogoStatusManager ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_STATUS_MANAGER )
|
||||
.navigation( getContext() );
|
||||
mAnalytics = mApis.getAnalyticsApi();
|
||||
mMogoStatusManager = mApis.getStatusManagerApi();
|
||||
|
||||
mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
|
||||
@@ -48,8 +48,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
ExtensionsModuleConst.CMD_TRAFFIC_CHECK, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE,
|
||||
ExtensionsModuleConst.CMD_ROAD_CLOSURE, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.SHARE_OIL_PRICE,
|
||||
ExtensionsModuleConst.CMD_SHARE_OIL_PRICE, mogoVoiceListener);
|
||||
// AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.SHARE_OIL_PRICE,
|
||||
// ExtensionsModuleConst.CMD_SHARE_OIL_PRICE, mogoVoiceListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,8 +67,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
uploadTrfficCheck();
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE)) { //上报封路
|
||||
uploadRoadClosed();
|
||||
} else if (cmd.equals(ExtensionsModuleConst.SHARE_OIL_PRICE)) { //分享油价
|
||||
shareOilPrice();
|
||||
// } else if (cmd.equals(ExtensionsModuleConst.SHARE_OIL_PRICE)) { //分享油价
|
||||
// shareOilPrice();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +314,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
switch2Card( marker.getOwner(), false );
|
||||
if ( mMogoModuleHandler != null ) {
|
||||
mMogoModuleHandler.onMarkerClicked( marker );
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class MainPresenter extends Presenter< MainView > {
|
||||
if ( TextUtils.isEmpty( cardInfo.mCardName ) ) {
|
||||
return;
|
||||
}
|
||||
mView.switch2Card( cardInfo.mCardName, true );
|
||||
mView.switch2Card( cardInfo.mCardName, cardInfo.mLockCar );
|
||||
} );
|
||||
mAnalytics = ( IMogoAnalytics ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_ANALYTICS ).navigation( getContext() );
|
||||
mCardStartShowTime = System.currentTimeMillis();
|
||||
|
||||
0
modules/mogo-module-main/src/main/res/drawable-ldpi/module_apps_bg_card.png
Executable file → Normal file
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@@ -17,6 +17,7 @@ import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
|
||||
@@ -36,15 +37,14 @@ public class MarkerServiceHandler {
|
||||
private static IMogoMarkerManager mMarkerManager;
|
||||
private static IMogoNavi mNavi;
|
||||
private static IMogoMapUIController mMapUIController;
|
||||
|
||||
private static IMogoLocationClient mLocationClient;
|
||||
|
||||
private static IMogoStatusManager mMogoStatusManager;
|
||||
private static IMogoImageloader mImageloader;
|
||||
private static IMogoSocketManager mMogoSocketManager;
|
||||
private static IMogoCardManager mMogoCardManager;
|
||||
private static IMogoAnalytics mMogoAnalytics;
|
||||
private static IMogoRegisterCenter mRegisterCenter;
|
||||
private static IMogoActionManager mActionManager;
|
||||
|
||||
private static MapMarkerManager mMapMarkerManager;
|
||||
|
||||
@@ -56,12 +56,12 @@ public class MarkerServiceHandler {
|
||||
mMogoSocketManager = mApis.getSocketManagerApi( context );
|
||||
mMogoCardManager = mApis.getCardManagerApi();
|
||||
mMogoAnalytics = mApis.getAnalyticsApi();
|
||||
|
||||
mMarkerManager = mMapService.getMarkerManager( context );
|
||||
mNavi = mMapService.getNavi( context );
|
||||
mMapUIController = mMapService.getMapUIController();
|
||||
mLocationClient = mMapService.getSingletonLocationClient( context );
|
||||
mRegisterCenter = mApis.getRegisterCenterApi();
|
||||
mActionManager = mApis.getActionManagerApi();
|
||||
|
||||
mMapMarkerManager = MapMarkerManager.getInstance();
|
||||
mMapMarkerManager.init( context );
|
||||
@@ -115,6 +115,10 @@ public class MarkerServiceHandler {
|
||||
return mRegisterCenter;
|
||||
}
|
||||
|
||||
public static IMogoActionManager getActionManager() {
|
||||
return mActionManager;
|
||||
}
|
||||
|
||||
//TODO -------------以下方法是临时过度使用的,后面统一使用,getMapMarkerManager进行调用
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.service.actionmanager;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.service.module.IMogoBizActionDoneListener;
|
||||
import com.mogo.service.module.MogoAction;
|
||||
import com.mogo.service.module.IMogoActionListener;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
@@ -43,6 +44,8 @@ public class MogoActionHandler implements IMogoActionManager {
|
||||
|
||||
private Map< String, List< IMogoActionListener > > mListeners = new ConcurrentHashMap<>();
|
||||
|
||||
private IMogoBizActionDoneListener mBizActionDoneListener;
|
||||
|
||||
@Override
|
||||
public void registerActionListener( String biz, IMogoActionListener listener ) {
|
||||
if ( TextUtils.isEmpty( biz ) || listener == null ) {
|
||||
@@ -90,4 +93,21 @@ public class MogoActionHandler implements IMogoActionManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBizActionDoneListener( IMogoBizActionDoneListener listener ) {
|
||||
mBizActionDoneListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterBizActionDoneListener() {
|
||||
mBizActionDoneListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bizInvoke( String biz, int position, Object data ) {
|
||||
if ( mBizActionDoneListener != null ) {
|
||||
mBizActionDoneListener.onBizActionDone( biz, position, data );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.mogo.module.service.actionmanager;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.module.IMogoBizActionDoneListener;
|
||||
import com.mogo.service.module.MogoAction;
|
||||
import com.mogo.service.module.IMogoActionListener;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
@@ -32,6 +34,21 @@ public class MogoActionManager implements IMogoActionManager {
|
||||
MogoActionHandler.getInstance().invoke( biz, action );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBizActionDoneListener( IMogoBizActionDoneListener listener ) {
|
||||
MogoActionHandler.getInstance().registerBizActionDoneListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterBizActionDoneListener() {
|
||||
MogoActionHandler.getInstance().unregisterBizActionDoneListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bizInvoke( String biz, int position, Object data ) {
|
||||
MogoActionHandler.getInstance().bizInvoke( biz, position, data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
MogoActionHandler.getInstance().init( context );
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.module.common.entity.MarkerCardResult;
|
||||
@@ -27,6 +28,7 @@ import com.mogo.module.service.datamanager.MogoDataHandler;
|
||||
import com.mogo.module.service.utils.ViewUtils;
|
||||
import com.mogo.service.cardmanager.IMogoCardChangedListener;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.module.IMogoBizActionDoneListener;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -48,7 +50,8 @@ import java.util.Map;
|
||||
*/
|
||||
public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
IMogoOnMessageListener< MarkerResponse >,
|
||||
IMogoCardChangedListener {
|
||||
IMogoCardChangedListener,
|
||||
IMogoBizActionDoneListener {
|
||||
private static final String TAG = "MapMarkerManager";
|
||||
// 是否选中在线卡片及气泡,语音搜索触发
|
||||
private boolean mIsAISearchOnlineData = false;
|
||||
@@ -91,6 +94,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
// 长连接
|
||||
MarkerServiceHandler.getMogoSocketManager().registerOnMessageListener( 401001, this );
|
||||
MarkerServiceHandler.getMogoCardManager().registerCardChangedListener( "LAUNCHER_MARKER_MODULE", this );
|
||||
MarkerServiceHandler.getActionManager().registerBizActionDoneListener( this );
|
||||
}
|
||||
|
||||
// ACC ON 的时候重置为true,ACC OFF 设置为 false
|
||||
@@ -126,19 +130,11 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
mIsMarkerClicked = true;
|
||||
Logger.d( TAG, "onMarkerClicked 点击了大而全中的Marker:" + marker );
|
||||
try {
|
||||
if ( mLastCheckMarker != null ) {
|
||||
// 判断点击的是否是同一个
|
||||
if ( marker.equals( mLastCheckMarker ) ) {
|
||||
Logger.d( TAG, "onMarkerClicked 与上一次点击的Marker一样,不做处理:" + marker );
|
||||
return false;
|
||||
}
|
||||
// 将上次选中 Marker 设置为未选中状态
|
||||
closeMarker( mLastCheckMarker );
|
||||
boolean result = switchMarkerOpenStatus( marker );
|
||||
if ( !result ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 将当前的Marker设置为选中
|
||||
openMarker( marker );
|
||||
|
||||
// 数据统计代码
|
||||
final Map< String, Object > properties = new HashMap<>();
|
||||
switch ( mLastCheckMarker.getOwner() ) {
|
||||
@@ -187,6 +183,28 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换当前选中marker和上一个选中的状态
|
||||
*
|
||||
* @param marker
|
||||
* @return
|
||||
*/
|
||||
private boolean switchMarkerOpenStatus( IMogoMarker marker ) {
|
||||
if ( mLastCheckMarker != null ) {
|
||||
// 判断点击的是否是同一个
|
||||
if ( marker.equals( mLastCheckMarker ) ) {
|
||||
Logger.d( TAG, "onMarkerClicked 与上一次点击的Marker一样,不做处理:" + marker );
|
||||
return false;
|
||||
}
|
||||
// 将上次选中 Marker 设置为未选中状态
|
||||
closeMarker( mLastCheckMarker );
|
||||
}
|
||||
|
||||
// 将当前的Marker设置为选中
|
||||
openMarker( marker );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 对指定类型高亮处理
|
||||
public synchronized void highlightedMarker( final String typeTag ) {
|
||||
@@ -728,6 +746,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
markers.add( marker );
|
||||
setMarkersSmall( markers );
|
||||
}
|
||||
markerShowEntity.setMarker( marker );
|
||||
return marker;
|
||||
}
|
||||
|
||||
@@ -763,4 +782,22 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
public String getCurrentModuleName() {
|
||||
return mCurrentModuleName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBizActionDone( String biz, int position, Object data ) {
|
||||
Logger.d( TAG, "biz = %s, position = %s", biz, position );
|
||||
if ( data instanceof MarkerShowEntity &&
|
||||
( ( MarkerShowEntity ) data ).getMarker() != null ) {
|
||||
switchMarkerOpenStatus( ( ( MarkerShowEntity ) data ).getMarker() );
|
||||
} else {
|
||||
IMogoMarkerManager markerManager = MarkerServiceHandler.getMarkerManager();
|
||||
List< IMogoMarker > markers = markerManager.getMarkers( biz );
|
||||
if ( markers != null ) {
|
||||
IMogoMarker marker = markers.get( position );
|
||||
if ( marker != null ) {
|
||||
switchMarkerOpenStatus( marker );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoAddressManager;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.module.IMogoSettingManager;
|
||||
@@ -154,4 +155,10 @@ public interface IMogoServiceApis extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
IMogoRefreshStrategyController getRefreshStrategyControllerApi();
|
||||
|
||||
/**
|
||||
* 地址操作
|
||||
* @return
|
||||
*/
|
||||
IMogoAddressManager getAddressManagerApi();
|
||||
}
|
||||
|
||||
@@ -33,4 +33,25 @@ public interface IMogoActionManager extends IProvider {
|
||||
* @param action 动作
|
||||
*/
|
||||
void invoke( String biz, MogoAction action );
|
||||
|
||||
/**
|
||||
* 主模块注册业务回调
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
void registerBizActionDoneListener( IMogoBizActionDoneListener listener );
|
||||
|
||||
/**
|
||||
* 主模块注销业务回调
|
||||
*/
|
||||
void unregisterBizActionDoneListener();
|
||||
|
||||
/**
|
||||
* 业务回调信息到主模块
|
||||
*
|
||||
* @param biz
|
||||
* @param position
|
||||
* @param data
|
||||
*/
|
||||
void bizInvoke( String biz, int position, Object data );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.service.module;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-12
|
||||
* <p>
|
||||
* 业务回调各自的当前动作
|
||||
*/
|
||||
public interface IMogoBizActionDoneListener {
|
||||
|
||||
/**
|
||||
* @param biz 业务
|
||||
* @param position 位置
|
||||
* @param data 数据
|
||||
*/
|
||||
void onBizActionDone( String biz, int position, Object data );
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import com.mogo.service.impl.singleton.SingletonsHolder;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoAddressManager;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.module.IMogoSettingManager;
|
||||
@@ -141,6 +142,11 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance( IMogoRefreshStrategyController.class, MogoServicePaths.PATH_REFRESH_STRATEGY_API );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoAddressManager getAddressManagerApi() {
|
||||
return getApiInstance( IMogoAddressManager.class, MogoServicePaths.PATH_ADDRESS_MANAGER );
|
||||
}
|
||||
|
||||
private static < T extends IProvider > T getApiInstance( Class< T > clazz, String path ) {
|
||||
T inst = SingletonsHolder.get( clazz );
|
||||
if ( inst == null ) {
|
||||
|
||||