Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0' into dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0

This commit is contained in:
yangyakun
2023-03-08 17:02:59 +08:00
9 changed files with 31 additions and 33 deletions

View File

@@ -72,13 +72,17 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
}
fun setCacheImageViewVisible() {
setViewShowState(mThumbImageViewLayout, VISIBLE)
setViewShowState(mThumbImageView, VISIBLE)
if (mThumbImageViewLayout.visibility == INVISIBLE){
setViewShowState(mThumbImageViewLayout, VISIBLE)
setViewShowState(mThumbImageView, VISIBLE)
}
}
fun setCacheImageViewGone() {
setViewShowState(mThumbImageViewLayout, INVISIBLE)
setViewShowState(mThumbImageView, INVISIBLE)
if (mThumbImageViewLayout.visibility == VISIBLE){
setViewShowState(mThumbImageViewLayout, INVISIBLE)
setViewShowState(mThumbImageView, INVISIBLE)
}
}
//失去焦点声音压低

View File

@@ -2,23 +2,22 @@ package com.mogo.och.bus.passenger.ui.widget.video
import android.annotation.SuppressLint
import android.content.Context
import android.os.Environment
import android.net.Uri
import android.util.AttributeSet
import android.widget.ImageView
import android.widget.RelativeLayout
import com.alibaba.idst.nui.FileUtil
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean
import com.mogo.eagle.core.utilcode.breakpoint.callback.IDownload
import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.FileUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.bus.passenger.R
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import java.io.File
import java.io.FilenameFilter
import java.lang.Exception
/**
@@ -40,7 +39,8 @@ class AdvanceVideoView @JvmOverloads constructor(
private var mVideoDirPath: String? = ""
init {
mVideoDirPath = context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)?.absolutePath + File.separator
mVideoDirPath = context.filesDir.absolutePath+ File.separator + "video" + File.separator
// mVideoDirPath = Config.downLoadPath
initView()
}
@@ -111,12 +111,8 @@ class AdvanceVideoView @JvmOverloads constructor(
fun clearLocalErrorVideo(){
if (downloadVideoName.isNotEmpty()
&& FileUtil.isFileExist(mVideoDirPath + downloadVideoName)){
FileUtil.delete(mVideoDirPath + downloadVideoName,object: FilenameFilter{
override fun accept(dir: File?, name: String?): Boolean {
return true
}
})
&& FileUtils.isFileExists(mVideoDirPath + downloadVideoName)){
FileUtils.delete(mVideoDirPath + downloadVideoName)
}
}
@@ -139,8 +135,7 @@ class AdvanceVideoView @JvmOverloads constructor(
Logger.d(ImageAndVideoRotation.TAG,
"video local url = $mVideoDirPath$downloadVideoName"
)
var file = File(mVideoDirPath,downloadVideoName)
if (file.exists()){
if (FileUtils.isFileExists(mVideoDirPath+downloadVideoName)){
Logger.d(ImageAndVideoRotation.TAG, "have cache startPlay")
startPlay()
return
@@ -152,6 +147,7 @@ class AdvanceVideoView @JvmOverloads constructor(
private fun startDownLoadVideo(){
//下载视频, 下载成功后再播放
Logger.d(ImageAndVideoRotation.TAG, "startDownLoadVideo")
FileUtils.createFileDir(mVideoDirPath)
DownloadUtils.downLoad(context,fileNetPath,mVideoDirPath
,downloadVideoName,5,downListener)
}
@@ -160,7 +156,9 @@ class AdvanceVideoView @JvmOverloads constructor(
try {
Logger.d(ImageAndVideoRotation.TAG, "startPlay")
gsyVideoOptionBuilder = GSYVideoOptionBuilder()
gsyVideoOptionBuilder?.setUrl("file://$mVideoDirPath$downloadVideoName") // "/data/user/0/com.mogo.launcher.f/files/downloads/"
gsyVideoOptionBuilder
// ?.setUrl("file:///mnt/sdcard/downloads/$downloadVideoName")
?.setUrl(Uri.fromFile(File(mVideoDirPath+downloadVideoName)).toString()) // "/data/user/0/com.mogo.launcher.f/files/video/"
?.setPlayTag(downloadVideoName)
?.setCacheWithPlay(false)
?.setThumbPlay(false)

View File

@@ -283,7 +283,7 @@ class DriverM1Model {
object : IMogoOnMessageListener<OrderCloseMsg> {
override fun onMsgReceived(obj: OrderCloseMsg) {
//订单结束
pushOperationalToMsgBox(obj.pushTimeStamp, obj.message
pushOperationalToMsgBox(DateTimeUtil.getCurrentTimeStamp(), obj.message
,OCHSocketMessageManager.OPERATION_ORDER_TYPE)
sendMsgToClient(DPOrderClosedMsg())
queryCurrentServiceStatus()

View File

@@ -1,12 +1,10 @@
package com.mogo.och.common.module.biz.common.socketmessage.data
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.msgOperateDoorType
/**
* @author: wangmingjun
* @date: 2023/2/25
*/
data class OperateDoorMsg(
var orderNo: String,
var message: String
):DataBaseMsg(msgOperateDoorType) //{"orderNo":"","message":""}
var message: String,
var pushTimeStamp: Long = System.currentTimeMillis() // 消息下发时间戳
) //{"orderNo":"","message":""}

View File

@@ -8,5 +8,6 @@ import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManag
*/
data class OrderCloseMsg(
var orderNo: String,
var message: String
):DataBaseMsg(msgOrderClosedType) //{"orderNo":"","message":""}
var message: String,
var pushTimeStamp: Long = System.currentTimeMillis() // 消息下发时间戳
)

View File

@@ -1,13 +1,11 @@
package com.mogo.och.common.module.biz.common.socketmessage.data
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.msgMonitorType
/**
* @author: wangmingjun
* @date: 2023/2/25
*/
data class SystemMsg(
var context: String,
var screenList: MutableList<Int>
):DataBaseMsg(msgMonitorType) // {"context":"","screenList":[]} 1:司机屏 2:乘客屏
var screenList: MutableList<Int>,
var pushTimeStamp: Long = System.currentTimeMillis() // 消息下发时间戳
)

View File

@@ -94,7 +94,7 @@ object ConfigStartUp {
} else if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)){
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
} else if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)){
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
HdMapBuildConfig.currentCarVrIconRes = R.raw.m2
} else if (AppIdentityModeUtils.isCharter(FunctionBuildConfig.appIdentityMode)){
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache
}

Binary file not shown.

View File

@@ -5,7 +5,6 @@ import static com.mogo.eagle.core.utilcode.breakpoint.Config.DOWN_LOAD_TAG;
import android.util.Log;
import com.mogo.eagle.core.utilcode.breakpoint.Config;
import com.mogo.eagle.core.utilcode.breakpoint.bean.FileBean;
import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean;
import com.mogo.eagle.core.utilcode.breakpoint.callback.DownloadCallBack;
@@ -51,7 +50,7 @@ public class DownloadThread extends Thread {
int start = threadBean.getStart() + threadBean.getFinished();
connection.setRequestProperty("Range","bytes="+start+"-"+threadBean.getEnd());
//设置写入位置
File file = new File(fileBean.getFileName().contains(".zip") ? Config.downLoadObuPath : Config.downLoadPath,fileBean.getFileName());
File file = new File(fileBean.getSavePath(),fileBean.getFileName());
raf = new RandomAccessFile(file,"rwd");
raf.seek(start);
//开始下载