diff --git a/common/src/main/java/com/yunbao/common/adapter/CommentVideoAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CommentVideoAdapter.java index ab388c7bf..e67bab3ff 100644 --- a/common/src/main/java/com/yunbao/common/adapter/CommentVideoAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/CommentVideoAdapter.java @@ -32,7 +32,7 @@ public class CommentVideoAdapter extends RefreshAdapter { this.onItemClickListener = onItemClickListener; } - public CommentVideoAdapter(Context content, String authorId,CommentVideoAdapter.onItemClickListener onItemClickListener ) { + public CommentVideoAdapter(Context content, String authorId, CommentVideoAdapter.onItemClickListener onItemClickListener) { super(content); this.onItemClickListener = onItemClickListener; this.mContext = content; @@ -94,6 +94,15 @@ public class CommentVideoAdapter extends RefreshAdapter { author = itemView.findViewById(R.id.author); del1 = itemView.findViewById(R.id.del1); report1 = itemView.findViewById(R.id.report1); + report1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (onItemClickListener != null) { + CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag(); + onItemClickListener.onReport(bean); + } + } + }); report.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/common/src/main/res/mipmap-mdpi/icon_video_more.png b/common/src/main/res/mipmap-mdpi/icon_video_more.png new file mode 100644 index 000000000..430503259 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_video_more.png differ diff --git a/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java index 2e6002cba..d9497654e 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoCommentViewHolder.java @@ -16,7 +16,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateDecelerateInterpolator; -import android.view.inputmethod.InputMethodManager; import android.widget.PopupWindow; import android.widget.TextView; @@ -24,7 +23,6 @@ import com.alibaba.fastjson.JSON; import com.makeramen.roundedimageview.RoundedImageView; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; -import com.yunbao.common.adapter.CommentAdapter; import com.yunbao.common.adapter.CommentVideoAdapter; import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.bean.CommentBean; @@ -33,9 +31,6 @@ import com.yunbao.common.custom.MyLinearLayout3; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; -import com.yunbao.common.http.live.LiveNetManager; -import com.yunbao.common.interfaces.OnItemClickListener; -import com.yunbao.common.interfaces.OnItemLongClickListener; import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; @@ -43,8 +38,6 @@ import com.yunbao.common.views.AbsViewHolder; import com.yunbao.live.activity.LiveReportActivity; import com.yunbao.video.R; import com.yunbao.video.activity.AbsVideoCommentActivity; -import com.yunbao.video.adapter.VideoCommentAdapter; -import com.yunbao.video.bean.VideoCommentBean; import com.yunbao.video.event.VideoCommentEvent; import com.yunbao.video.http.VideoHttpConsts; import com.yunbao.video.http.VideoHttpUtil; diff --git a/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java index 3fa793167..4b454c31e 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoPlayWrapViewHolder.java @@ -7,6 +7,7 @@ import android.os.Bundle; import androidx.core.content.ContextCompat; +import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; @@ -30,6 +31,7 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; +import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; @@ -137,6 +139,29 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli } }); + findViewById(R.id.btn_more).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + SparseArray array = new SparseArray<>(); + array.append(0, "举报"); + array.append(1, "不感兴趣"); + DialogUitl.showStringArrayDialog(mContext, array, new DialogUitl.StringArrayDialogCallback() { + @Override + public void onItemClick(String text, int tag) { + if (tag == 0) { + RouteUtil.forwardCommentReportActivity(mVideoBean.getId(), "0"); + } else { + CommonHttpUtil.noInterest(mVideoBean.getUser_id(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + ToastUtil.show(msg); + } + }); + } + } + }); + } + }); } /** @@ -392,7 +417,7 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli } else if (i == R.id.avatar2) { clickAvatar(); } else if (i == R.id.avatar) { - + RouteUtil.forwardUserHome(mVideoBean.getUser_id()); } /*else if (i == R.id.tv_video_report) { if (mVideoBean == null) { @@ -503,8 +528,8 @@ public class VideoPlayWrapViewHolder extends AbsViewHolder implements View.OnCli if (!jsonArray.isEmpty()) { image = jsonArray.getString(0); } - }else{ - image=mVideoBean.getVideo() + "?vframe/jpg/offset/0"; + } else { + image = mVideoBean.getVideo() + "?vframe/jpg/offset/0"; } new SharePopDialog(mContext) .setShareType(SharePopDialog.TYPE_VIDEO) diff --git a/video/src/main/res/layout/view_video_play_wrap.xml b/video/src/main/res/layout/view_video_play_wrap.xml index 81b567a0b..d3c4b19cb 100644 --- a/video/src/main/res/layout/view_video_play_wrap.xml +++ b/video/src/main/res/layout/view_video_play_wrap.xml @@ -114,6 +114,17 @@ android:textSize="10sp" android:visibility="visible" /> + +