From 94d05a3929fc502128b17716afde3ee622c01cdf Mon Sep 17 00:00:00 2001 From: hch <16607480311@163.com> Date: Thu, 21 Mar 2024 16:02:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/adapter/CommentAdapter.java | 9 +++++++ .../com/yunbao/common/utils/RouteUtil.java | 13 +++++++--- .../main/res/layout/activity_user_home.xml | 2 +- .../main/activity/UserHomeActivity.java | 4 +-- .../main/dialog/MainStartDialogFragment.java | 26 +++++++++++-------- .../video/activity/VideoPlayActivity.java | 1 + 6 files changed, 37 insertions(+), 18 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java index 14f5e44ec..c9ef57e55 100644 --- a/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/CommentAdapter.java @@ -103,6 +103,15 @@ public class CommentAdapter extends RecyclerView.Adapter { } } }); + report1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (onItemClickListener != null) { + CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag(); + onItemClickListener.onReport(bean); + } + } + }); replyTextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index 08b25fb8f..331ba4f6e 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -62,6 +62,7 @@ public class RouteUtil { .withString(Constants.TO_UID, uid) .navigation(); } + public static void forwardCommunity(String id) { ARouter.getInstance().build(PATH_COMMUNITY) .withString(Constants.TO_COMMUNITY_ID, id) @@ -71,6 +72,7 @@ public class RouteUtil { public static void forwardVideoActivity() { } + public static final String PATH_ADDRESSBOOK = "/main/MsgAddressBookActivity"; @@ -156,14 +158,17 @@ public class RouteUtil { * 跳转到个人主页 */ public static void forwardMainUserHome(Context context, String toUid, boolean fromLiveRoom, String fromLiveUid, int intoIndex) { - String url = HtmlConfig.PERSONAL + "?touid=" + toUid + "&isHomePage=1" + "&fromType=0"; + ARouter.getInstance().build(PATH_USER_HOME) + .withString(Constants.TO_UID, toUid) + .navigation(); + /* String url = HtmlConfig.PERSONAL + "?touid=" + toUid + "&isHomePage=1" + "&fromType=0"; if (!"".equals(Constants.chatActionUrl)) { url = Constants.chatActionUrl; } Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis() + "&isZh=" + ((IMLoginManager.get(context).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY) .withString(Constants.URL, url) - .navigation(); + .navigation();*/ } @@ -399,8 +404,8 @@ public class RouteUtil { public static void forwardVideoPlayActivity(ActiveBean bean) { ARouter.getInstance().build(PATH_VIDEO_PLAY) - .withParcelable("ActiveBean",bean) - .withString(Constants.VIDEO_KEY,Constants.VIDEO_SINGLE) + .withParcelable("ActiveBean", bean) + .withString(Constants.VIDEO_KEY, Constants.VIDEO_SINGLE) .navigation(); } } diff --git a/common/src/main/res/layout/activity_user_home.xml b/common/src/main/res/layout/activity_user_home.xml index 172f9c553..8422a3d9f 100644 --- a/common/src/main/res/layout/activity_user_home.xml +++ b/common/src/main/res/layout/activity_user_home.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@mipmap/main_bg" + android:background="@color/white" android:orientation="vertical"> = Build.VERSION_CODES.TIRAMISU) { - permissions=new String[]{ + permissions = new String[]{ Manifest.permission.READ_MEDIA_IMAGES, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO }; - }else{ - permissions=new String[]{ + } else { + permissions = new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA, @@ -191,13 +193,13 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O if (isAnchor) { String[] permissions; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - permissions=new String[]{ + permissions = new String[]{ Manifest.permission.READ_MEDIA_IMAGES, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO }; - }else{ - permissions=new String[]{ + } else { + permissions = new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA, @@ -244,9 +246,9 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback); }); } else { - String tips="需要下載開播插件,是否下載"; - if(!WordUtil.isNewZh()){ - tips="You need to download the plug-in, whether to download"; + String tips = "需要下載開播插件,是否下載"; + if (!WordUtil.isNewZh()) { + tips = "You need to download the plug-in, whether to download"; } DialogUitl.showSimpleDialog(mContext, tips, new DialogUitl.SimpleCallback() { @Override @@ -270,7 +272,9 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O private Runnable mStartVideoRunnable = new Runnable() { @Override public void run() { - String mBeautySdkType = CommonAppConfig.getInstance().getBeautySdkType(); + Intent intent = new Intent(mContext, CommunitySendActivity.class); + startActivity(intent); + /*String mBeautySdkType = CommonAppConfig.getInstance().getBeautySdkType(); if ("2".equals(mBeautySdkType)) { Constants.myIntoIndex = 2; Intent intent = new Intent(mContext, MyWebViewActivity.class); @@ -281,7 +285,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O Intent intent = new Intent(mContext, MyWebViewActivity.class); intent.putExtra(Constants.URL, CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ/release" + "?token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isRelease=1"+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0)); CommonAppContext.getTopActivity().startActivity(intent); - } + }*/ } }; diff --git a/video/src/main/java/com/yunbao/video/activity/VideoPlayActivity.java b/video/src/main/java/com/yunbao/video/activity/VideoPlayActivity.java index bf2ccd14f..c09ee4823 100644 --- a/video/src/main/java/com/yunbao/video/activity/VideoPlayActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/VideoPlayActivity.java @@ -52,6 +52,7 @@ public class VideoPlayActivity extends AbsVideoPlayActivity { context.startActivity(intent); } + public static void forwardSingle(Context context, ActiveBean videoBean) { if (videoBean == null) { return; From f8cb1d0a4b807ba72c50129e53e80d5436800a26 Mon Sep 17 00:00:00 2001 From: hch <16607480311@163.com> Date: Thu, 21 Mar 2024 16:14:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BE=E6=8A=A5?= =?UTF-8?q?=E7=82=B9=E4=B8=8D=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/adapter/CommentVideoAdapter.java | 11 ++++++- .../main/res/mipmap-mdpi/icon_video_more.png | Bin 0 -> 1961 bytes .../video/views/VideoCommentViewHolder.java | 7 ---- .../video/views/VideoPlayWrapViewHolder.java | 31 ++++++++++++++++-- .../main/res/layout/view_video_play_wrap.xml | 11 +++++++ 5 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 common/src/main/res/mipmap-mdpi/icon_video_more.png 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 0000000000000000000000000000000000000000..430503259876851331a1fd5864143e231684f3d6 GIT binary patch literal 1961 zcmV;a2UhrrP)Px+V@X6oRCr$PooT35RTRhne`ua*{163ArqZO6V_Aqzlu`yZK;-*ila%%)vdkeX zg`h0L3O_VKSwTfc6h&0poLLqP8U~d?QBm4#usZ+CzK{FvyYHNR?%C(&eP{143U8gY z_xas*_St9eH4r5GkgtrHjRJ5QfC&Ij1aOe=wcClDK)(s#eE_RSeh_M0K|q_?bO5(F zu>ZHUhGMhTS^Mndsa!+SiYRUyw3+P$U<82s0UTds5M6NXI{*TiRHe952_5_ljHY(}^+RS!#mV8ms-YS0m z%4B!&Qj-7FIW&VF2B6O`QE^~JZhtIE?UB@4FK9E<|K9>Irik`za zaw&ztT#`%a4pN^4aCRx(M5U{AKqAlwCja@&omfXK;R$>%4*-E4>OhC@B5JG?7%I?l zU!#13m?hBKJQD2K$|G>EK(7XHQh9wu%>Y&lv`zld9(0-f>OGVIy5&9{Jp#3-%mWrSYBlJ@cLHltkEEPc) zM(C#?g7)K7SgH)re*kzyu`MLmX@q8Wf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/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" /> + +