[6.7.2]
1、修复广告视频播放的占位图的皮肤适配。
This commit is contained in:
@@ -25,6 +25,7 @@ import com.mogo.och.charter.passenger.R
|
||||
import com.mogo.och.charter.passenger.utils.FullVideoUtils
|
||||
import com.mogo.och.common.module.manager.audiofocus.AudioFocusManager
|
||||
import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
import com.mogo.skin.widget.SkinImageView
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
|
||||
@@ -44,7 +45,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
private val TAG = "ConsultVideoPlayer"
|
||||
private lateinit var start: ImageView
|
||||
lateinit var coverImage: ImageView
|
||||
lateinit var coverImage: SkinImageView
|
||||
private lateinit var currentTimeTextView: TextView
|
||||
private lateinit var totalTimeTextView: TextView
|
||||
private lateinit var aivStartPlay: AppCompatImageView
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.charter.passenger.ui.video.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -14,6 +15,7 @@ import com.mogo.och.common.module.wigets.media.MediaItem;
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
|
||||
import com.mogo.och.charter.passenger.R;
|
||||
import com.mogo.och.charter.passenger.bean.TaxiPassengerVideoPlay;
|
||||
import com.mogo.skin.utils.SkinResources;
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack;
|
||||
|
||||
import java.util.List;
|
||||
@@ -82,9 +84,10 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
|
||||
} else {
|
||||
imageUrl = taxiPassengerVideoPlay.getUrl();
|
||||
}
|
||||
Drawable placeholderDrawable = SkinResources.getInstance().getDrawable(R.drawable.road_video_bg);
|
||||
Glide.with(context)
|
||||
.load(imageUrl)
|
||||
.apply(new RequestOptions().placeholder(R.drawable.charter_p_video_holder).centerCrop())
|
||||
.apply(new RequestOptions().placeholder(placeholderDrawable).centerCrop())
|
||||
.into(holder.gsyVideoPlayer.coverImage);
|
||||
holder.gsyVideoPlayer.getTitleTextView().setText(taxiPassengerVideoPlay.getTitle());
|
||||
holder.gsyVideoPlayer.getFullscreenButton().setVisibility(isVideo ? View.VISIBLE : View.INVISIBLE);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
<com.mogo.skin.widget.SkinImageView
|
||||
android:id="@+id/thumbImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.mogo.och.common.module.wigets.media.MediaFileCacheManager
|
||||
import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
import com.mogo.och.common.module.wigets.media.MediaLoopPlayView
|
||||
import com.mogo.och.common.module.wigets.media.MediaPlayLogger
|
||||
import com.mogo.skin.utils.SkinResources
|
||||
import com.mogo.skin.widget.SkinImageView
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
@@ -30,7 +32,7 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
) : RelativeLayout(context, attrs) {
|
||||
|
||||
private var containerLayout: RelativeLayout? = null
|
||||
private var thumbnailImageView: ImageView? = null
|
||||
private var thumbnailImageView: SkinImageView? = null
|
||||
private var videoPlayerView: AdvanceGSYVideoPlayer? = null
|
||||
|
||||
private var gsyVideoPlayerOptionBuilder: GSYVideoOptionBuilder? = null
|
||||
@@ -107,7 +109,7 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
addView(containerLayout, LayoutParams(-1, -1))
|
||||
|
||||
//缩略图
|
||||
thumbnailImageView = ImageView(context)
|
||||
thumbnailImageView = SkinImageView(context)
|
||||
thumbnailImageView?.scaleType = ImageView.ScaleType.FIT_XY
|
||||
|
||||
//视频播放控件
|
||||
@@ -147,14 +149,15 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
//首先根据url检查video是否有已经下载完的本地视频文件
|
||||
gsyVideoPlayerLifecycleCallback = onCompletionListener
|
||||
videoPlayerView?.thumbImageView = thumbnailImageView
|
||||
thumbnailImageView?.setImageResource(R.drawable.video_holder)
|
||||
val placeholderDrawable = SkinResources.getInstance().getDrawable(R.drawable.road_video_bg)
|
||||
thumbnailImageView?.setImageResource(R.drawable.road_video_bg)
|
||||
thumbnailImageView?.also {
|
||||
Glide.with(context).asBitmap().load(thumbnailImageUrl)
|
||||
.apply(
|
||||
RequestOptions().useUnlimitedSourceGeneratorsPool(true)
|
||||
.placeholder(R.drawable.video_holder)
|
||||
.error(R.drawable.video_holder)
|
||||
.fallback(R.drawable.video_holder)
|
||||
.placeholder(placeholderDrawable)
|
||||
.error(placeholderDrawable)
|
||||
.fallback(placeholderDrawable)
|
||||
.centerCrop()
|
||||
)
|
||||
.into(it)
|
||||
@@ -358,7 +361,7 @@ class AdvanceImageView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null
|
||||
) : RelativeLayout(context, attrs) {
|
||||
|
||||
private var imageView: ImageView? = null
|
||||
private var imageView: SkinImageView? = null
|
||||
private var imageUrl: String = ""
|
||||
|
||||
init {
|
||||
@@ -366,7 +369,7 @@ class AdvanceImageView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
imageView = ImageView(context)
|
||||
imageView = SkinImageView(context)
|
||||
imageView?.scaleType = ImageView.ScaleType.FIT_XY
|
||||
addView(imageView, LayoutParams(-1, -1))
|
||||
}
|
||||
@@ -376,13 +379,15 @@ class AdvanceImageView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun displayImage() {
|
||||
imageView?.setImageResource(R.drawable.video_holder)
|
||||
val placeholderDrawable = SkinResources.getInstance().getDrawable(R.drawable.road_video_bg)
|
||||
|
||||
imageView?.setImageResource(R.drawable.road_video_bg)
|
||||
imageView?.also {
|
||||
Glide.with(context).asBitmap().load(imageUrl).apply(
|
||||
RequestOptions().useUnlimitedSourceGeneratorsPool(true)
|
||||
.placeholder(R.drawable.video_holder)
|
||||
.error(R.drawable.video_holder)
|
||||
.fallback(R.drawable.video_holder)
|
||||
.placeholder(placeholderDrawable)
|
||||
.error(placeholderDrawable)
|
||||
.fallback(placeholderDrawable)
|
||||
.centerCrop()
|
||||
).into(it)
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB |
@@ -73,7 +73,7 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
|
||||
holder.gsyVideoPlayer.getTitleTextView().setText(taxiPassengerVideoPlay.getTitle());
|
||||
Glide.with(context)
|
||||
.load(taxiPassengerVideoPlay.getImageUrl())
|
||||
.apply(new RequestOptions().placeholder(R.drawable.taxi_p_video_holder).centerCrop())
|
||||
.apply(new RequestOptions().placeholder(R.drawable.road_video_bg).centerCrop())
|
||||
.into(holder.gsyVideoPlayer.coverImage);
|
||||
holder.gsyVideoPlayer.getThumbImageViewLayout().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -73,7 +73,7 @@ public class RecyclerVideoAdapter extends RecyclerView.Adapter<RecyclerItemVideo
|
||||
}
|
||||
Glide.with(context)
|
||||
.load(imageUrl)
|
||||
.apply(new RequestOptions().placeholder(R.drawable.taxt_u_p_video_holder).centerCrop())
|
||||
.apply(new RequestOptions().placeholder(R.drawable.road_video_bg).centerCrop())
|
||||
.into(holder.gsyVideoPlayer.coverImage);
|
||||
|
||||
if (isVideo) {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB |
@@ -9,14 +9,14 @@
|
||||
android:id="@+id/surface_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"></RelativeLayout>
|
||||
android:gravity="center"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/thumb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
<com.mogo.skin.widget.SkinImageView
|
||||
android:id="@+id/thumbImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
android:id="@+id/surface_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"></RelativeLayout>
|
||||
android:gravity="center"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/thumb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
<com.mogo.skin.widget.SkinImageView
|
||||
android:id="@+id/thumbImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user