[6.5.0]
[fea] 页面变更
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
android:id="@+id/module_och_taxi_order_status_station_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
|
||||
android:paddingLeft="40dp"
|
||||
android:paddingRight="40dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/module_och_taxi_order_server_status_tv">
|
||||
|
||||
@@ -91,7 +91,6 @@ object TaxiPassengerModel {
|
||||
*/
|
||||
fun release() {
|
||||
startOrStopOrderLoop(false)
|
||||
//startOrStopQueryOrderRemaining(false)
|
||||
releaseListeners()
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ import android.view.View
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -25,7 +23,6 @@ import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter
|
||||
import com.mogo.och.taxi.passenger.ui.arrived.ArrivedView
|
||||
import com.mogo.och.taxi.passenger.ui.bar.LeftBarView
|
||||
import com.mogo.och.taxi.passenger.ui.bottom.BottomBar
|
||||
import com.mogo.och.taxi.passenger.ui.checkstartautopilot.ChekAndStartAutopilotView
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
|
||||
|
||||
<color name="taxi_p_76D7FF">#76D7FF</color>
|
||||
<color name="taxi_p_255BAA">#255BAA</color>
|
||||
<color name="taxi_p_80F8FF">#80F8FF</color>
|
||||
<color name="taxi_p_A0B3DA">#A0B3DA</color>
|
||||
|
||||
@@ -16,9 +16,9 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_right_rear_cam.view.actv_cam_position_group
|
||||
import kotlinx.android.synthetic.main.taxi_p_right_rear_cam.view.v_video_right_rear
|
||||
import com.mogo.och.taxi.passenger.common.R
|
||||
import kotlinx.android.synthetic.main.taxt_p_right_rear_cam.view.actv_cam_position_group
|
||||
import kotlinx.android.synthetic.main.taxt_p_right_rear_cam.view.v_video_right_rear
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -43,7 +43,7 @@ class RightRearCamView : ConstraintLayout , IMoGoBackCameraVideoListener,
|
||||
|
||||
private fun initView() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_right_rear_cam, this, true)
|
||||
LayoutInflater.from(context).inflate(R.layout.taxt_p_right_rear_cam, this, true)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
@@ -51,7 +51,7 @@ class RightRearCamView : ConstraintLayout , IMoGoBackCameraVideoListener,
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
super.onDetachedFromWindow()
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
@@ -84,7 +84,7 @@ class RightRearCamView : ConstraintLayout , IMoGoBackCameraVideoListener,
|
||||
|
||||
fun resetView(){
|
||||
actv_cam_position_group.visibility = GONE
|
||||
v_video_right_rear.setImageResource(R.drawable.taxi_p_right_rear_cam)
|
||||
v_video_right_rear.setImageResource(R.drawable.taxt_p_right_rear_cam)
|
||||
}
|
||||
|
||||
override fun onBackCameraVideo(data: ByteArray) {
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
@@ -10,13 +10,13 @@
|
||||
android:id="@+id/v_video_right_rear"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:src="@drawable/taxi_p_right_rear_cam"
|
||||
android:src="@drawable/taxt_p_right_rear_cam"
|
||||
android:layout_width="@dimen/dp_900"
|
||||
android:layout_height="@dimen/dp_506"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/actv_cam_position"
|
||||
android:src="@drawable/taxi_p_arrived_glide"
|
||||
android:src="@drawable/taxt_p_arrived_glide"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_318"
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:text="后向摄像头"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textColor="@color/taxi_p_76D7FF"
|
||||
android:textColor="@color/taxi_cp_76D7FF"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
@@ -15,5 +15,6 @@
|
||||
<color name="taxi_cp_374968">#374968</color>
|
||||
<color name="taxi_cp_131415">#131415</color>
|
||||
<color name="taxi_cp_80FFFFFF">#80FFFFFF</color>
|
||||
<color name="taxi_cp_76D7FF">#76D7FF</color>
|
||||
|
||||
</resources>
|
||||
@@ -1,172 +0,0 @@
|
||||
package com.mogo.och.unmanned.passenger.ui.arrived
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoBackCameraVideoListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoRoboBusJinlvM1StitchedVideoListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerBackCameraVideoListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerRoboBusJinlvM1StitchedVideoListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.unmanned.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_right_rear_cam.view.actv_cam_position_group
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_right_rear_cam.view.v_video_right_rear
|
||||
|
||||
/**
|
||||
*
|
||||
* 评价View
|
||||
* Created on 2022/5/16
|
||||
*/
|
||||
class RightRearCamView : ConstraintLayout , IMoGoBackCameraVideoListener,
|
||||
IMoGoRoboBusJinlvM1StitchedVideoListener,Runnable {
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
private var mBitmap: Bitmap? = null
|
||||
|
||||
private var mBitmapOptions: BitmapFactory.Options? = null //Bitmap管理类,可有效减少Bitmap的OOM问题
|
||||
|
||||
|
||||
private fun initView() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
LayoutInflater.from(context).inflate(R.layout.taxt_u_p_right_rear_cam, this, true)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
d(SceneConstant.M_TAXI_P + TAG, "展示--可见")
|
||||
CallerAutoPilotControlManager.setIsSubscribeBackCameraVideoVideo(1, true)
|
||||
CallerBackCameraVideoListenerManager.addListener(TAG, this)
|
||||
CallerRoboBusJinlvM1StitchedVideoListenerManager.addListener(TAG, this)
|
||||
}else{
|
||||
d(SceneConstant.M_TAXI_P + TAG, "展示--不可见")
|
||||
CallerAutoPilotControlManager.setIsSubscribeBackCameraVideoVideo(1, false)
|
||||
CallerBackCameraVideoListenerManager.removeListener(this)
|
||||
CallerRoboBusJinlvM1StitchedVideoListenerManager.removeListener(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
const val TAG = "RightRearCamView"
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
fun resetView(){
|
||||
actv_cam_position_group.visibility = GONE
|
||||
v_video_right_rear.setImageResource(R.drawable.taxt_u_p_right_rear_cam)
|
||||
}
|
||||
|
||||
override fun onBackCameraVideo(data: ByteArray) {
|
||||
decodeData(data)
|
||||
}
|
||||
|
||||
override fun onRoboBusJinlvM1StitchedVideo(data: ByteArray) {
|
||||
decodeData(data)
|
||||
}
|
||||
|
||||
var preTime :Long=System.currentTimeMillis()
|
||||
|
||||
@Synchronized
|
||||
private fun decodeData(data: ByteArray){
|
||||
val currentTimeMillis = System.currentTimeMillis()
|
||||
val dexTime = currentTimeMillis - preTime
|
||||
preTime = currentTimeMillis
|
||||
if(dexTime<20){
|
||||
return
|
||||
}
|
||||
d(SceneConstant.M_TAXI_P + TAG, "图片频率:$dexTime")
|
||||
if (mBitmapOptions == null) {
|
||||
val bmp = (v_video_right_rear.drawable as BitmapDrawable).bitmap
|
||||
val width = bmp.width
|
||||
val height = bmp.height
|
||||
val config = bmp.config
|
||||
mBitmap = Bitmap.createBitmap(width, height, config)
|
||||
mBitmapOptions = BitmapFactory.Options()
|
||||
//设置Bitmap内存复用
|
||||
mBitmapOptions!!.inBitmap = mBitmap //Bitmap复用内存块,类似对象池,避免不必要的内存分配和回收
|
||||
mBitmapOptions!!.inMutable = true //解码时返回可变Bitmap
|
||||
|
||||
val options = BitmapFactory.Options()
|
||||
options.inJustDecodeBounds = true
|
||||
BitmapFactory.decodeByteArray(data, 0, data.size, options)
|
||||
mBitmapOptions!!.inSampleSize = calculateInSampleSize(options, width, height)
|
||||
}
|
||||
mBitmapOptions?.let {
|
||||
try {
|
||||
val preTime = System.currentTimeMillis()
|
||||
BitmapFactory.decodeByteArray(data, 0, data.size, mBitmapOptions)
|
||||
d(SceneConstant.M_TAXI_P + TAG, "decode时间:${System.currentTimeMillis()-preTime}")
|
||||
UiThreadHandler.post(this)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun calculateInSampleSize(options: BitmapFactory.Options, reqWidth: Int, reqHeight: Int): Int {
|
||||
val width = options.outWidth
|
||||
val height = options.outHeight
|
||||
d(SceneConstant.M_TAXI_P + TAG, "calculateInSampleSize: out width and height is $width height $height")
|
||||
var inSampleWidth = 1
|
||||
if (height > reqHeight || width > reqWidth) {
|
||||
val halfHeight = height / 2
|
||||
val halfWidth = width / 2
|
||||
// 采样率设置为2的指数
|
||||
while (halfHeight / inSampleWidth >= reqHeight && halfWidth / inSampleWidth >= reqWidth) {
|
||||
inSampleWidth *= 2
|
||||
}
|
||||
}
|
||||
|
||||
while (width/inSampleWidth>reqWidth||height/inSampleWidth>reqHeight){
|
||||
inSampleWidth++
|
||||
}
|
||||
|
||||
return inSampleWidth
|
||||
}
|
||||
|
||||
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
outlineProvider = TextureVideoViewOutlineProvider(36f)
|
||||
clipToOutline = true
|
||||
}
|
||||
|
||||
override fun run() {
|
||||
if(actv_cam_position_group?.visibility == GONE) {
|
||||
actv_cam_position_group?.visibility = VISIBLE
|
||||
}
|
||||
v_video_right_rear?.setImageBitmap(mBitmap)
|
||||
v_video_right_rear?.scaleX = -1f
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 71 KiB |
@@ -50,7 +50,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.arrived.RightRearCamView
|
||||
<com.mogo.och.taxi.passenger.ui.arrived.RightRearCamView
|
||||
android:id="@+id/v_video_right_rear_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_900"
|
||||
android:layout_height="@dimen/dp_506"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/v_video_right_rear"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:src="@drawable/taxt_u_p_right_rear_cam"
|
||||
android:layout_width="@dimen/dp_900"
|
||||
android:layout_height="@dimen/dp_506"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/actv_cam_position"
|
||||
android:src="@drawable/taxt_u_p_arrived_glide"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_318"
|
||||
android:layout_height="@dimen/dp_77"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_cam_position_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_44"
|
||||
android:layout_marginBottom="@dimen/dp_11"
|
||||
android:text="后向摄像头"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textColor="@color/taxi_p_76D7FF"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/actv_cam_position_group"
|
||||
app:constraint_referenced_ids="actv_cam_position,actv_cam_position_title"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</merge>
|
||||
@@ -42,7 +42,6 @@
|
||||
<color name="taxi_p_2CBFFC">#2CBFFC</color>
|
||||
<color name="taxi_p_1060ff">#1060ff</color>
|
||||
<color name="taxi_p_96a5c2">#96a5c2</color>
|
||||
<color name="taxi_p_76D7FF">#76D7FF</color>
|
||||
<color name="taxi_p_255BAA">#255BAA</color>
|
||||
<color name="taxi_p_80F8FF">#80F8FF</color>
|
||||
<color name="taxi_p_464646">#464646</color>
|
||||
|
||||
Reference in New Issue
Block a user