From 69b868f535b804f85773a07759ecfd55dcaee0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Fri, 27 Sep 2024 16:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E4=B8=BE=E6=8A=A5--=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E4=B8=AD=E5=BF=83=E7=82=B9=E5=87=BB=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E6=AC=A1=E6=8F=90=E4=BE=9B=E8=AF=81=E6=8D=AE=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/main/res/values-zh/strings.xml | 3 +- common/src/main/res/values/strings.xml | 3 +- .../live/activity/ReportSecondActivity.java | 248 ++++++++++++++++++ .../live/adapter/LiveReportAdapter.java | 9 + live/src/main/res/drawable/border_hui.xml | 9 + .../main/res/drawable/edit_background_f7.xml | 5 + .../res/layout/activity_report_second.xml | 209 +++++++++++++++ .../main/res/layout/item_live_report_head.xml | 41 ++- .../res/mipmap-xxxhdpi/cancel_upload.webp | Bin 0 -> 1112 bytes .../main/res/mipmap-xxxhdpi/upload_image.webp | Bin 0 -> 2578 bytes live/src/main/res/values-zh/strings.xml | 6 + live/src/main/res/values/strings.xml | 6 + 12 files changed, 529 insertions(+), 10 deletions(-) create mode 100644 live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java create mode 100644 live/src/main/res/drawable/border_hui.xml create mode 100644 live/src/main/res/drawable/edit_background_f7.xml create mode 100644 live/src/main/res/layout/activity_report_second.xml create mode 100644 live/src/main/res/mipmap-xxxhdpi/cancel_upload.webp create mode 100644 live/src/main/res/mipmap-xxxhdpi/upload_image.webp diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index e55cd1990..b1ca29277 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -554,10 +554,11 @@ TA還沒有視頻作品 我的視頻 選擇舉報理由 - 更多詳細資訊請在說明框中描述(選填) + 更多內容請在說明框中描述(必填) 提交 請選擇舉報理由 舉報成功 + 請填寫舉報内容 已經到頂了哦 確定刪除上一段視頻? 是否退出視頻編輯 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 555dca1eb..2176c897e 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -617,10 +617,11 @@ TA has no video works yet My video Choose a reason to report - For more details, please describe in the description box (optional) + More content should be described in the description box (required) Submission Please select the reason for reporting Report success + Please fill in the report It\'s at the top Are you sure you want to delete the previous video? Exit video editing diff --git a/live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java b/live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java new file mode 100644 index 000000000..c43e8a3b9 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java @@ -0,0 +1,248 @@ +package com.yunbao.live.activity; + +import android.graphics.Color; +import android.text.Editable; +import android.text.SpannableString; +import android.text.Spanned; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.text.style.ForegroundColorSpan; +import android.view.View; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import com.yunbao.common.BuildConfig; +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.interfaces.ImageResultCallback; +import com.yunbao.common.utils.ProcessImageUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.live.R; + +import java.io.File; +import java.util.Locale; + +public class ReportSecondActivity extends AbsActivity implements View.OnClickListener { + private TextView info_textView; + private EditText edit; + private TextView btn_report; + private ImageView image_1,image_2,image_3,cancel_1,cancel_2,cancel_3; + private ProcessImageUtil mImageUtil; + private int photoIndex; + private File mFile1, mFile2, mFile3; + private int uploadImageCount; + private String inputText; + + + @Override + protected int getLayoutId() { + return R.layout.activity_report_second; + } + + + @Override + protected void main() { + super.main(); + info_textView = findViewById(R.id.info_textView); + edit = findViewById(R.id.edit); + btn_report = findViewById(R.id.btn_report); + image_1 = findViewById(R.id.image_1); + image_2 = findViewById(R.id.image_2); + image_3 = findViewById(R.id.image_3); + cancel_1 = findViewById(R.id.cancel_1); + cancel_2 = findViewById(R.id.cancel_2); + cancel_3 = findViewById(R.id.cancel_3); + + imageUtilInit(); + + btn_report.setOnClickListener(this); + image_1.setOnClickListener(this); + image_1 .setOnClickListener(this); + image_2 .setOnClickListener(this); + image_3 .setOnClickListener(this); + cancel_1.setOnClickListener(this); + cancel_2.setOnClickListener(this); + + + edit.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + inputText = s.toString(); + setButtonStatus(); + } + }); + } + + private void setButtonStatus(){ + if ((inputText != null && !inputText.isEmpty()) || uploadImageCount > 0) { + btn_report.setEnabled(true); + btn_report.setBackground(getResources().getDrawable(R.drawable.border_yellow)); + } else { + btn_report.setEnabled(false); + btn_report.setBackgroundResource(R.drawable.border_hui); + } + } + + private void setInfoText(String userName) { + /* + * ○ CH:您舉報的用戶【用戶暱稱】,我們已對其進行重點觀察,並進一步判定,若發現違規將立刻處理,感謝您的監督~ +如您有任何信息證明補充,可點擊進入詳情,再次進行提交,感謝您對淨化平台環境做出的貢獻! + ○ EN:The user 【用戶暱稱】 you reported has been under our close observation and further judgment. If any violation is found, it will be dealt with immediately. Thank you for your supervision. +If you have any supplementary information or proof, you can click to enter the details and submit again. Thank you for your contribution to purifying the platform environment. + * */ + StringBuilder stringBuilder = new StringBuilder(); + Locale locale = getResources().getConfiguration().locale; + String language = locale.getLanguage(); + int startIndex = 0; + int endIndex = 0; + if (TextUtils.equals(language, "zh")) { + stringBuilder.append("您舉報的用戶【"); + startIndex = stringBuilder.toString().length(); + stringBuilder.append(userName); + endIndex = stringBuilder.toString().length(); + stringBuilder .append("】,我們已對其進行重點觀察,並進一步判定,若發現違規將立刻處理,感謝您的監督~\n如您有任何信息證明補充,可點擊進入詳情,再次進行提交,感謝您對淨化平台環境做出的貢獻!"); + } else { + stringBuilder.append("The user 【"); + startIndex = stringBuilder.toString().length(); + stringBuilder .append(userName); + endIndex = stringBuilder.toString().length(); + stringBuilder.append("】 you reported has been under our close observation and further judgment. If any violation is found, it will be dealt with immediately. Thank you for your supervision.\nIf you have any supplementary information or proof, you can click to enter the details and submit again. Thank you for your contribution to purifying the platform environment."); + } + + SpannableString spannableString = new SpannableString(stringBuilder.toString()); + + spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#FF870F")), startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + info_textView.setText(spannableString); + } + + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.btn_report) { + reportSecond(); + } else if (id == R.id.image_1) { + photoIndex = 0; + mImageUtil.getImageByAlbum(); + + } else if (id == R.id.image_2) { + photoIndex = 1; + mImageUtil.getImageByAlbum(); + + + } else if (id == R.id.image_3) { + photoIndex = 2; + mImageUtil.getImageByAlbum(); + + + } else if (id == R.id.cancel_1) { + uploadImageCount--; + mFile1 = null; + cancel_1.setVisibility(View.GONE); + ImgLoader.display(mContext, R.mipmap.upload_image, image_1); + setButtonStatus(); + + + } else if (id == R.id.cancel_2) { + uploadImageCount--; + mFile2 = null; + cancel_2.setVisibility(View.GONE); + ImgLoader.display(mContext, R.mipmap.upload_image, image_2); + setButtonStatus(); + + } else if (id == R.id.cancel_3) { + uploadImageCount--; + mFile3 = null; + cancel_3.setVisibility(View.GONE); + ImgLoader.display(mContext, R.mipmap.upload_image, image_3); + setButtonStatus(); + + } + } + + private void reportSecond() { + /* + * + * if (mIntoIndex == 0) { + LiveHttpUtil.setReport(mToUid, bean.getName(),text, file1, file2, file3, mVideoId, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + ToastUtil.show(mContext.getString(R.string.video_report_tip_4)); + onBackPressed(); + } else { + ToastUtil.show(msg); + } + } + }); + } else { + CommonHttpUtil.setCommunityReport(community_type, comment_id, mToUid, text, file1, file2, file3, bean.getId(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + ToastUtil.show(mContext.getString(R.string.video_report_tip_4)); + onBackPressed(); + } else { + ToastUtil.show(msg); + } + } + }); + } + * */ + finish(); + + } + + + private void imageUtilInit() { + mImageUtil = new ProcessImageUtil((LiveReportActivity)mContext); + mImageUtil.setImageResultCallback(new ImageResultCallback() { + @Override + public void beforeCamera() { + + } + + @Override + public void onSuccess(File file) { + if (file != null) { + if (photoIndex == 0) { + mFile1 = file; + ImgLoader.display(mContext, file, image_1); + cancel_1.setVisibility(View.VISIBLE); + uploadImageCount++; + } + else if (photoIndex == 1){ + mFile2 = file; + ImgLoader.display(mContext, file, image_2); + cancel_2.setVisibility(View.VISIBLE); + uploadImageCount++; + + } + else if (photoIndex == 2){ + mFile3 = file; + ImgLoader.display(mContext, file, image_3); + cancel_3.setVisibility(View.VISIBLE); + uploadImageCount++; + + } + setButtonStatus(); + } + } + + @Override + public void onFailure() { + } + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java index bc65cadbf..f4dfc1cf9 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java @@ -7,6 +7,8 @@ import android.graphics.drawable.Drawable; import androidx.annotation.NonNull; import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; + +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -19,6 +21,7 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.interfaces.ImageResultCallback; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.ProcessImageUtil; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveReportActivity; import com.yunbao.live.bean.LiveReportBean; @@ -304,6 +307,12 @@ public class LiveReportAdapter extends RecyclerView.Adapter { void submit() { String text = mEditText.getText().toString().trim(); + + if (TextUtils.isEmpty(text)) { + ToastUtil.show(R.string.video_report_tip_5); + return; + } + if (mActionListener != null) { // mActionListener.onReportClick(mCurVideoReportBean, text); mActionListener.onReportClick(mCurVideoReportBean, text,mFile1,mFile2,mFile3); diff --git a/live/src/main/res/drawable/border_hui.xml b/live/src/main/res/drawable/border_hui.xml new file mode 100644 index 000000000..b53902982 --- /dev/null +++ b/live/src/main/res/drawable/border_hui.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/edit_background_f7.xml b/live/src/main/res/drawable/edit_background_f7.xml new file mode 100644 index 000000000..8a376a4a7 --- /dev/null +++ b/live/src/main/res/drawable/edit_background_f7.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/activity_report_second.xml b/live/src/main/res/layout/activity_report_second.xml new file mode 100644 index 000000000..7b191a948 --- /dev/null +++ b/live/src/main/res/layout/activity_report_second.xml @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/item_live_report_head.xml b/live/src/main/res/layout/item_live_report_head.xml index 34c3ffe37..a196b0f08 100644 --- a/live/src/main/res/layout/item_live_report_head.xml +++ b/live/src/main/res/layout/item_live_report_head.xml @@ -1,11 +1,36 @@ - + xmlns:app="http://schemas.android.com/apk/res-auto"> + + + + + + + + diff --git a/live/src/main/res/mipmap-xxxhdpi/cancel_upload.webp b/live/src/main/res/mipmap-xxxhdpi/cancel_upload.webp new file mode 100644 index 0000000000000000000000000000000000000000..df399e0d7f9972c6772413a5cd061327febc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*_MWak#R0Re~MX&F;Mze5%b7j!)p&EiHDjf3o0ENzj8M)Xd@fi5&mR^Zj(!b`;}z z1HI{(A1xRZ8--^lH5ez%< z*4h^|`UJbZjMzln3XPxXv&Zfx=Tb6@%2QqWwQ`GFafXP%jV1y^s4s1Nf%|L+jM?Wp zkoq8EyzhkpwPXHrAGEM@3D(9R%$RI_r)~7G=8ElVu?!N2qHFx3lD5o#Es#>}Y&WTi z=cE_4IvrODU=EADoFHbG9!&c>)S~iS%Yw>DdIg&hBweTplyAC)7Qdsh0Q_6_{%6Ap z3M^Y-rbe40kbYD)JLI)**}T;tpJ)2<3@=HyQb`_^L`hg%#dw;^gAaR+@oa z!DJI1k;A9yb@TZSrFMHUn?H-})>p1$$NC#jQX^oasJAL&L2JHz zoN=+|HB>E-xP7ANB3o{sf+FNzVWP literal 0 HcmV?d00001 diff --git a/live/src/main/res/values-zh/strings.xml b/live/src/main/res/values-zh/strings.xml index 04f92fff9..da3a41777 100644 --- a/live/src/main/res/values-zh/strings.xml +++ b/live/src/main/res/values-zh/strings.xml @@ -145,4 +145,10 @@ 立即前往 加入 守護任務 + + 舉報結果通知 + 通知 + 上傳圖片 + 舉報內容補充 + 若您有其它補充信息,請在說明框中描述~ diff --git a/live/src/main/res/values/strings.xml b/live/src/main/res/values/strings.xml index d0dcf7d23..521ce941c 100644 --- a/live/src/main/res/values/strings.xml +++ b/live/src/main/res/values/strings.xml @@ -148,4 +148,10 @@ Go now Join Guard tasks + + Notification of report result + Notification + Upload pictures + Report content supplement + If you have additional information, please describe it in the description box \ No newline at end of file