Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -25,6 +25,7 @@
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-map" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-search" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-service" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-share" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-tanlu" />
|
||||
<option value="$PROJECT_DIR$/services" />
|
||||
<option value="$PROJECT_DIR$/services/mogo-service" />
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -5,7 +5,7 @@
|
||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -28,7 +28,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
|
||||
DebugConfig.setNetMode( DebugConfig.NET_MODE_QA );
|
||||
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR"));
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CODITION" ) );
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CONDITION" ) );
|
||||
MogoModulePaths.addModule(new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE) );
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ def getValueFromRootProperties(String key) {
|
||||
afterEvaluate {
|
||||
rootProject.subprojects { project ->
|
||||
project.afterEvaluate {
|
||||
dependencies{
|
||||
dependencies {
|
||||
components {
|
||||
all { ComponentMetadataDetails details ->
|
||||
if (details.toString().endsWith("-SNAPSHOT")) {
|
||||
@@ -87,4 +87,4 @@ afterEvaluate {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ ext {
|
||||
moduledemo : "com.mogo.module:module-demo:${DEMO_MODULE_MAP_VERSION}",
|
||||
moduledemo2 : "com.mogo.module:module-demo2:${DEMO_MODULE_MAP2_VERSION}",
|
||||
moduletanlu : "com.mogo.module:module-tanlu:${MOGO_MODULE_TANLU_VERSION}",
|
||||
moduleshare : "com.mogo.module:module-share:${MOGO_MODULE_SHARE_VERSION}",
|
||||
mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}",
|
||||
mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}",
|
||||
mapamap : "com.mogo.map:map-amap:${MAP_AMAP_VERSION}",
|
||||
|
||||
@@ -29,6 +29,7 @@ RELEASE=false
|
||||
DEMO_MODULE_MAP_VERSION=1.0.0-SNAPSHOT
|
||||
DEMO_MODULE_MAP2_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_TANLU_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_SHARE_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_COMMONS_VERSION=1.0.0-SNAPSHOT
|
||||
MOGO_UTILS_VERSION=1.0.0-SNAPSHOT
|
||||
MAP_AMAP_VERSION=1.0.0-SNAPSHOT
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.map.impl.amap;
|
||||
import android.content.Context;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -130,7 +131,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
mMapView.setRouteOverlayVisible( false );
|
||||
mMapView.setCarOverlayVisible( false );
|
||||
mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE );
|
||||
mMapView.setNaviMode( AMapNaviView.CAR_UP_MODE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,6 +379,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
case Type_Night:
|
||||
options.setNaviNight( true );
|
||||
break;
|
||||
case Type_AUTO_LIGHT_Night:
|
||||
options.setNaviNight( false );
|
||||
options.setAutoNaviViewNightMode( true );
|
||||
break;
|
||||
}
|
||||
mMapView.setViewOptions( options );
|
||||
}
|
||||
@@ -425,7 +430,9 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void displayOverview() {
|
||||
if ( checkAMapView() ) {
|
||||
mMapView.displayOverview();
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
mMapView.displayOverview();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,6 +496,16 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap( mMapView.getMap().getCameraPosition().target );
|
||||
} catch ( Exception e ) {
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
|
||||
if ( checkAMapView() ) {
|
||||
@@ -497,4 +514,16 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
mMapView.setViewOptions( options );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen( MogoLatLng latLng ) {
|
||||
if ( checkAMapView() ) {
|
||||
try {
|
||||
return mMapView.getMap().getProjection().toScreenLocation( ObjectUtils.fromMogo2( latLng ) );
|
||||
} catch ( Exception e ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.map.impl.amap.marker;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Point;
|
||||
import android.view.View;
|
||||
|
||||
import com.amap.api.maps.model.BitmapDescriptor;
|
||||
@@ -281,4 +282,11 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
public String getOwner() {
|
||||
return this.mOwner == null ? mMogoMarkerOptions.getOwner() : mOwner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPositionByPixels( Point position ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setPositionByPixels( position.x, position.y );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.map.impl.amap.uicontroller;
|
||||
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.MogoMap;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
@@ -130,10 +132,25 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public MogoLatLng getWindowCenterLocation() {
|
||||
if ( mClient != null ) {
|
||||
return mClient.getCameraSouthWestPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.setPointToCenter( mapCenterX, mapCenterY );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen( MogoLatLng latLng ) {
|
||||
if ( mClient != null ) {
|
||||
return mClient.getLocationPointInScreen( latLng );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,11 @@ public interface IMogoLocationClient {
|
||||
*/
|
||||
void removeLocationListener( IMogoLocationListener listener );
|
||||
|
||||
/**
|
||||
* 返回上一次有效定位
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLocation getLastKnowLocation();
|
||||
|
||||
void destroy();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.map.marker;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
@@ -107,6 +108,11 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void setPosition( double lat, double lng );
|
||||
|
||||
/**
|
||||
* 获取坐标点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getPosition();
|
||||
|
||||
/**
|
||||
@@ -209,4 +215,11 @@ public interface IMogoMarker {
|
||||
* @return
|
||||
*/
|
||||
String getOwner();
|
||||
|
||||
/**
|
||||
* 设置marker在window的位置
|
||||
*
|
||||
* @param position window 的位置。
|
||||
*/
|
||||
void setPositionByPixels( Point position );
|
||||
}
|
||||
|
||||
@@ -94,4 +94,5 @@ public interface IMogoNavi {
|
||||
* 清除规划的路线
|
||||
*/
|
||||
void clearCalculatePaths();
|
||||
|
||||
}
|
||||
|
||||
@@ -25,12 +25,17 @@ public enum EnumMapUI {
|
||||
/**
|
||||
* 白天模式
|
||||
*/
|
||||
Type_Light( 3, 4 ),
|
||||
Type_Light( 3, 5 ),
|
||||
|
||||
/**
|
||||
* 夜晚模式
|
||||
*/
|
||||
Type_Night( 4, 3 );
|
||||
Type_Night( 4, 4 ),
|
||||
|
||||
/**
|
||||
* 夜晚模式
|
||||
*/
|
||||
Type_AUTO_LIGHT_Night( 5, 3 );
|
||||
|
||||
private int next;
|
||||
private int code;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.map.uicontroller;
|
||||
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
@@ -88,6 +90,13 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
MogoLatLng getCameraSouthWestPosition();
|
||||
|
||||
/**
|
||||
* 获取视图中心点坐标
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getWindowCenterLocation();
|
||||
|
||||
/**
|
||||
* 设置地图中心点
|
||||
*
|
||||
@@ -95,4 +104,12 @@ public interface IMogoMapUIController {
|
||||
* @param mapCenterY y 点位置x值与地图高度的比例
|
||||
*/
|
||||
void setPointToCenter( double mapCenterX, double mapCenterY );
|
||||
|
||||
/**
|
||||
* 获取经纬度对应的屏幕的位置
|
||||
*
|
||||
* @param latLng
|
||||
* @return
|
||||
*/
|
||||
Point getLocationPointInScreen( MogoLatLng latLng );
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.map.impl.amap.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
@@ -21,9 +23,9 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
public static MogoMapUIController getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoMapUIController.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoMapUIController.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoMapUIController();
|
||||
}
|
||||
}
|
||||
@@ -36,64 +38,64 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled( boolean visible ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setTrafficEnabled( visible );
|
||||
public void setTrafficEnabled(boolean visible) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setTrafficEnabled(visible);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( boolean zoom ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.changeZoom( zoom );
|
||||
public void changeZoom(boolean zoom) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.changeZoom(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( float zoom ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.changeZoom( zoom );
|
||||
public void changeZoom(float zoom) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.changeZoom(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapMode( EnumMapUI mode ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.changeMapMode( mode );
|
||||
public void changeMapMode(EnumMapUI mode) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.changeMapMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCenter( MogoLatLng latLng ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.moveToCenter( latLng );
|
||||
public void moveToCenter(MogoLatLng latLng) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.moveToCenter(latLng);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.showMyLocation( visible );
|
||||
public void showMyLocation(boolean visible) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.showMyLocation(visible);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recoverLockMode() {
|
||||
if ( mDelegate != null ) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.recoverLockMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview() {
|
||||
if ( mDelegate != null ) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.displayOverview();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if ( mDelegate != null ) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getScalePerPixel();
|
||||
}
|
||||
return 0;
|
||||
@@ -101,7 +103,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
if ( mDelegate != null ) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getZoomLevel();
|
||||
}
|
||||
return 0;
|
||||
@@ -109,7 +111,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraNorthEastPosition() {
|
||||
if ( mDelegate != null ) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCameraNorthEastPosition();
|
||||
}
|
||||
return null;
|
||||
@@ -117,16 +119,31 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraSouthWestPosition() {
|
||||
if ( mDelegate != null ) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCameraSouthWestPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public MogoLatLng getWindowCenterLocation() {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getWindowCenterLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setPointToCenter( mapCenterX, mapCenterY );
|
||||
public void setPointToCenter(double mapCenterX, double mapCenterY) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setPointToCenter(mapCenterX, mapCenterY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen( MogoLatLng latLng ) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getLocationPointInScreen(latLng);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,17 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
api rootProject.ext.dependencies.mogomapapi
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
} else {
|
||||
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
api project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':services:mogo-service-api')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.mogo.module.common.adapter;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-10
|
||||
* <p>
|
||||
* 适配器
|
||||
*/
|
||||
public abstract class MogoMapListenerAdapter implements IMogoMapListener {
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch( MotionEvent motionEvent ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick( MogoPoi poi ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick( MogoLatLng latLng ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged( MogoLatLng latLng, float zoom, float tilt, float bearing ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.moduleshare
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
@@ -57,6 +58,7 @@ dependencies {
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-share')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
|
||||
private void init() {
|
||||
mHolder = getHolder();
|
||||
mHolder.addCallback( this );
|
||||
setZOrderOnTop( false );
|
||||
setZOrderOnTop( true );
|
||||
mHolder.setFormat( PixelFormat.TRANSLUCENT );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -15,6 +16,8 @@ import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
@@ -25,6 +28,8 @@ import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.navi.NaviInfoView;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.module.share.dialog.LaucherShareDialog;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
@@ -63,6 +68,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private IMogoLocationClient mMogoLocationClient;
|
||||
private IMogoNavi mMogoNavi;
|
||||
private IMogoFragmentManager mMogoFragmentManager;
|
||||
private IMogoMarkerManager mMogoMarkerManager;
|
||||
|
||||
private IMogoRegisterCenter mMogoRegisterCenter;
|
||||
|
||||
@@ -80,7 +86,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mMogoFragmentManager = ( IMogoFragmentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_FRAGMENT_MANAGER ).navigation();
|
||||
|
||||
mCommonAddress = findViewById( R.id.module_entrance_id_common_address );
|
||||
|
||||
mSearch = findViewById( R.id.module_entrance_id_search );
|
||||
@@ -97,10 +102,14 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mCompany = findViewById( R.id.module_entrance_id_company );
|
||||
mCompany.setOnClickListener( view -> {
|
||||
mMogoMarkerManager.addMarker( "tag", new MogoMarkerOptions().owner( "tag" )
|
||||
.latitude( 39.000 ).longitude( 136.000 ).icon( BitmapFactory.decodeResource( getResources(), R.drawable.module_ext_ic_voice ) ).anchor( 0.5f, 0.5f ) );
|
||||
} );
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
ShareControl shareControl = new ShareControl();
|
||||
shareControl.showDialog(getActivity());
|
||||
} );
|
||||
|
||||
mVRMode = findViewById( R.id.module_entrance_id_vr_mode );
|
||||
@@ -146,6 +155,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
|
||||
mMogoMarkerManager = mService.getMarkerManager( getContext() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,18 @@ import android.text.TextUtils;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.voice.IMogoVoiceListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -21,6 +28,9 @@ import com.mogo.service.voice.IMogoVoiceListener;
|
||||
*/
|
||||
public class MapPresenter extends Presenter< MapView > implements IMogoVoiceListener, IMogoVoiceCmdCallBack {
|
||||
|
||||
private static final String TAG = "MapPresenter";
|
||||
|
||||
private IMogoMapService mMogoMapService;
|
||||
|
||||
public MapPresenter( MapView view ) {
|
||||
super( view );
|
||||
@@ -29,18 +39,19 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
|
||||
registerUnWakeupCmd();
|
||||
}
|
||||
|
||||
private void registerUnWakeupCmd() {
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_LIGHT_MODE, VoiceConstants.CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS, this );
|
||||
if ( VoiceConstants.sUnWakeupCmds.isEmpty() ) {
|
||||
Logger.w( TAG, "no unwakeup words" );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnWakeupCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +122,7 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
* @param action actionType = 0 -> 0 - 开、1 - 关
|
||||
* actionType = 1 -> 0 - 放大地图、1 - 缩小地图
|
||||
* actionType = 2 -> 0 - 切换到2D车头朝上、1 - 切换2D正北模式、2 - 切换3D车头朝上
|
||||
* actionType = 3 -> 0 - 黑夜、1 - 正常
|
||||
* actionType = 3 -> 0 - 黑夜、1 - 正常、2 - 自动
|
||||
*/
|
||||
public void onMapUISetting( int actionType, int action ) {
|
||||
switch ( actionType ) {
|
||||
@@ -146,6 +157,8 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Night );
|
||||
} else if ( action == 1 ) {
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Light );
|
||||
} else if( action == 2){
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -178,6 +191,21 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE:
|
||||
onMapUISetting( 3, 0 );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
|
||||
onMapUISetting( 3, 2 );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
|
||||
mMogoMapService.getMapUIController().displayOverview();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE:
|
||||
mMogoMapService.getMapUIController().recoverLockMode();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE:
|
||||
mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
|
||||
mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
@@ -99,12 +102,13 @@ public class VoiceConstants {
|
||||
* 2D模式
|
||||
*/
|
||||
public static final String CMD_MAP_2D = "CMD_MAP_2D";
|
||||
public static final String[] CMD_MAP_2D_WAKE_UP_WORDS = {"2D模式"};
|
||||
public static final String[] CMD_MAP_2D_WAKE_UP_WORDS = {"二地模式"};
|
||||
|
||||
/**
|
||||
* 3D模式
|
||||
*/
|
||||
public static final String CMD_MAP_3D = "CMD_MAP_3D";
|
||||
public static final String[] CMD_MAP_3D_WAKE_UP_WORDS = {"3D模式"};
|
||||
public static final String[] CMD_MAP_3D_WAKE_UP_WORDS = {"三地模式"};
|
||||
|
||||
/**
|
||||
* 白天模式
|
||||
@@ -116,18 +120,67 @@ public class VoiceConstants {
|
||||
* 黑夜模式
|
||||
*/
|
||||
public static final String CMD_MAP_NIGHT_MODE = "CMD_MAP_NIGHT_MODE";
|
||||
public static final String[] CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS = {"黑夜模式"};
|
||||
public static final String[] CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS = {"夜间模式"};
|
||||
|
||||
/**
|
||||
* 自动模式
|
||||
*/
|
||||
public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE = "CMD_MAP_AUTO_LIGHT_NIGHT_MODE";
|
||||
public static final String[] CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_WORDS = {"自动模式"};
|
||||
|
||||
/**
|
||||
* 查看路况
|
||||
*/
|
||||
public static final String CMD_MAP_TRAFFIC_MODE = "CMD_MAP_TRAFFIC_MODE";
|
||||
public static final String[] CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS = {"查看路况"};
|
||||
public static final String[] CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS = {"打开路况", "打开实况"};
|
||||
/**
|
||||
* 关闭路况
|
||||
*/
|
||||
public static final String CMD_MAP_UN_TRAFFIC_MODE = "CMD_MAP_UN_TRAFFIC_MODE";
|
||||
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS = {"关闭路况"};
|
||||
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS = {"关闭路况","关闭实况"};
|
||||
|
||||
/**
|
||||
* 导航全览
|
||||
*/
|
||||
public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "CMD_MAP_DISPLAY_OVERVIEW_MODE";
|
||||
public static final String[] CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS = {"进入全览", "查看全程"};
|
||||
|
||||
/**
|
||||
* 继续导航
|
||||
*/
|
||||
public static final String CMD_MAP_CONTINUE_NAVI_MODE = "CMD_MAP_CONTINUE_NAVI_MODE";
|
||||
public static final String[] CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS = {"继续导航"};
|
||||
|
||||
/**
|
||||
* 车头朝上
|
||||
*/
|
||||
public static final String CMD_MAP_CAR_UP_MODE = "CMD_MAP_CAR_UP_MODE";
|
||||
public static final String[] CMD_MAP_CAR_UP_MODE_WAKE_UP_WORDS = {"车头朝上"};
|
||||
|
||||
/**
|
||||
* 北朝上
|
||||
*/
|
||||
public static final String CMD_MAP_NORTH_UP_MODE = "CMD_MAP_NORTH_UP_MODE";
|
||||
public static final String[] CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS = {"北朝上"};
|
||||
|
||||
public static final Map< String, String[] > sUnWakeupCmds = new HashMap<>();
|
||||
|
||||
|
||||
static {
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_LIGHT_MODE, VoiceConstants.CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE, VoiceConstants.CMD_MAP_CAR_UP_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE, VoiceConstants.CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,33 +1,51 @@
|
||||
package com.mogo.module.navi.constants
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.StatusBarManager
|
||||
import android.content.Context
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.amap.api.services.interfaces.IGeocodeSearch
|
||||
import com.mogo.map.marker.IMogoMarkerManager
|
||||
import com.mogo.map.navi.IMogoNavi
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager
|
||||
import com.mogo.service.map.IMogoMapService
|
||||
import com.mogo.service.module.IMogoRegisterCenter
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager
|
||||
import kotlin.isInitialized as isInitialized1
|
||||
|
||||
/**
|
||||
*@author zyz
|
||||
* 2020-01-08.
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object SearchServiceHolder {
|
||||
|
||||
val fragmentManager:IMogoFragmentManager = ARouter.getInstance().build(
|
||||
// 单例对象,要使用Application Context
|
||||
private lateinit var context: Context
|
||||
val fragmentManager: IMogoFragmentManager = ARouter.getInstance().build(
|
||||
MogoServicePaths.PATH_FRAGMENT_MANAGER
|
||||
).navigation() as IMogoFragmentManager
|
||||
val mapService:IMogoMapService = ARouter.getInstance().build(
|
||||
val mapService: IMogoMapService = ARouter.getInstance().build(
|
||||
MogoServicePaths.PATH_SERVICES_MAP
|
||||
).navigation() as IMogoMapService
|
||||
val listenerCenter:IMogoRegisterCenter = ARouter.getInstance().build(
|
||||
val listenerCenter: IMogoRegisterCenter = ARouter.getInstance().build(
|
||||
MogoServicePaths.PATH_REGISTER_CENTER
|
||||
).navigation() as IMogoRegisterCenter
|
||||
val statusManager: IMogoStatusManager = ARouter.getInstance().build(
|
||||
MogoServicePaths.PATH_STATUS_MANAGER
|
||||
).navigation() as IMogoStatusManager
|
||||
|
||||
var geoSearch: IMogoGeoSearch? = null
|
||||
|
||||
fun push(
|
||||
fun init(context: Context) {
|
||||
this.context = context
|
||||
}
|
||||
|
||||
fun push(
|
||||
fragment: Fragment,
|
||||
tag: String
|
||||
) {
|
||||
@@ -38,9 +56,23 @@ object SearchServiceHolder {
|
||||
fragmentManager.push(build)
|
||||
}
|
||||
|
||||
|
||||
fun getNavi(context: Context):IMogoNavi{
|
||||
fun getNavi(): IMogoNavi {
|
||||
return mapService.getNavi(context)
|
||||
}
|
||||
|
||||
fun getMapUIController(): IMogoMapUIController {
|
||||
return mapService.mapUIController
|
||||
}
|
||||
|
||||
fun getMarkerManger(): IMogoMarkerManager {
|
||||
return mapService.getMarkerManager(context)
|
||||
}
|
||||
|
||||
fun getGeoSearcher(): IMogoGeoSearch {
|
||||
if (geoSearch == null) {
|
||||
geoSearch = mapService.getGeoSearch(context)
|
||||
}
|
||||
return geoSearch!!
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.navi.constants.SearchServiceHolder;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
|
||||
/**
|
||||
@@ -70,4 +72,27 @@ public abstract class BaseFragment extends Fragment {
|
||||
Toast.makeText( mContext, msg, Toast.LENGTH_LONG ).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void setMarkerStatus(boolean show){
|
||||
SearchServiceHolder.INSTANCE.getStatusManager().setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, show
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移动地图中心点到屏幕中心
|
||||
*/
|
||||
protected void moveMapToCenter(){
|
||||
SearchServiceHolder.INSTANCE.getMapUIController().setPointToCenter(0.5,0.5);
|
||||
}
|
||||
|
||||
//mMogoMapUIController.setPointToCenter( 0.66145, 0.590688 );
|
||||
/**
|
||||
* 移动地图中心点到屏幕右侧
|
||||
*/
|
||||
protected void moveMapToRight(){
|
||||
SearchServiceHolder.INSTANCE.getMapUIController().setPointToCenter(0.66145, 0.590688);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ import com.mogo.module.navi.bean.SearchPoi
|
||||
import com.mogo.module.navi.constants.SearchServiceHolder
|
||||
import com.mogo.module.navi.ui.adapter.SearchCategoryAdapter
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.cv_search_result
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.rv_search_result
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.tv_navi_navi
|
||||
import kotlinx.android.synthetic.main.fragment_setting_address.rv_search_result
|
||||
import kotlinx.android.synthetic.main.include_search_bar.et_navi_search
|
||||
import kotlinx.android.synthetic.main.include_search_bar.iv_navi_back
|
||||
|
||||
@@ -28,6 +28,9 @@ class CategorySearchFragment : BaseSearchFragment() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
category=arguments?.getString("category")
|
||||
SearchServiceHolder.statusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, false
|
||||
)
|
||||
}
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.fragment_search_category
|
||||
@@ -83,6 +86,13 @@ class CategorySearchFragment : BaseSearchFragment() {
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
SearchServiceHolder.statusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, false
|
||||
)
|
||||
}
|
||||
|
||||
companion object{
|
||||
fun newInstance( category:String):Fragment{
|
||||
var bundle = Bundle()
|
||||
|
||||
@@ -40,12 +40,12 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
}
|
||||
|
||||
override fun onCalculateSuccess() {
|
||||
var calculatedStrategies = SearchServiceHolder.getNavi(activity!!)
|
||||
var calculatedStrategies = SearchServiceHolder.getNavi()
|
||||
.calculatedStrategies
|
||||
|
||||
if (calculatedStrategies != null&&calculatedStrategies.size>0) {
|
||||
if (calculatedStrategies != null && calculatedStrategies.size > 0) {
|
||||
mAdapter.setDatas(calculatedStrategies)
|
||||
mAdapter.selectTag=calculatedStrategies[0].tagId
|
||||
mAdapter.selectTag = calculatedStrategies[0].tagId
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,9 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
mogoTip = arguments?.getParcelable<MogoTip>(AMapConstants.KEY_PARCELABLE)
|
||||
SearchServiceHolder.statusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT, true
|
||||
)
|
||||
}
|
||||
|
||||
override fun onViewCreated(
|
||||
@@ -70,14 +73,15 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
iv_navi_back.setOnClickListener {
|
||||
SearchServiceHolder.fragmentManager.pop()
|
||||
SearchServiceHolder.getNavi(context!!).clearCalculatePaths()
|
||||
SearchServiceHolder.getNavi()
|
||||
.clearCalculatePaths()
|
||||
}
|
||||
|
||||
tv_navi_navi.text = getString(R.string.start_navi)
|
||||
|
||||
et_navi_search.setText(getString(R.string.choose_path))
|
||||
et_navi_search.isEnabled = false
|
||||
SearchServiceHolder.getNavi(context!!)
|
||||
SearchServiceHolder.getNavi()
|
||||
.naviTo(mogoTip?.point)
|
||||
|
||||
SearchServiceHolder.listenerCenter.registerMogoNaviListener(
|
||||
@@ -91,12 +95,11 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
|
||||
rv_search_result.adapter = mAdapter
|
||||
tv_navi_navi.setOnClickListener {
|
||||
SearchServiceHolder.fragmentManager.clearAll()
|
||||
SearchServiceHolder.getNavi(activity!!)
|
||||
SearchServiceHolder.getNavi()
|
||||
.startNavi(false)
|
||||
}
|
||||
|
||||
SearchServiceHolder.getNavi(context!!)
|
||||
SearchServiceHolder.getNavi()
|
||||
.setLineClickInteraction {
|
||||
mAdapter.setSelectTag(it)
|
||||
}
|
||||
@@ -104,11 +107,21 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener {
|
||||
mAdapter.setOnClickListener {
|
||||
var item = it.getTag(R.id.tag_item) as MogoCalculatePath
|
||||
mAdapter.setSelectTag(item.tagId)
|
||||
SearchServiceHolder.getNavi(context!!)
|
||||
SearchServiceHolder.getNavi()
|
||||
.itemClickInteraction.onItemClicked(item.tagId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
SearchServiceHolder.listenerCenter.unregisterMogoNaviListener(
|
||||
MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT
|
||||
)
|
||||
SearchServiceHolder.statusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT, false
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(searchPoi: MogoTip): Fragment {
|
||||
var bundle = Bundle()
|
||||
|
||||
@@ -81,6 +81,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
SearchServiceHolder.INSTANCE.init(getActivity().getApplicationContext());
|
||||
}
|
||||
|
||||
@Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
@@ -1,52 +1,80 @@
|
||||
package com.mogo.module.navi.ui.setting
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.map.search.inputtips.MogoTip
|
||||
import com.mogo.map.MogoLatLng
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.location.IMogoLocationListener
|
||||
import com.mogo.map.location.MogoLocation
|
||||
import com.mogo.map.marker.IMogoMarker
|
||||
import com.mogo.map.marker.MogoMarkerOptions
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener
|
||||
import com.mogo.map.search.geo.MogoGeocodeResult
|
||||
import com.mogo.map.search.geo.MogoRegeocodeResult
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery
|
||||
import com.mogo.module.common.MogoModulePaths
|
||||
import com.mogo.module.common.adapter.MogoMapListenerAdapter
|
||||
import com.mogo.module.navi.R
|
||||
import com.mogo.module.navi.bean.SearchPoi
|
||||
import com.mogo.module.navi.R.string
|
||||
import com.mogo.module.navi.constants.AMapConstants
|
||||
import com.mogo.module.navi.constants.SearchServiceHolder
|
||||
import com.mogo.module.navi.ui.adapter.SearchPoiAdapter
|
||||
import com.mogo.module.navi.ui.base.BaseFragment
|
||||
import com.mogo.module.navi.ui.search.BaseSearchFragment
|
||||
import kotlinx.android.synthetic.main.fragment_navi_setting.iv_back
|
||||
import kotlinx.android.synthetic.main.include_search_bar.iv_navi_back
|
||||
import kotlinx.android.synthetic.main.fragment_setting_address.group_set_address
|
||||
import kotlinx.android.synthetic.main.fragment_setting_address.rv_search_result
|
||||
import kotlinx.android.synthetic.main.fragment_setting_address.tv_navi_choose_point
|
||||
import kotlinx.android.synthetic.main.fragment_setting_address.tv_navi_my_location
|
||||
import kotlinx.android.synthetic.main.fragment_setting_address.tv_set_as_home
|
||||
import kotlinx.android.synthetic.main.include_search_bar.et_navi_search
|
||||
import kotlinx.android.synthetic.main.include_search_bar.iv_navi_back
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-01-07.
|
||||
*/
|
||||
@Route(path = MogoModulePaths.PATH_FRAGMENT_SETTING_HOME)
|
||||
class SettingAddressFragment : BaseSearchFragment() {
|
||||
override fun renderSearchPoiResult(
|
||||
datums: MutableList<MogoTip>?,
|
||||
showDelete: Boolean
|
||||
) {
|
||||
mAdapter.setDatas(datums)
|
||||
group_set_address.visibility = View.GONE
|
||||
rv_search_result.visibility = View.VISIBLE
|
||||
class SettingAddressFragment : BaseFragment(), IMogoGeoSearchListener {
|
||||
override fun onRegeocodeSearched(regeocodeResult: MogoRegeocodeResult?) {
|
||||
|
||||
et_navi_search.setText(regeocodeResult?.regeocodeAddress?.formatAddress)
|
||||
}
|
||||
|
||||
override fun onGeocodeSearched(geocodeResult: MogoGeocodeResult?) {
|
||||
|
||||
}
|
||||
|
||||
override fun showHistory(datums: MutableList<SearchPoi>?) {
|
||||
}
|
||||
|
||||
private val TAG: String = "SettingAddressFragment"
|
||||
private var style: Int = 0
|
||||
private lateinit var mAdapter: SearchPoiAdapter
|
||||
var addMarker: IMogoMarker? = null
|
||||
|
||||
private var mapListener: IMogoMapListener = object : MogoMapListenerAdapter() {
|
||||
override fun onMapChanged(
|
||||
latLng: MogoLatLng?,
|
||||
zoom: Float,
|
||||
tilt: Float,
|
||||
bearing: Float
|
||||
) {
|
||||
super.onMapChanged(latLng, zoom, tilt, bearing)
|
||||
var mogoRegeocodeQuery = MogoRegeocodeQuery()
|
||||
mogoRegeocodeQuery.point = latLng
|
||||
SearchServiceHolder.getGeoSearcher()
|
||||
.getFromLocationAsyn(mogoRegeocodeQuery)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
style = arguments?.getInt(AMapConstants.KEY_SET_HOME_COMPONY) ?: 0
|
||||
setMarkerStatus(true)
|
||||
SearchServiceHolder.listenerCenter.registerMogoMapListener(
|
||||
MogoModulePaths.PATH_FRAGMENT_SETTING_HOME, mapListener
|
||||
)
|
||||
SearchServiceHolder.getMapUIController()
|
||||
.showMyLocation(false)
|
||||
moveMapToCenter()
|
||||
|
||||
SearchServiceHolder.getGeoSearcher()
|
||||
.setGeoSearchListener(this)
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -61,10 +89,6 @@ class SettingAddressFragment : BaseSearchFragment() {
|
||||
return style == 1
|
||||
}
|
||||
|
||||
fun isSearch(): Boolean {
|
||||
return group_set_address.visibility == View.GONE
|
||||
}
|
||||
|
||||
override fun onViewCreated(
|
||||
view: View,
|
||||
savedInstanceState: Bundle?
|
||||
@@ -78,46 +102,46 @@ class SettingAddressFragment : BaseSearchFragment() {
|
||||
tv_set_as_home.text = resources.getString(R.string.set_as_compony_navi)
|
||||
}
|
||||
|
||||
mAdapter = SearchPoiAdapter(activity, ArrayList())
|
||||
|
||||
rv_search_result.layoutManager =
|
||||
LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
rv_search_result.adapter = mAdapter
|
||||
|
||||
|
||||
iv_navi_back.setOnClickListener {
|
||||
if (group_set_address.visibility == View.VISIBLE) {
|
||||
SearchServiceHolder.fragmentManager.pop()
|
||||
} else {
|
||||
reset()
|
||||
}
|
||||
SearchServiceHolder.fragmentManager.pop()
|
||||
}
|
||||
|
||||
et_navi_search.isEnabled = false
|
||||
et_navi_search.setText(getString(string.drag_map_to_choose))
|
||||
var location = SearchServiceHolder.getMapUIController()
|
||||
.windowCenterLocation
|
||||
if (addMarker == null) {
|
||||
var decodeResource = BitmapFactory.decodeResource(resources, R.mipmap.icon_choose_position)
|
||||
val options = MogoMarkerOptions()
|
||||
.icon(decodeResource)
|
||||
.latitude(location?.lat ?: 0.0)
|
||||
.owner(TAG)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.longitude(location?.lng ?: 0.0)
|
||||
addMarker = SearchServiceHolder.getMarkerManger()
|
||||
.addMarker(MogoModulePaths.PATH_FRAGMENT_SETTING_HOME, options)
|
||||
|
||||
tv_navi_choose_point.setOnClickListener {
|
||||
group_set_address.visibility = View.GONE
|
||||
tv_set_as_home.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
tv_navi_my_location.setOnClickListener {
|
||||
group_set_address.visibility = View.GONE
|
||||
tv_set_as_home.visibility = View.VISIBLE
|
||||
var locationPointInScreen = SearchServiceHolder.getMapUIController()
|
||||
.getLocationPointInScreen(location)
|
||||
addMarker?.setPositionByPixels(locationPointInScreen)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun reset() {
|
||||
group_set_address.visibility = View.VISIBLE
|
||||
rv_search_result.visibility = View.GONE
|
||||
mAdapter.clear()
|
||||
et_navi_search.setText("")
|
||||
tv_set_as_home.visibility = View.GONE
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
setMarkerStatus(true)
|
||||
SearchServiceHolder.getMapUIController()
|
||||
.showMyLocation(true)
|
||||
SearchServiceHolder.listenerCenter.unregisterMogoMapListener(
|
||||
MogoModulePaths.PATH_FRAGMENT_SETTING_HOME
|
||||
)
|
||||
addMarker?.destroy()
|
||||
moveMapToRight()
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(type: Int = 0): Fragment {
|
||||
|
||||
var settingAddressFragment = SettingAddressFragment()
|
||||
val bundle = Bundle()
|
||||
bundle.putInt(AMapConstants.KEY_SET_HOME_COMPONY, type)
|
||||
|
||||
@@ -121,6 +121,9 @@
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:layout_width="600dp"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/txt_large"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_navi_wash"
|
||||
android:background="@drawable/shape_round_gray"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_navi_search"
|
||||
|
||||
@@ -11,52 +11,6 @@
|
||||
|
||||
<include layout="@layout/include_search_bar" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="180dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:textColor="@color/white"
|
||||
android:paddingLeft="@dimen/dp_56"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/shape_round_gray"
|
||||
android:text="@string/my_location_search"
|
||||
android:drawablePadding="@dimen/dp_8"
|
||||
android:id="@+id/tv_navi_my_location"
|
||||
android:drawableLeft="@mipmap/icon_navi_location"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_navi_search"
|
||||
android:layout_height="@dimen/dp_120"/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="180dp"
|
||||
android:id="@+id/tv_navi_choose_point"
|
||||
android:textSize="@dimen/sp_40"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_navi_my_location"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_navi_my_location"
|
||||
android:textColor="@color/white"
|
||||
android:paddingLeft="@dimen/dp_56"
|
||||
android:drawablePadding="@dimen/dp_8"
|
||||
android:background="@drawable/shape_round_gray"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/dp_32"
|
||||
android:text="@string/choose_location_search"
|
||||
android:drawableLeft="@mipmap/icon_navi_location"
|
||||
android:layout_height="@dimen/dp_120"/>
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_set_address"
|
||||
app:constraint_referenced_ids="tv_navi_choose_point,tv_navi_my_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_266"
|
||||
android:text="@string/set_as_home_navi"
|
||||
@@ -73,16 +27,4 @@
|
||||
android:layout_height="@dimen/dp_104"/>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="@dimen/dp_838"
|
||||
android:id="@+id/rv_search_result"
|
||||
android:visibility="gone"
|
||||
android:paddingLeft="@dimen/dp_37"
|
||||
android:paddingRight="@dimen/dp_37"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:background="@drawable/shape_round_gray"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_navi_search"
|
||||
android:layout_height="@dimen/dp_778"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -3,4 +3,5 @@
|
||||
<dimen name="txt_normal">@dimen/sp_32</dimen>
|
||||
<dimen name="fragment_left_margin">@dimen/dp_60</dimen>
|
||||
<dimen name="txt_title">@dimen/sp_40</dimen>
|
||||
<dimen name="txt_large">25sp</dimen>
|
||||
</resources>
|
||||
@@ -33,4 +33,5 @@
|
||||
<string name="navi_to_there">导航去这里</string>
|
||||
<string name="start_navi">开始导航</string>
|
||||
<string name="choose_path">路线选择</string>
|
||||
<string name="drag_map_to_choose">拖动地图选点</string>
|
||||
</resources>
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ServiceConst {
|
||||
/**
|
||||
* 卡片 探路数据
|
||||
*/
|
||||
public static final String CARD_TYPE_ROAD_CODITION = "CARD_TYPE_ROAD_CODITION";
|
||||
public static final String CARD_TYPE_ROAD_CONDITION = "CARD_TYPE_ROAD_CONDITION";
|
||||
|
||||
/**
|
||||
* 卡片 分享音乐
|
||||
|
||||
1
modules/mogo-module-share/.gitignore
vendored
Normal file
1
modules/mogo-module-share/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
63
modules/mogo-module-share/build.gradle
Normal file
63
modules/mogo-module-share/build.gradle
Normal file
@@ -0,0 +1,63 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
implementation 'androidx.core:core-ktx:1.0.2'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
} else {
|
||||
implementation project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
implementation project(':modules:mogo-module-common')
|
||||
}
|
||||
|
||||
}
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
0
modules/mogo-module-share/consumer-rules.pro
Normal file
0
modules/mogo-module-share/consumer-rules.pro
Normal file
3
modules/mogo-module-share/gradle.properties
Normal file
3
modules/mogo-module-share/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-share
|
||||
VERSION_CODE=1
|
||||
21
modules/mogo-module-share/proguard-rules.pro
vendored
Normal file
21
modules/mogo-module-share/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.example.mogo_module_share
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.example.mogo_module_share.test", appContext.packageName)
|
||||
}
|
||||
}
|
||||
2
modules/mogo-module-share/src/main/AndroidManifest.xml
Normal file
2
modules/mogo-module-share/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.share" />
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2020-01-10
|
||||
*/
|
||||
@Keep
|
||||
public interface IShareControl {
|
||||
/**
|
||||
* 显示对话框
|
||||
*/
|
||||
@Keep
|
||||
void showDialog(Context context);
|
||||
|
||||
/**
|
||||
* 对话框消失
|
||||
*/
|
||||
@Keep
|
||||
void dismissDialog();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
import com.mogo.module.share.dialog.LaucherShareDialog;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 分享弹框接口
|
||||
* @since 2020-01-10
|
||||
*/
|
||||
public class ShareControl implements IShareControl {
|
||||
@Override
|
||||
public void showDialog(Context context) {
|
||||
LaucherShareDialog shareDialog = new LaucherShareDialog(context);
|
||||
shareDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismissDialog() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.mogo.module.tanlu.view;
|
||||
package com.mogo.module.share.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.tanlu.R;
|
||||
import com.mogo.module.share.R;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
@@ -16,12 +20,14 @@ import com.mogo.module.tanlu.R;
|
||||
* @since 2020-01-10
|
||||
*/
|
||||
public class LaucherShareDialog extends Dialog implements View.OnClickListener {
|
||||
|
||||
private TextView txtOk;
|
||||
private ImageView mBackImage;
|
||||
private Context mContext;
|
||||
|
||||
|
||||
public LaucherShareDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
public LaucherShareDialog(@NonNull Context context, int themeResId) {
|
||||
@@ -31,48 +37,41 @@ public class LaucherShareDialog extends Dialog implements View.OnClickListener {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
initView();
|
||||
initListener();
|
||||
|
||||
txtOk.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// if (onOkListener != null) {
|
||||
// onOkListener.onClick(v);
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
setContentView(R.layout.launcher_dialog_share);
|
||||
txtOk = findViewById(R.id.btn_share_title);
|
||||
|
||||
mBackImage = findViewById(R.id.btn_back);
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
txtOk.setOnClickListener(this);
|
||||
mBackImage.setOnClickListener(this);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.btn_share_title) {
|
||||
|
||||
if (id == R.id.btn_back) {
|
||||
sendShareReceiver();
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setOnOkClickListener(View.OnClickListener onOkClickListener) {
|
||||
|
||||
/**
|
||||
* 发送广播
|
||||
*/
|
||||
private void sendShareReceiver() {
|
||||
Logger.d("liyz", "LaucherShareDialog sendShareReceiver ---->");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.zhidao.roadcondition.share");
|
||||
intent.putExtra("type", "1");
|
||||
mContext.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
|
||||
public void setOnCancelListener(View.OnClickListener onCancelListener) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:background="@color/color_545362"
|
||||
android:layout_width="1980dp"
|
||||
android:layout_height="1080dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_share_title"
|
||||
@@ -11,13 +11,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:layout_marginBottom="@dimen/dp_35"
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="我要分享"
|
||||
android:textColor="@color/color_1F7FFF"
|
||||
android:textSize="@dimen/dp_20" />
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_30" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_65"
|
||||
android:src="@mipmap/share_back_image" />
|
||||
android:src="@drawable/main_video_play_btn_normal" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
18
modules/mogo-module-share/src/main/res/values/colors.xml
Normal file
18
modules/mogo-module-share/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#000000</color>
|
||||
<color name="colorPrimaryDark">#000000</color>
|
||||
<color name="colorAccent">#1F7FFF</color>
|
||||
|
||||
<color name="red_tips">#FF1B1B</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="white_50">#80FFFFFF</color>
|
||||
<color name="color_F8F8F8">#F8F8F8</color>
|
||||
<color name="color_3">#333333</color>
|
||||
<color name="color_DADAE2">#DADAE2</color>
|
||||
<color name="color_545362">#545362</color>
|
||||
<color name="color_191C25">#99191C25</color>
|
||||
<color name="color_666666">#666666</color>
|
||||
<color name="color_999999">#999999</color>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">share</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.example.mogo_module_share
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,6 @@ import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.tanlu.callback.AlongTheWayCallback;
|
||||
import com.mogo.module.tanlu.callback.RoadLineCallback;
|
||||
import com.mogo.module.tanlu.callback.VoiceSearchCallback;
|
||||
import com.mogo.module.tanlu.constant.HttpConst;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.module.tanlu.model.Information;
|
||||
import com.mogo.module.tanlu.model.InformationAndLiveCarResult;
|
||||
@@ -59,8 +58,6 @@ import com.mogo.module.tanlu.video.FullMediaActivity;
|
||||
import com.mogo.module.tanlu.video.SimpleCoverVideoPlayer;
|
||||
import com.mogo.module.tanlu.view.AutoZoomInImageView;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
@@ -265,6 +262,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
if (markerExploreWayList.size() > currentPosition && currentPosition >= 0) {
|
||||
handleData(markerExploreWayList.get(currentPosition));
|
||||
}
|
||||
|
||||
} else if (id == R.id.tv_next_res) { //下一个
|
||||
//判断是图片还是视频,最后一个时,下一个不可点击
|
||||
Logger.d(TAG, " tv_next_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
|
||||
@@ -309,7 +307,14 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
MarkerExploreWay exploreWay = (MarkerExploreWay) marker.getObject();
|
||||
handleData(exploreWay);
|
||||
|
||||
//TODO 更新位置currentPosition
|
||||
//更新位置currentPosition
|
||||
for (int i = 0; i < markerExploreWayList.size(); i++) {
|
||||
if (markerExploreWayList.get(i).getAddr().equals(exploreWay.getAddr())) {
|
||||
currentPosition = i;
|
||||
break;
|
||||
}
|
||||
Logger.d(TAG, "onMarkerClicked currentPosition = " + currentPosition);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -409,7 +414,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
public void onPerform() {
|
||||
Logger.d(TAG, "tanlu卡片 有效 ---->");
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getActivity());
|
||||
List<IMogoMarker> markers = mMarkerManager.getMarkers("CARD_TYPE_ROAD_CODITION");
|
||||
List<IMogoMarker> markers = mMarkerManager.getMarkers("CARD_TYPE_ROAD_CONDITION");
|
||||
if (markers != null && markers.size() > 0) {
|
||||
mEmptyLayout.setVisibility(View.GONE);
|
||||
mRootLayout.setVisibility(View.VISIBLE);
|
||||
@@ -457,7 +462,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
Logger.d(TAG, "地图加载事件");
|
||||
// Logger.d(TAG, "地图加载事件");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -543,17 +548,17 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon(mMarkerIcon)
|
||||
.latitude(event.lat)
|
||||
.owner("tag")
|
||||
.owner(TanluConstants.MODEL_NAME)
|
||||
.longitude(event.lon);
|
||||
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getContext());
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getContext());
|
||||
IMogoMarker marker = mMarkerManager.addMarker("tag", options);
|
||||
IMogoMarker marker = mMarkerManager.addMarker(TanluConstants.MODEL_NAME, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
Logger.e(TAG, "onMarkerInfo onFailure -----E->" + e);
|
||||
Logger.e(TAG, "onMarkerInfo onFailure -----e =" + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class TanluCardViewProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return "CARD_TYPE_ROAD_CODITION";
|
||||
return "CARD_TYPE_ROAD_CONDITION";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ include ':modules:mogo-module-common'
|
||||
include ':modules:mogo-module-main'
|
||||
include ':modules:mogo-module-search'
|
||||
include ':modules:mogo-module-tanlu'
|
||||
include ':modules:mogo-module-share'
|
||||
include ':modules:mogo-module-service'
|
||||
include ':libraries:map-amap'
|
||||
//include ':libraries:map-baidu'
|
||||
|
||||
Reference in New Issue
Block a user