opt
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -5,7 +5,7 @@
|
|||||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||||
</configurations>
|
</configurations>
|
||||||
</component>
|
</component>
|
||||||
<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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
@@ -61,11 +61,13 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.moduledemo
|
implementation rootProject.ext.dependencies.moduledemo
|
||||||
implementation rootProject.ext.dependencies.moduledemo2
|
implementation rootProject.ext.dependencies.moduledemo2
|
||||||
implementation rootProject.ext.dependencies.modulecommon
|
implementation rootProject.ext.dependencies.modulecommon
|
||||||
|
implementation rootProject.ext.dependencies.tanlu
|
||||||
} else {
|
} else {
|
||||||
implementation project(':modules:mogo-module-main')
|
implementation project(':modules:mogo-module-main')
|
||||||
implementation project(':foudations:mogo-commons')
|
implementation project(':foudations:mogo-commons')
|
||||||
implementation project(':modules:mogo-module-common')
|
implementation project(':modules:mogo-module-common')
|
||||||
implementation project(':demo:demo-module-map')
|
implementation project(':demo:demo-module-map')
|
||||||
implementation project(':demo:demo-module-map2')
|
implementation project(':demo:demo-module-map2')
|
||||||
|
implementation project(':demo:tanlu-module')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.mogo.commons.AbsMogoApplication;
|
|||||||
import com.mogo.demo.module.map.DemoConstants;
|
import com.mogo.demo.module.map.DemoConstants;
|
||||||
import com.mogo.demo.module.map2.Demo2Constants;
|
import com.mogo.demo.module.map2.Demo2Constants;
|
||||||
import com.mogo.module.common.MogoModulePaths;
|
import com.mogo.module.common.MogoModulePaths;
|
||||||
|
import com.zhidao.tanlu.TanluConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author congtaowang
|
* @author congtaowang
|
||||||
@@ -28,5 +29,6 @@ public class MogoApplication extends AbsMogoApplication {
|
|||||||
MultiDex.install( base );
|
MultiDex.install( base );
|
||||||
MogoModulePaths.addModule( DemoConstants.TAG );
|
MogoModulePaths.addModule( DemoConstants.TAG );
|
||||||
MogoModulePaths.addModule( Demo2Constants.TAG );
|
MogoModulePaths.addModule( Demo2Constants.TAG );
|
||||||
|
MogoModulePaths.addModule( TanluConstants.TAG );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ ext {
|
|||||||
// modules
|
// modules
|
||||||
moduledemo : "com.mogo.module:module-demo:${DEMO_MODULE_MAP_VERSION}",
|
moduledemo : "com.mogo.module:module-demo:${DEMO_MODULE_MAP_VERSION}",
|
||||||
moduledemo2 : "com.mogo.module:module-demo2:${DEMO_MODULE_MAP2_VERSION}",
|
moduledemo2 : "com.mogo.module:module-demo2:${DEMO_MODULE_MAP2_VERSION}",
|
||||||
|
tanlu : "com.mogo.module:tanlu-module:${MOGO_MODULE_TANLU_VERSION}",
|
||||||
mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}",
|
mogocommons : "com.mogo.commons:mogo-commons:${MOGO_COMMONS_VERSION}",
|
||||||
mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}",
|
mogoutils : "com.mogo.commons:mogo-utils:${MOGO_UTILS_VERSION}",
|
||||||
mapamap : "com.mogo.map:map-amap:${MAP_AMAP_VERSION}",
|
mapamap : "com.mogo.map:map-amap:${MAP_AMAP_VERSION}",
|
||||||
|
|||||||
1
demo/tanlu-module/.gitignore
vendored
Normal file
1
demo/tanlu-module/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
53
demo/tanlu-module/build.gradle
Normal file
53
demo/tanlu-module/build.gradle
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
apply plugin: 'com.android.library'
|
||||||
|
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'])
|
||||||
|
|
||||||
|
if (Boolean.valueOf(RELEASE)) {
|
||||||
|
implementation rootProject.ext.dependencies.mogomap
|
||||||
|
implementation rootProject.ext.dependencies.mogoutils
|
||||||
|
implementation rootProject.ext.dependencies.mogocommons
|
||||||
|
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||||
|
implementation rootProject.ext.dependencies.modulecommon
|
||||||
|
} else {
|
||||||
|
implementation project(":libraries:mogo-map")
|
||||||
|
implementation project(":foudations:mogo-utils")
|
||||||
|
api project(":foudations:mogo-commons")
|
||||||
|
implementation project(':services:mogo-service-api')
|
||||||
|
implementation project(':modules:mogo-module-common')
|
||||||
|
}
|
||||||
|
implementation rootProject.ext.dependencies.androidxappcompat
|
||||||
|
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||||
|
implementation rootProject.ext.dependencies.arouter
|
||||||
|
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||||
|
}
|
||||||
|
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||||
|
|
||||||
0
demo/tanlu-module/consumer-rules.pro
Normal file
0
demo/tanlu-module/consumer-rules.pro
Normal file
3
demo/tanlu-module/gradle.properties
Normal file
3
demo/tanlu-module/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
GROUP=com.mogo.module
|
||||||
|
POM_ARTIFACT_ID=module-tanlu
|
||||||
|
VERSION_CODE=1
|
||||||
21
demo/tanlu-module/proguard-rules.pro
vendored
Normal file
21
demo/tanlu-module/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,27 @@
|
|||||||
|
package com.zhidao.tanlu;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class ExampleInstrumentedTest {
|
||||||
|
@Test
|
||||||
|
public void useAppContext() {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
|
|
||||||
|
assertEquals("com.zhidao.tanlu.test", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
||||||
2
demo/tanlu-module/src/main/AndroidManifest.xml
Normal file
2
demo/tanlu-module/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.zhidao.tanlu" />
|
||||||
@@ -0,0 +1,365 @@
|
|||||||
|
package com.zhidao.tanlu;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.mogo.commons.mvp.IView;
|
||||||
|
import com.mogo.commons.mvp.MvpFragment;
|
||||||
|
import com.mogo.commons.mvp.Presenter;
|
||||||
|
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.IMogoMarkerClickListener;
|
||||||
|
import com.mogo.map.marker.MogoMarkerOptions;
|
||||||
|
import com.mogo.map.model.MogoPoi;
|
||||||
|
import com.mogo.map.search.geo.MogoPoiItem;
|
||||||
|
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||||
|
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||||
|
import com.mogo.map.uicontroller.EnumMapUI;
|
||||||
|
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||||
|
import com.mogo.utils.TipToast;
|
||||||
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lixiaopeng
|
||||||
|
* @description
|
||||||
|
* @since 2020-01-02
|
||||||
|
*/
|
||||||
|
public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||||
|
implements IView,
|
||||||
|
IMogoMarkerClickListener,
|
||||||
|
IMogoModuleLifecycle,
|
||||||
|
IMogoMapListener,
|
||||||
|
IMogoPoiSearchListener,
|
||||||
|
IMogoLocationListener {
|
||||||
|
|
||||||
|
private static final String TAG = "TanluCardViewFragment";
|
||||||
|
|
||||||
|
private Button mAddMarker;
|
||||||
|
private Button mAddMarkers;
|
||||||
|
|
||||||
|
private Bitmap mMarkerIcon;
|
||||||
|
private Bitmap mClickedMarkerIcon;
|
||||||
|
private TextView mLocInfo;
|
||||||
|
private TextView mLoc;
|
||||||
|
private Button m2D3D;
|
||||||
|
private CheckBox mNaviMode;
|
||||||
|
|
||||||
|
private IMogoMarker mLastClickedMarker;
|
||||||
|
private TanluInfoWindowAdapter mDemoInfoWindowAdapter;
|
||||||
|
private MogoLocation mLocation;
|
||||||
|
|
||||||
|
private int position = -1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.tanlu_module_card_view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initViews() {
|
||||||
|
position = getArguments().getInt("position");
|
||||||
|
|
||||||
|
mNaviMode = findViewById(R.id.demo_module_id_navi_mode);
|
||||||
|
|
||||||
|
TanluServiceHandler.getPoiSearch().setPoiSearchListener(this);
|
||||||
|
mLocation = TanluServiceHandler.getLocationClient().getLastKnowLocation();
|
||||||
|
|
||||||
|
m2D3D = findViewById(R.id.demo_module_id_2d3d);
|
||||||
|
|
||||||
|
mLocInfo = findViewById(R.id.demo_module_id_loc_info);
|
||||||
|
mLoc = findViewById(R.id.demo_module_id_loc);
|
||||||
|
mLoc.setOnClickListener(
|
||||||
|
new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getLocationClient().start(4_000L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
mDemoInfoWindowAdapter = new TanluInfoWindowAdapter(getContext(), TanluServiceHandler.getNavi(), TanluServiceHandler.getImageloader());
|
||||||
|
|
||||||
|
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_poi_location);
|
||||||
|
mClickedMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_choice_point);
|
||||||
|
mAddMarker = findViewById(R.id.demo_module_id_add_marker);
|
||||||
|
mAddMarker.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||||
|
.icon(mMarkerIcon)
|
||||||
|
.latitude(39.974525d)
|
||||||
|
.owner(TanluConstants.TAG)
|
||||||
|
.longitude(116.41733d);
|
||||||
|
IMogoMarker marker = TanluServiceHandler.getMarkerManager().addMarker(TanluConstants.TAG, options);
|
||||||
|
marker.setInfoWindowAdapter(mDemoInfoWindowAdapter);
|
||||||
|
marker.setOnMarkerClickListener(TanluCardViewFragment.this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mAddMarkers = findViewById(R.id.demo_module_id_add_markers);
|
||||||
|
mAddMarkers.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
ArrayList<MogoMarkerOptions> optionsList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||||
|
.owner(TanluConstants.TAG)
|
||||||
|
.latitude(39.974525d + new Random().nextDouble())
|
||||||
|
.longitude(116.41733d + new Random().nextDouble());
|
||||||
|
if (i % 2 == 0) {
|
||||||
|
options.icon(mMarkerIcon);
|
||||||
|
} else {
|
||||||
|
options.icon(mDemoInfoWindowAdapter.getMarkerView(options));
|
||||||
|
}
|
||||||
|
optionsList.add(options);
|
||||||
|
}
|
||||||
|
List<IMogoMarker> iMogoMarkers = TanluServiceHandler.getMarkerManager().addMarkers(TanluConstants.TAG, optionsList, true);
|
||||||
|
for (IMogoMarker iMogoMarker : iMogoMarkers) {
|
||||||
|
iMogoMarker.setInfoWindowAdapter(mDemoInfoWindowAdapter);
|
||||||
|
iMogoMarker.setOnMarkerClickListener(TanluCardViewFragment.this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_clear).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMarkerManager().removeMarkers(TanluConstants.TAG);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
m2D3D.setOnClickListener(new View.OnClickListener() {
|
||||||
|
private EnumMapUI ui = EnumMapUI.NorthUP_2D;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().changeMapMode(ui = ui.next());
|
||||||
|
m2D3D.setText(ui.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_current).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().moveToCenter(new MogoLatLng(mLocation.getLatitude(), mLocation.getLongitude()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_start_navi).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getNavi().startNavi(!mNaviMode.isChecked());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_stop_navi).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getNavi().stopNavi();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_traffic).setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
private boolean enable = true;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().setTrafficEnabled(enable = !enable);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_zoom_in).setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().changeZoom(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_zoom_out).setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().changeZoom(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_day_light).setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().changeMapMode(EnumMapUI.Type_Light);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_day_night).setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().changeMapMode(EnumMapUI.Type_Night);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_display_overlay).setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().displayOverview();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.demo_module_id_reverse_lock).setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TanluServiceHandler.getMapUIController().recoverLockMode();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
TanluServiceHandler.getLocationClient().addLocationListener(new IMogoLocationListener() {
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(MogoLocation location) {
|
||||||
|
mLocation = location;
|
||||||
|
Logger.d(TAG, "demo模块定位,定位间隔4s");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
getViewLifecycleOwner().getLifecycle().addObserver(mPresenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||||
|
// if ( mLastClickedMarker != null ) {
|
||||||
|
// mLastClickedMarker.setIcon( this.mMarkerIcon );
|
||||||
|
// }
|
||||||
|
// marker.setIcon( mClickedMarkerIcon );
|
||||||
|
// mLastClickedMarker = marker;
|
||||||
|
|
||||||
|
// marker.showInfoWindow();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
protected Presenter createPresenter() {
|
||||||
|
return new Presenter(this) {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPerform() {
|
||||||
|
Logger.d(TAG, "卡片2有效");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
Logger.d(TAG, "卡片2无效");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMapLoaded() {
|
||||||
|
Logger.d(TAG, "地图加载事件");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTouch(MotionEvent motionEvent) {
|
||||||
|
// Logger.d( TAG, "地图触摸事件" );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPOIClick(MogoPoi poi) {
|
||||||
|
if (poi != null) {
|
||||||
|
TipToast.shortTip(poi.getName());
|
||||||
|
}
|
||||||
|
TanluServiceHandler.getPoiSearch().searchPOIIdAsyn(poi.getPoiId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPoiSearched(MogoPoiResult result, int errorCode) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private IMogoMarker mPoiMarker;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
|
||||||
|
if (item == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mPoiMarker != null) {
|
||||||
|
mPoiMarker.destroy();
|
||||||
|
}
|
||||||
|
mPoiMarker = TanluServiceHandler.getMarkerManager().addMarker(TanluConstants.TAG, new MogoMarkerOptions()
|
||||||
|
.longitude(item.getPoint().lng)
|
||||||
|
.latitude(item.getPoint().lat)
|
||||||
|
.icon(mMarkerIcon));
|
||||||
|
if (mPoiMarker != null) {
|
||||||
|
mPoiMarker.setInfoWindowAdapter(mDemoInfoWindowAdapter);
|
||||||
|
mPoiMarker.setObject(item);
|
||||||
|
mPoiMarker.showInfoWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(MogoLocation location) {
|
||||||
|
mLocation = location;
|
||||||
|
Logger.i(TAG, "接受到的地图模块定位信息");
|
||||||
|
if (mLocInfo != null) {
|
||||||
|
if (location.getErrCode() == 0) {
|
||||||
|
mLocInfo.setText("当前位置:" + location.getAddress());
|
||||||
|
} else {
|
||||||
|
mLocInfo.setText(location.getErrInfo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMapClick(MogoLatLng latLng) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLockMap(boolean isLock) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMapModeChanged(EnumMapUI ui) {
|
||||||
|
Logger.d(TAG, ui.name());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
Logger.w(TAG, "onDestroyView position=" + position);
|
||||||
|
super.onDestroyView();
|
||||||
|
getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter);
|
||||||
|
TanluServiceHandler.getLocationClient().removeLocationListener(this);
|
||||||
|
if (mLastClickedMarker != null) {
|
||||||
|
mLastClickedMarker.destroy();
|
||||||
|
mLastClickedMarker = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.zhidao.tanlu;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
|
import com.mogo.map.listener.IMogoMapListener;
|
||||||
|
import com.mogo.map.location.IMogoLocationListener;
|
||||||
|
import com.mogo.map.navi.IMogoNaviListener;
|
||||||
|
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||||
|
import com.mogo.service.module.IMogoModuleProvider;
|
||||||
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2019-12-24
|
||||||
|
* <p>
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
@Route( path = TanluConstants.TAG )
|
||||||
|
public class TanluCardViewProvider implements IMogoModuleProvider {
|
||||||
|
|
||||||
|
private static final String TAG = "TanluCardViewProvider";
|
||||||
|
|
||||||
|
private TanluCardViewFragment fragment;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Fragment createFragment( Context context, Bundle data ) {
|
||||||
|
fragment = new TanluCardViewFragment();
|
||||||
|
fragment.setArguments( data );
|
||||||
|
Logger.i( TAG, "createFragment" );
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init( Context context ) {
|
||||||
|
TanluServiceHandler.init( context );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getModuleName() {
|
||||||
|
return TanluConstants.TAG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IMogoModuleLifecycle getCardLifecycle() {
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View createView( Context context ) {
|
||||||
|
// don't
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IMogoMapListener getMapListener() {
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getType() {
|
||||||
|
return IMogoModuleProvider.TYPE_FRAGMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IMogoNaviListener getNaviListener() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IMogoLocationListener getLocationListener() {
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.zhidao.tanlu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2019-12-24
|
||||||
|
* <p>
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
public class TanluConstants {
|
||||||
|
|
||||||
|
public static final String TAG = "/tanlu/ui";
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package com.zhidao.tanlu;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||||
|
import com.mogo.map.marker.IMogoMarker;
|
||||||
|
import com.mogo.map.marker.MogoMarkerOptions;
|
||||||
|
import com.mogo.map.navi.IMogoNavi;
|
||||||
|
import com.mogo.map.navi.MogoNaviConfig;
|
||||||
|
import com.mogo.map.search.geo.MogoPoiItem;
|
||||||
|
import com.mogo.service.imageloader.IMogoImageLoaderListener;
|
||||||
|
import com.mogo.service.imageloader.IMogoImageloader;
|
||||||
|
import com.mogo.service.imageloader.MogoImageView;
|
||||||
|
import com.mogo.utils.WindowUtils;
|
||||||
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2019-12-24
|
||||||
|
* <p>
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
public class TanluInfoWindowAdapter implements IMogoInfoWindowAdapter {
|
||||||
|
|
||||||
|
private static final String TAG = "DemoInfoWindowAdapter";
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
private IMogoNavi mNavi;
|
||||||
|
private IMogoImageloader mImageloader;
|
||||||
|
|
||||||
|
public TanluInfoWindowAdapter(Context mContext, IMogoNavi mNavi, IMogoImageloader iMogoImageloader ) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
this.mNavi = mNavi;
|
||||||
|
this.mImageloader = iMogoImageloader;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getInfoWindow( IMogoMarker marker ) {
|
||||||
|
if ( marker.getObject() instanceof MogoPoiItem ) {
|
||||||
|
View view = LayoutInflater.from( mContext ).inflate( R.layout.tanlu_module_poi_info_window, null );
|
||||||
|
renderPoiVew( view, marker, ( ( MogoPoiItem ) marker.getObject() ) );
|
||||||
|
return view;
|
||||||
|
} else {
|
||||||
|
View view = LayoutInflater.from( mContext ).inflate( R.layout.tanlu_module_info_window, null );
|
||||||
|
renderView( view, marker );
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderView( View view, final IMogoMarker marker ) {
|
||||||
|
final TextView time = view.findViewById( R.id.demo_module_id_iw_time );
|
||||||
|
Button refresh = view.findViewById( R.id.demo_module_id_iw_refresh );
|
||||||
|
time.setText( new SimpleDateFormat( "yyyyMMdd HHMMSS" ).format( new Date() ) );
|
||||||
|
refresh.setOnClickListener( new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick( View v ) {
|
||||||
|
marker.showInfoWindow();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
Button navi2 = view.findViewById( R.id.demo_module_id_iw_navito );
|
||||||
|
navi2.setOnClickListener( new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick( View v ) {
|
||||||
|
if ( mNavi != null ) {
|
||||||
|
mNavi.naviTo( marker.getPosition(), new MogoNaviConfig() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
Button stopNavi = view.findViewById( R.id.demo_module_id_iw_navi_stop );
|
||||||
|
stopNavi.setOnClickListener( new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick( View v ) {
|
||||||
|
if ( mNavi != null ) {
|
||||||
|
mNavi.stopNavi();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderPoiVew( View view, final IMogoMarker marker, MogoPoiItem item ) {
|
||||||
|
final TextView time = view.findViewById( R.id.demo_module_id_iw_poi_title );
|
||||||
|
time.setText( item.getTitle() );
|
||||||
|
Button navi2 = view.findViewById( R.id.demo_module_id_iw_poi_navito );
|
||||||
|
navi2.setOnClickListener( new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick( View v ) {
|
||||||
|
if ( mNavi != null ) {
|
||||||
|
mNavi.naviTo( marker.getPosition(), new MogoNaviConfig() );
|
||||||
|
}
|
||||||
|
marker.hideInfoWindow();
|
||||||
|
marker.remove();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
public View getMarkerView( final MogoMarkerOptions options ) {
|
||||||
|
final View view = LayoutInflater.from( mContext ).inflate( R.layout.tanlu_module_bubble_marker, null );
|
||||||
|
final MogoImageView icon = view.findViewById( R.id.icon );
|
||||||
|
mImageloader.displayImage( "http://imgnews.gmw.cn/attachement/jpg/site2/20191229/00d86176ed0b1f71f4580f.jpg", icon, WindowUtils.dip2px( mContext, 50 ), WindowUtils.dip2px( mContext, 50 ),
|
||||||
|
new IMogoImageLoaderListener() {
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted( Bitmap bitmap ) {
|
||||||
|
// 刷新图标
|
||||||
|
Logger.d( TAG, "loaded." );
|
||||||
|
options.icon( view );
|
||||||
|
options.notifyObservers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure( Exception e ) {
|
||||||
|
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.zhidao.tanlu;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
|
import com.mogo.map.location.IMogoLocationClient;
|
||||||
|
import com.mogo.map.marker.IMogoMarkerManager;
|
||||||
|
import com.mogo.map.navi.IMogoNavi;
|
||||||
|
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||||
|
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||||
|
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||||
|
import com.mogo.service.MogoServicePaths;
|
||||||
|
import com.mogo.service.imageloader.IMogoImageloader;
|
||||||
|
import com.mogo.service.map.IMogoMapService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author congtaowang
|
||||||
|
* @since 2019-12-30
|
||||||
|
* <p>
|
||||||
|
* 持有服务接口实例
|
||||||
|
*/
|
||||||
|
public class TanluServiceHandler {
|
||||||
|
|
||||||
|
private static IMogoMapService mMapService;
|
||||||
|
private static IMogoPoiSearch mPoiSearch;
|
||||||
|
private static IMogoLocationClient mLocationClient;
|
||||||
|
private static IMogoMarkerManager mMarkerManager;
|
||||||
|
private static IMogoNavi mNavi;
|
||||||
|
private static IMogoMapUIController mMapUIController;
|
||||||
|
private static IMogoImageloader mImageloader;
|
||||||
|
|
||||||
|
public static void init( Context context ) {
|
||||||
|
mMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( context );
|
||||||
|
mMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( context );
|
||||||
|
mImageloader = ( IMogoImageloader ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_IMAGE_LOADER ).navigation( context );
|
||||||
|
mPoiSearch = mMapService.getPoiSearch( context, new MogoPoiSearchQuery() );
|
||||||
|
mLocationClient = mMapService.getLocationClient( context );
|
||||||
|
mMarkerManager = mMapService.getMarkerManager( context );
|
||||||
|
mNavi = mMapService.getNavi( context );
|
||||||
|
mMapUIController = mMapService.getMapUIController();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoMapService getMapService() {
|
||||||
|
return mMapService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoPoiSearch getPoiSearch() {
|
||||||
|
return mPoiSearch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoLocationClient getLocationClient() {
|
||||||
|
return mLocationClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoMarkerManager getMarkerManager() {
|
||||||
|
return mMarkerManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoNavi getNavi() {
|
||||||
|
return mNavi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoMapUIController getMapUIController() {
|
||||||
|
return mMapUIController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IMogoImageloader getImageloader() {
|
||||||
|
return mImageloader;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.mogo.service.imageloader.MogoImageView
|
||||||
|
android:id="@+id/icon"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:miv_placeHolder="@drawable/ic_amap_app_main_current_location_bkg"
|
||||||
|
app:miv_shape="circle" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_search_poi_location"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/icon" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
157
demo/tanlu-module/src/main/res/layout/tanlu_module_card_view.xml
Normal file
157
demo/tanlu-module/src/main/res/layout/tanlu_module_card_view.xml
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/color_1F7FFF"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/demo_module_id_loc_info"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_add_marker"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="上一个" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_add_markers"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="下一个" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_clear"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="播放" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_loc"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="定位" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_current"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="当前位置" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_2d3d"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="2D/3D" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_traffic"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="交通态势" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_start_navi"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="开始导航" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_stop_navi"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="停止导航" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/demo_module_id_navi_mode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="模拟导航" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_zoom_in"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="放大" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_zoom_out"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="缩小" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_day_light"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="白天" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_day_night"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="黑夜" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_display_overlay"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="全览" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_reverse_lock"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="继续导航" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#ff0000">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/demo_module_id_iw_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_iw_refresh"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="点击刷新当前时间"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_iw_navito"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="70dp"
|
||||||
|
android:text="导航去这里"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_iw_navi_stop"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="120dp"
|
||||||
|
android:text="停止导航"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#ff0000">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/demo_module_id_iw_poi_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/demo_module_id_iw_poi_navito"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="70dp"
|
||||||
|
android:text="导航去这里"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
18
demo/tanlu-module/src/main/res/values/colors.xml
Normal file
18
demo/tanlu-module/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="white">#FFFFFF</color>
|
||||||
|
<color name="white_50">#80FFFFFF</color>
|
||||||
|
<color name="color_1E212C">#1E212C</color>
|
||||||
|
<color name="color_1F7FFF">#1F7FFF</color>
|
||||||
|
<color name="color_171F7FFF">#171F7FFF</color>
|
||||||
|
<color name="color_4d191C25">#4d191C25</color>
|
||||||
|
<color name="color_99191C25">#99191C25</color>
|
||||||
|
<color name="color_222533">#222533</color>
|
||||||
|
<color name="color_4B5369">#4B5369</color>
|
||||||
|
<color name="color_9A9A9A">#9A9A9A</color>
|
||||||
|
<color name="color_A2A2A2">#A2A2A2</color>
|
||||||
|
|
||||||
|
</resources>
|
||||||
3
demo/tanlu-module/src/main/res/values/strings.xml
Normal file
3
demo/tanlu-module/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">tanlu</string>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.zhidao.tanlu;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
public class ExampleUnitTest {
|
||||||
|
@Test
|
||||||
|
public void addition_isCorrect() {
|
||||||
|
assertEquals(4, 2 + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ RELEASE=false
|
|||||||
# 模块版本
|
# 模块版本
|
||||||
DEMO_MODULE_MAP_VERSION=1.0.0-SNAPSHOT
|
DEMO_MODULE_MAP_VERSION=1.0.0-SNAPSHOT
|
||||||
DEMO_MODULE_MAP2_VERSION=1.0.0-SNAPSHOT
|
DEMO_MODULE_MAP2_VERSION=1.0.0-SNAPSHOT
|
||||||
|
MOGO_MODULE_TANLU_VERSION=1.0.0-SNAPSHOT
|
||||||
MOGO_COMMONS_VERSION=1.0.0-SNAPSHOT
|
MOGO_COMMONS_VERSION=1.0.0-SNAPSHOT
|
||||||
MOGO_UTILS_VERSION=1.0.0-SNAPSHOT
|
MOGO_UTILS_VERSION=1.0.0-SNAPSHOT
|
||||||
MAP_AMAP_VERSION=1.0.0-SNAPSHOT
|
MAP_AMAP_VERSION=1.0.0-SNAPSHOT
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ android {
|
|||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
consumerProguardFiles 'consumer-rules.pro'
|
consumerProguardFiles 'consumer-rules.pro'
|
||||||
|
|
||||||
|
javaCompileOptions {
|
||||||
|
annotationProcessorOptions {
|
||||||
|
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -36,7 +43,8 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||||
implementation rootProject.ext.dependencies.arouter
|
implementation rootProject.ext.dependencies.arouter
|
||||||
implementation rootProject.ext.dependencies.room
|
implementation rootProject.ext.dependencies.room
|
||||||
implementation rootProject.ext.dependencies.roomAnnotationProcessor
|
annotationProcessor rootProject.ext.dependencies.roomAnnotationProcessor
|
||||||
implementation rootProject.ext.dependencies.roomRxjava
|
implementation rootProject.ext.dependencies.roomRxjava
|
||||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||||
|
implementation 'org.jetbrains:annotations-java5:15.0'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import com.mogo.module.navi.database.dao.POIDao;
|
|||||||
* 2019-08-15.
|
* 2019-08-15.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Database(entities = { POIInfo.class}, version = 1)
|
@Database(entities = { POIInfo.class}, version = 1, exportSchema = false)
|
||||||
public abstract class AppDataBase extends RoomDatabase {
|
public abstract class AppDataBase extends RoomDatabase {
|
||||||
public abstract POIDao poiDao();
|
public abstract POIDao poiDao();
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.mogo.module.navi.database.bean;
|
|||||||
|
|
||||||
import androidx.room.Entity;
|
import androidx.room.Entity;
|
||||||
import androidx.room.PrimaryKey;
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ include ':modules:mogo-module-main'
|
|||||||
include ':modules:mogo-module-navi'
|
include ':modules:mogo-module-navi'
|
||||||
include ':demo:demo-module-map'
|
include ':demo:demo-module-map'
|
||||||
include ':demo:demo-module-map2'
|
include ':demo:demo-module-map2'
|
||||||
|
include ':demo:tanlu-module'
|
||||||
include ':libraries:map-amap'
|
include ':libraries:map-amap'
|
||||||
//include ':libraries:map-baidu'
|
//include ':libraries:map-baidu'
|
||||||
include ':libraries:mogo-map-api'
|
include ':libraries:mogo-map-api'
|
||||||
|
|||||||
@@ -12,4 +12,5 @@
|
|||||||
./gradlew :demo:demo-module-map:clean :demo:demo-module-map:uploadArchives
|
./gradlew :demo:demo-module-map:clean :demo:demo-module-map:uploadArchives
|
||||||
./gradlew :demo:demo-module-map2:clean :demo:demo-module-map2:uploadArchives
|
./gradlew :demo:demo-module-map2:clean :demo:demo-module-map2:uploadArchives
|
||||||
./gradlew :modules:mogo-module-apps:clean :modules:mogo-module-apps:uploadArchives
|
./gradlew :modules:mogo-module-apps:clean :modules:mogo-module-apps:uploadArchives
|
||||||
./gradlew :modules:mogo-module-main:clean :modules:mogo-module-main:uploadArchives
|
./gradlew :modules:mogo-module-main:clean :modules:mogo-module-main:uploadArchives
|
||||||
|
./gradlew :demo:tanlu-module:clean :demo:tanlu-module:uploadArchives
|
||||||
Reference in New Issue
Block a user