Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0

This commit is contained in:
wangcongtao
2020-01-10 20:05:30 +08:00
23 changed files with 257 additions and 44 deletions

1
.idea/gradle.xml generated
View File

@@ -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" />

View File

@@ -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 {
}
}
}
}

View File

@@ -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}",

View File

@@ -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

View File

@@ -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')
}
}

View File

@@ -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 );

1
modules/mogo-module-share/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View 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()
}

View File

@@ -0,0 +1,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-share
VERSION_CODE=1

View 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

View File

@@ -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)
}
}

View File

@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.share" />

View File

@@ -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();
}

View File

@@ -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() {
}
}

View File

@@ -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

View File

@@ -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>

View 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>

View File

@@ -0,0 +1,3 @@
<resources>
<string name="app_name">share</string>
</resources>

View File

@@ -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)
}
}

View File

@@ -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;
}
@@ -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);
}
});
}

View File

@@ -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'