dev
This commit is contained in:
1
modules/mogo-module-map/.gitignore
vendored
Normal file
1
modules/mogo-module-map/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
46
modules/mogo-module-map/build.gradle
Normal file
46
modules/mogo-module-map/build.gradle
Normal file
@@ -0,0 +1,46 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
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
|
||||
}
|
||||
0
modules/mogo-module-map/consumer-rules.pro
Normal file
0
modules/mogo-module-map/consumer-rules.pro
Normal file
21
modules/mogo-module-map/proguard-rules.pro
vendored
Normal file
21
modules/mogo-module-map/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
|
||||
2
modules/mogo-module-map/src/main/AndroidManifest.xml
Normal file
2
modules/mogo-module-map/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.map" />
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IUiSettings;
|
||||
import com.mogo.map.MogoMapView;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 地图图层,地图操作都在这个图层完成
|
||||
*/
|
||||
public class MapFragment extends MvpFragment< MapView, MapPresenter > implements MapView {
|
||||
|
||||
private MogoMapView mMogoMapView;
|
||||
private IMogoMap mMogoMap;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_map_fragment_map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mMogoMapView = findViewById( R.id.module_map_id_map );
|
||||
mMogoMap = mMogoMapView.getMap();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected MapPresenter createPresenter() {
|
||||
return new MapPresenter( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onCreate( savedInstanceState );
|
||||
}
|
||||
initMapView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onPause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onLowMemory();
|
||||
}
|
||||
}
|
||||
|
||||
private void initMapView() {
|
||||
if ( mMogoMap != null ) {
|
||||
IUiSettings settings = mMogoMap.getUiSettings();
|
||||
if ( settings != null ) {
|
||||
settings.setCompassEnabled( false );
|
||||
settings.setLogoEnable( false );
|
||||
settings.setMyLocationButtonEnabled( false );
|
||||
settings.setRotateGesturesEnabled( false );
|
||||
settings.setZoomControlsEnabled( false );
|
||||
settings.setScaleControlsEnabled( false );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = MogoModulePaths.PATH_MODULE_MAP )
|
||||
public class MapFragmentProvider implements IMogoModuleProvider {
|
||||
|
||||
private MapFragment mMapFragment;
|
||||
|
||||
@Override
|
||||
public Fragment createFragment( Context context, Bundle data ) {
|
||||
mMapFragment = new MapFragment();
|
||||
mMapFragment.setArguments( data );
|
||||
return mMapFragment;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return MogoModulePaths.PATH_MODULE_MAP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return IMogoModuleProvider.TYPE_FRAGMENT;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View createView( Context context ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MapPresenter extends Presenter< MapView > {
|
||||
|
||||
public MapPresenter( MapView view ) {
|
||||
super( view );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
* <p>
|
||||
* 地图view
|
||||
*/
|
||||
public interface MapView extends IView {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mogo.map.MogoMapView
|
||||
android:id="@+id/module_map_id_map"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
3
modules/mogo-module-map/src/main/res/values/strings.xml
Normal file
3
modules/mogo-module-map/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-map</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user