[M2]默认图片展示逻辑处理

This commit is contained in:
wangmingjun
2023-03-13 18:05:58 +08:00
parent 561d8e77e0
commit cd7a15ad42
2 changed files with 11 additions and 9 deletions

View File

@@ -61,8 +61,8 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
setViewShowState(mBackButton, INVISIBLE)
setViewShowState(mStartButton, INVISIBLE)
// setViewShowState(mThumbImageViewLayout, VISIBLE)
// setViewShowState(mThumbImageView, VISIBLE)
setViewShowState(mThumbImageViewLayout, INVISIBLE)
setViewShowState(mThumbImageView, INVISIBLE)
setViewShowState(mTopContainer, INVISIBLE)

View File

@@ -6,8 +6,6 @@ import android.net.Uri
import android.util.AttributeSet
import android.widget.ImageView
import android.widget.RelativeLayout
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
@@ -18,7 +16,6 @@ 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.lang.Exception
/**
* @author: wangmingjun
@@ -45,13 +42,14 @@ class AdvanceVideoView @JvmOverloads constructor(
}
private fun initView() {
initCacheImgView()
initVideoView()
initCacheImgView()
}
private fun initCacheImgView() {
cacheImage = ImageView(context)
cacheImage?.scaleType = ImageView.ScaleType.FIT_XY
addView(cacheImage, LayoutParams(-1, -1))
}
private fun initVideoView() {
@@ -103,7 +101,7 @@ class AdvanceVideoView @JvmOverloads constructor(
// )
// .into(it)
// }
videoViewPlayer?.thumbImageView = cacheImage
// videoViewPlayer?.thumbImageView = cacheImage
setCacheImageViewVisible()
// }
// }
@@ -118,11 +116,13 @@ class AdvanceVideoView @JvmOverloads constructor(
@SuppressLint("CheckResult")
fun setCacheImageViewVisible() {
videoViewPlayer?.setCacheImageViewVisible()
// videoViewPlayer?.setCacheImageViewVisible()
cacheImage?.visibility = VISIBLE
}
fun setCacheImageViewGone() {
videoViewPlayer?.setCacheImageViewGone()
cacheImage?.visibility = GONE
// videoViewPlayer?.setCacheImageViewGone()
// videoViewPlayer?.clearThumbImageView()
}
@@ -191,6 +191,7 @@ class AdvanceVideoView @JvmOverloads constructor(
private val downListener = object : IDownload{
override fun onStart(url: String?) {
setCacheImageViewVisible()
Logger.d(ImageAndVideoRotation.TAG, "download-onStart")
}
@@ -207,6 +208,7 @@ class AdvanceVideoView @JvmOverloads constructor(
}
override fun onFinished(url: String?, threadBean: ThreadBean?) {
setCacheImageViewGone()
Logger.d(ImageAndVideoRotation.TAG, "download-onFinished = $url")
if (url.equals(fileNetPath)){ //发现下载工具在断网又连网后,已完成的任务又都下载,跳转播放出现问题
//下载完成