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