no message

This commit is contained in:
liujing
2020-10-22 21:40:53 +08:00
parent d2ec559f03
commit 3720fb5c6b
4 changed files with 39 additions and 18 deletions

View File

@@ -12,12 +12,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.SimpleCoverVideoPlayer;
import com.mogo.module.v2x.listener.AdapterCallback;
import com.mogo.module.v2x.listener.VideoAdapterCallBack;
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
import java.util.ArrayList;
public class V2XRoadVideoAdapter extends RecyclerView.Adapter {
private static final String TAG = "V2XRoadVideoAdapter";
private final LayoutInflater shareLayoutInflater;
@@ -36,7 +33,7 @@ public class V2XRoadVideoAdapter extends RecyclerView.Adapter {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = shareLayoutInflater.inflate(R.layout.window_road_video_item, parent,
View v = shareLayoutInflater.inflate(R.layout.window_road_video_layout, parent,
false);
RoadVideoVH holder = new RoadVideoVH(v);
return holder;

View File

@@ -38,9 +38,17 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID
private RecyclerView roadVideoRecyclerView;
V2XRoadVideoAdapter mV2XRoadVideoAdapter;
private V2XWindowStatusListener mV2XWindowStatusListener;
private ImageView playImageView;
private ImageView closeImage;
private SimpleCoverVideoPlayer simpleCoverVideoPlayer;
private Context mContext;
private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
// private Context mContext;
public V2XRoadVideoWindow() {
this(V2XServiceManager.getContext(), null);
}
@@ -57,20 +65,19 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID
public V2XRoadVideoWindow(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView(context);
mContext = context;
initView(mContext);
}
private void initView(Context context) {
mContext = context;
LayoutInflater.from(mContext).inflate(R.layout.window_road_video, this);
LayoutInflater.from(mContext).inflate(R.layout.window_road_video_layout, this);
initVideo();
roadVideoRecyclerView = findViewById(R.id.video_recycleview);
mV2XRoadVideoAdapter = new V2XRoadVideoAdapter(mContext, this);
roadVideoRecyclerView.setAdapter(mV2XRoadVideoAdapter);
LinearLayoutManager linearLayoutManager =
new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
roadVideoRecyclerView.setLayoutManager(linearLayoutManager);
playImageView = this.findViewById(R.id.window_video_play);
simpleCoverVideoPlayer = this.findViewById(R.id.roadVideoView);
closeImage = this.findViewById(R.id.roadVideoClose);
closeImage.setOnClickListener(v -> {
});
}
@Override
@@ -85,7 +92,23 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID
return;
}
if (path.contains(".mp4")) {
mV2XRoadVideoAdapter.videoPlayWithVideoUrl(path);
playImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
gsyVideoOptionBuilder.setUrl(path).setCacheWithPlay(false).setPlayTag(TAG)
.build(simpleCoverVideoPlayer);
simpleCoverVideoPlayer.getStartButton().performClick();
}
});
simpleCoverVideoPlayer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
gsyVideoOptionBuilder.setUrl(path).setCacheWithPlay(false).setPlayTag(TAG)
.build(simpleCoverVideoPlayer);
simpleCoverVideoPlayer.getStartButton().performClick();
}
});
}
}

View File

@@ -10,7 +10,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/video_recycleview"
tools:listitem="@layout/window_road_video_item"
tools:listitem="@layout/window_road_video_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -2,7 +2,9 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="#99000000"
android:paddingStart="@dimen/module_main_v2x_animation_width">
<com.mogo.module.v2x.view.RoundLayout
android:id="@+id/rlRoadEventList"
@@ -15,8 +17,7 @@
android:id="@+id/roadVideoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:visibility="visible" />
android:layout_centerInParent="true" />
<com.mogo.service.imageloader.MogoImageView
android:id="@+id/thumbnail_image"