Merge branch 'master' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher
# Conflicts: # gradle.properties # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java # modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java # modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
1
modules/mogo-module-left-panel/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
58
modules/mogo-module-left-panel/build.gradle
Normal file
@@ -0,0 +1,58 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
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")
|
||||
|
||||
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'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
targetCompatibility 1.8
|
||||
sourceCompatibility 1.8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
compileOnly rootProject.ext.dependencies.modulecommon
|
||||
} else {
|
||||
compileOnly project(':modules:mogo-module-common')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
2
modules/mogo-module-left-panel/consumer-rules.pro
Normal file
@@ -0,0 +1,2 @@
|
||||
#-----ModuleLeftPanel-----
|
||||
-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst
|
||||
3
modules/mogo-module-left-panel/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-left-panel
|
||||
VERSION_CODE=1
|
||||
24
modules/mogo-module-left-panel/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# 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
|
||||
|
||||
#-----ModuleLeftPanel-----
|
||||
-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst
|
||||
@@ -0,0 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.left.panel">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.zhidao.mogo.module.left.panel
|
||||
|
||||
object LeftPanelConst {
|
||||
const val MODULE_NAME = "MODULE_LEFT_PANEL"
|
||||
const val PATH_NAME = "/left/panel"
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.zhidao.mogo.module.left.panel
|
||||
|
||||
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.location.MogoLocation
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener
|
||||
import com.mogo.map.navi.IMogoNaviListener
|
||||
import com.mogo.service.module.IMogoModuleLifecycle
|
||||
import com.mogo.service.module.IMogoModuleProvider
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst.MODULE_NAME
|
||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst.PATH_NAME
|
||||
import com.zhidao.mogo.module.left.panel.fragment.SimpleSpeedFragment
|
||||
|
||||
|
||||
/**
|
||||
* 适配1+16增加的位于左侧的面板页provider
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = PATH_NAME)
|
||||
class LeftPanelProvider:IMogoModuleProvider {
|
||||
override fun getNaviListener(): IMogoNaviListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getLocationListener(): IMogoLocationListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getType(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun getMarkerClickListener(): IMogoMarkerClickListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
Logger.d(MODULE_NAME, "左侧面板模块初始化===")
|
||||
}
|
||||
|
||||
override fun getMapListener(): IMogoMapListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getAppPackage(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun createView(context: Context?): View? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
|
||||
return SimpleSpeedFragment()
|
||||
}
|
||||
|
||||
override fun getModuleName(): String {
|
||||
return MODULE_NAME
|
||||
}
|
||||
|
||||
override fun getAppName(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun getCardLifecycle(): IMogoModuleLifecycle? {
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.zhidao.mogo.module.left.panel.fragment
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.zhidao.mogo.module.left.panel.R
|
||||
import com.zhidao.mogo.module.left.panel.presenter.SimpleSpeedPresenter
|
||||
import kotlinx.android.synthetic.main.module_left_panel_simple_speed.*
|
||||
|
||||
/**
|
||||
* 临时车速界面的fragment
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
private const val SPEED_THRESHOLD = 90
|
||||
class SimpleSpeedFragment: MvpFragment<SimpleSpeedFragment, SimpleSpeedPresenter>() {
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_left_panel_simple_speed
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
}
|
||||
|
||||
override fun createPresenter(): SimpleSpeedPresenter {
|
||||
return SimpleSpeedPresenter(this)
|
||||
}
|
||||
|
||||
fun refreshSpeed(speed: Int) {
|
||||
tvModuleLeftPanelSpeed?.let {
|
||||
it.text = speed.toString()
|
||||
if (speed >= SPEED_THRESHOLD) {
|
||||
// 速度超过90,需要改变背景颜色
|
||||
it.setBackgroundResource(R.drawable.module_left_panel_warn_speed_bg)
|
||||
}else{
|
||||
it.setBackgroundResource(R.drawable.module_left_panel_normal_speed_bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zhidao.mogo.module.left.panel.presenter
|
||||
|
||||
import android.os.Handler
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst.MODULE_NAME
|
||||
import com.zhidao.mogo.module.left.panel.fragment.SimpleSpeedFragment
|
||||
|
||||
/**
|
||||
* 临时左侧车速逻辑的presenter
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class SimpleSpeedPresenter(view: SimpleSpeedFragment) : Presenter<SimpleSpeedFragment>(view) {
|
||||
private val handler = Handler()
|
||||
private var mogoApis: IMogoServiceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(view.context) as IMogoServiceApis
|
||||
init {
|
||||
// 注册相关回调,监测速度变化
|
||||
mogoApis.registerCenterApi.registerMogoLocationListener(MODULE_NAME) {
|
||||
handler.post {
|
||||
mView.refreshSpeed((it.speed * 3.6).toInt())
|
||||
}
|
||||
}
|
||||
|
||||
// mogoApis.registerCenterApi.registerCarLocationChangedListener(MODULE_NAME,object : IMogoCarLocationChangedListener2{
|
||||
// override fun onCarLocationChanged2(latLng: Location?) {
|
||||
// latLng?.let {
|
||||
// handler.post {
|
||||
// mView.refreshSpeed(it.speed.toInt())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// override fun onCarLocationChanged(latLng: MogoLatLng?) {
|
||||
// }
|
||||
//
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 421 KiB |
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,44 @@
|
||||
<?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"
|
||||
android:clickable="true"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivContainerBg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/module_left_panel_speed_container_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/tvModuleLeftPanelSpeed"
|
||||
android:text="0"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/module_left_panel_simple_speed_text_size"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivContainerBg"
|
||||
app:layout_constraintRight_toRightOf="@id/ivContainerBg"
|
||||
app:layout_constraintTop_toTopOf="@id/ivContainerBg"
|
||||
android:layout_marginTop="@dimen/module_left_panel_simple_speed_text_margin_top"
|
||||
android:textColor="#fff"
|
||||
android:background="@drawable/module_left_panel_normal_speed_bg" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="当前车速"
|
||||
android:textColor="#fff"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvModuleLeftPanelSpeed"
|
||||
app:layout_constraintRight_toRightOf="@id/tvModuleLeftPanelSpeed"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvModuleLeftPanelSpeed"
|
||||
android:layout_marginTop="@dimen/module_left_panel_simple_speed_title_margin"
|
||||
android:textSize="@dimen/module_left_panel_simple_speed_title_size" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_left_panel_simple_speed_text_size">122px</dimen>
|
||||
<dimen name="module_left_panel_simple_speed_text_margin_top">130px</dimen>
|
||||
<dimen name="module_left_panel_simple_speed_title_size">30px</dimen>
|
||||
<dimen name="module_left_panel_simple_speed_title_margin">53px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_left_panel_simple_speed_text_size">80px</dimen>
|
||||
<dimen name="module_left_panel_simple_speed_text_margin_top">69.6px</dimen>
|
||||
<dimen name="module_left_panel_simple_speed_title_size">20px</dimen>
|
||||
<dimen name="module_left_panel_simple_speed_title_margin">28px</dimen>
|
||||
|
||||
</resources>
|
||||