diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 1a786d501e..26618df6e9 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -25,6 +25,7 @@
+
diff --git a/build.gradle b/build.gradle
index 93aead74f5..fe76aac9ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -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 {
}
}
-}
\ No newline at end of file
+}
diff --git a/config.gradle b/config.gradle
index 8eb80a6f88..46b9fc53fc 100644
--- a/config.gradle
+++ b/config.gradle
@@ -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}",
diff --git a/gradle.properties b/gradle.properties
index 63b2f24080..c2bc11e8c9 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -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
diff --git a/modules/mogo-module-extensions/build.gradle b/modules/mogo-module-extensions/build.gradle
index 8b4348232b..7ec6c89d89 100644
--- a/modules/mogo-module-extensions/build.gradle
+++ b/modules/mogo-module-extensions/build.gradle
@@ -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')
}
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
index 6f71bdd720..f352cdd9cf 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
@@ -28,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;
@@ -106,6 +108,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
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 );
diff --git a/modules/mogo-module-share/.gitignore b/modules/mogo-module-share/.gitignore
new file mode 100644
index 0000000000..796b96d1c4
--- /dev/null
+++ b/modules/mogo-module-share/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/modules/mogo-module-share/build.gradle b/modules/mogo-module-share/build.gradle
new file mode 100644
index 0000000000..5fee9fa316
--- /dev/null
+++ b/modules/mogo-module-share/build.gradle
@@ -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()
+}
diff --git a/modules/mogo-module-share/consumer-rules.pro b/modules/mogo-module-share/consumer-rules.pro
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/modules/mogo-module-share/gradle.properties b/modules/mogo-module-share/gradle.properties
new file mode 100644
index 0000000000..ae56b543b4
--- /dev/null
+++ b/modules/mogo-module-share/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-share
+VERSION_CODE=1
diff --git a/modules/mogo-module-share/proguard-rules.pro b/modules/mogo-module-share/proguard-rules.pro
new file mode 100644
index 0000000000..f1b424510d
--- /dev/null
+++ b/modules/mogo-module-share/proguard-rules.pro
@@ -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
diff --git a/modules/mogo-module-share/src/androidTest/java/com/example/mogo_module_share/ExampleInstrumentedTest.kt b/modules/mogo-module-share/src/androidTest/java/com/example/mogo_module_share/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000000..4d8f4c5680
--- /dev/null
+++ b/modules/mogo-module-share/src/androidTest/java/com/example/mogo_module_share/ExampleInstrumentedTest.kt
@@ -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)
+ }
+}
diff --git a/modules/mogo-module-share/src/main/AndroidManifest.xml b/modules/mogo-module-share/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..82aba71bd0
--- /dev/null
+++ b/modules/mogo-module-share/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/IShareControl.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/IShareControl.java
new file mode 100644
index 0000000000..76d27221e9
--- /dev/null
+++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/IShareControl.java
@@ -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();
+}
diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java
new file mode 100644
index 0000000000..5d09b0d770
--- /dev/null
+++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java
@@ -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() {
+
+ }
+}
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/view/LaucherShareDialog.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java
similarity index 57%
rename from modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/view/LaucherShareDialog.java
rename to modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java
index 71bd9a1c8d..4d3ad002d3 100644
--- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/view/LaucherShareDialog.java
+++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java
@@ -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) {
-
- }
-
}
diff --git a/modules/mogo-module-share/src/main/res/drawable-xhdpi/main_video_play_btn_normal.png b/modules/mogo-module-share/src/main/res/drawable-xhdpi/main_video_play_btn_normal.png
new file mode 100644
index 0000000000..7db2e805ee
Binary files /dev/null and b/modules/mogo-module-share/src/main/res/drawable-xhdpi/main_video_play_btn_normal.png differ
diff --git a/modules/mogo-module-tanlu/src/main/res/layout/launcher_dialog_share.xml b/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share.xml
similarity index 72%
rename from modules/mogo-module-tanlu/src/main/res/layout/launcher_dialog_share.xml
rename to modules/mogo-module-share/src/main/res/layout/launcher_dialog_share.xml
index 3bef28759b..0e191c8292 100644
--- a/modules/mogo-module-tanlu/src/main/res/layout/launcher_dialog_share.xml
+++ b/modules/mogo-module-share/src/main/res/layout/launcher_dialog_share.xml
@@ -1,9 +1,9 @@
+ android:background="@color/color_545362"
+ android:layout_width="1980dp"
+ android:layout_height="1080dp">
+ android:textColor="@color/white"
+ android:textSize="@dimen/dp_30" />
+ android:src="@drawable/main_video_play_btn_normal" />
diff --git a/modules/mogo-module-share/src/main/res/values/colors.xml b/modules/mogo-module-share/src/main/res/values/colors.xml
new file mode 100644
index 0000000000..0081f334bf
--- /dev/null
+++ b/modules/mogo-module-share/src/main/res/values/colors.xml
@@ -0,0 +1,18 @@
+
+
+ #000000
+ #000000
+ #1F7FFF
+
+ #FF1B1B
+ #FFFFFF
+ #80FFFFFF
+ #F8F8F8
+ #333333
+ #DADAE2
+ #545362
+ #99191C25
+ #666666
+ #999999
+
+
diff --git a/modules/mogo-module-share/src/main/res/values/strings.xml b/modules/mogo-module-share/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..94c5463011
--- /dev/null
+++ b/modules/mogo-module-share/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ share
+
diff --git a/modules/mogo-module-share/src/test/java/com/example/mogo_module_share/ExampleUnitTest.kt b/modules/mogo-module-share/src/test/java/com/example/mogo_module_share/ExampleUnitTest.kt
new file mode 100644
index 0000000000..5f9bdcdccd
--- /dev/null
+++ b/modules/mogo-module-share/src/test/java/com/example/mogo_module_share/ExampleUnitTest.kt
@@ -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)
+ }
+}
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java
index 4ac2760951..cf785b7158 100644
--- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java
@@ -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>
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>
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;
}
@@ -457,7 +462,7 @@ public class TanluCardViewFragment extends MvpFragment>
@Override
public void onMapLoaded() {
- Logger.d(TAG, "地图加载事件");
+// Logger.d(TAG, "地图加载事件");
}
@Override
@@ -543,17 +548,17 @@ public class TanluCardViewFragment extends MvpFragment>
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);
}
});
}
diff --git a/settings.gradle b/settings.gradle
index e070d5df36..b76d40d28f 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -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'