lru 启动缓存
样式修改
This commit is contained in:
@@ -82,6 +82,7 @@ object FullVideoUtils {
|
||||
it.setVideoAllCallBack(null)
|
||||
it.smalllPlayer?.clearFullscreenLayout(it)
|
||||
}
|
||||
consultVideoPlayer.removeAllViews()
|
||||
}
|
||||
try {
|
||||
if (windowManager != null) {
|
||||
|
||||
@@ -146,11 +146,7 @@ class TaxiPassengerMogoConsultView :RelativeLayout {
|
||||
.load(taxiPassengerVideoPlay.imageUrl)
|
||||
.apply(
|
||||
RequestOptions().transform(
|
||||
GlideBlurTransform(
|
||||
context,
|
||||
taxiPassengerVideoPlay.imageUrl,
|
||||
5
|
||||
)
|
||||
GlideBlurTransform(context, taxiPassengerVideoPlay.imageUrl, 5)
|
||||
)
|
||||
)
|
||||
.into(object : SimpleTarget<Bitmap?>() {
|
||||
|
||||
@@ -24,7 +24,11 @@ public class GlideBlurTransform extends BitmapTransformation {
|
||||
|
||||
@Override
|
||||
protected Bitmap transform( @NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight ) {
|
||||
Bitmap bitmap = FastBlurUtil.doBlur( toTransform, 1, blurRadius );
|
||||
Bitmap lruBitmap = DiskLruCacheManager.getInstance(context).get(key);
|
||||
if(lruBitmap!=null){
|
||||
return lruBitmap;
|
||||
}
|
||||
Bitmap bitmap = FastBlurUtil.doBlur( toTransform, 8, blurRadius );
|
||||
// 缓存高斯模糊图片
|
||||
DiskLruCacheManager.getInstance( context ).put( key, bitmap );
|
||||
return bitmap;
|
||||
|
||||
@@ -4,24 +4,29 @@ import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.*
|
||||
import android.view.Gravity
|
||||
import android.view.Surface
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.marginTop
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.video.FullVideoUtils
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.Debuger
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
import kotlinx.android.synthetic.main.taxi_p_video_show.view.*
|
||||
import java.lang.reflect.Constructor
|
||||
|
||||
/**
|
||||
@@ -64,7 +69,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
) {
|
||||
mThumbImageViewLayout.visibility = View.VISIBLE
|
||||
}
|
||||
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_16_9)
|
||||
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_FULL)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -190,6 +195,15 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
fun fullMarainTop(){
|
||||
if(mIfCurrentIsFullscreen&&smalllPlayer!=null) {
|
||||
if(mTopContainer.marginTop==0) {
|
||||
val layoutParams = mTopContainer.layoutParams as ConstraintLayout.LayoutParams
|
||||
layoutParams.setMargins(0, getStatusBarHeight(), 0, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun setViewShowState(view: View?, visibility: Int) {
|
||||
if (view === mThumbImageViewLayout && visibility != View.VISIBLE) {
|
||||
return
|
||||
@@ -199,6 +213,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
override fun onSurfaceAvailable(surface: Surface) {
|
||||
super.onSurfaceAvailable(surface)
|
||||
fullMarainTop()
|
||||
if (GSYVideoType.getRenderType() != GSYVideoType.TEXTURE) {
|
||||
if (mThumbImageViewLayout != null && mThumbImageViewLayout.visibility == View.VISIBLE) {
|
||||
mThumbImageViewLayout.visibility = View.INVISIBLE
|
||||
@@ -209,17 +224,17 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
override fun onAutoCompletion() {
|
||||
super.onAutoCompletion()
|
||||
if(mIfCurrentIsFullscreen){
|
||||
FullVideoUtils.dismissOverlayView(false)
|
||||
fullVideoPlayer?.let {
|
||||
clearFullscreenLayout(it)
|
||||
if(smalllPlayer!=null){
|
||||
smalllPlayer?.clearFullscreenLayout(this)
|
||||
}
|
||||
FullVideoUtils.dismissOverlayView(false)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
if (!mIfCurrentIsFullscreen) {
|
||||
this.outlineProvider = TextureVideoViewOutlineProvider(50F)
|
||||
this.outlineProvider = TextureVideoViewOutlineProvider(40F)
|
||||
this.clipToOutline = true
|
||||
}
|
||||
}
|
||||
@@ -335,9 +350,9 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
frameLayout: FrameLayout) {
|
||||
val lp = gsyVideoPlayer.layoutParams as LayoutParams
|
||||
lp.setMargins(0, 0, 0, 0)
|
||||
lp.height = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
lp.height = ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
lp.width = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
lp.gravity = Gravity.CENTER
|
||||
lp.gravity = Gravity.BOTTOM
|
||||
gsyVideoPlayer.layoutParams = lp
|
||||
gsyVideoPlayer.isIfCurrentIsFullscreen = true
|
||||
val isVertical = isVerticalFullByVideoSize
|
||||
@@ -365,6 +380,12 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
checkAutoFullWithSizeAndAdaptation(gsyVideoPlayer)
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun getStatusBarHeight(): Int{
|
||||
return Math.ceil((25 * context.resources.displayMetrics.density).toDouble()).toInt()
|
||||
}
|
||||
|
||||
fun clearFullscreenLayout(gsyVideoPlayer:ConsultVideoPlayer) {
|
||||
mIfCurrentIsFullscreen = false
|
||||
val delay = 100
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="50px" android:bottomRightRadius="50px"/>
|
||||
<gradient android:startColor="#a3000000" android:endColor="#00000000" android:angle="90"/>
|
||||
</shape>
|
||||
@@ -8,6 +8,11 @@
|
||||
android:background="@color/cardview_dark_background"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<View
|
||||
android:background="#4C000000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_title_icon"
|
||||
android:src="@drawable/taxi_p_mogo_consult_title_icon"
|
||||
@@ -33,9 +38,8 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_video_playlist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1273px"
|
||||
android:layout_height="1294px"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginStart="156px"
|
||||
android:layout_marginEnd="156px"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -43,10 +43,9 @@
|
||||
android:id="@+id/fullscreen"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="60px"
|
||||
android:layout_marginEnd="60px"
|
||||
android:layout_width="66px"
|
||||
android:layout_height="66px"
|
||||
android:padding="40px"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/taxi_p_change_full" />
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user