diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-05-05 06:30:46 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-05-05 06:30:46 +0000 |
commit | 893c8a20769684e2d4493945aa69059e10a5f7e2 (patch) | |
tree | 6e850997abf7f383cb1e0614ab160a3b3dece0a7 /app/src | |
parent | d444a3a084d82b65e41e15282c11694e7cde7d7a (diff) | |
download | infinity-for-reddit-893c8a20769684e2d4493945aa69059e10a5f7e2.tar infinity-for-reddit-893c8a20769684e2d4493945aa69059e10a5f7e2.tar.gz infinity-for-reddit-893c8a20769684e2d4493945aa69059e10a5f7e2.tar.bz2 infinity-for-reddit-893c8a20769684e2d4493945aa69059e10a5f7e2.tar.lz infinity-for-reddit-893c8a20769684e2d4493945aa69059e10a5f7e2.tar.xz infinity-for-reddit-893c8a20769684e2d4493945aa69059e10a5f7e2.tar.zst infinity-for-reddit-893c8a20769684e2d4493945aa69059e10a5f7e2.zip |
Reporting comments is now available.
Diffstat (limited to 'app/src')
5 files changed, 48 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ReportActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ReportActivity.java index 3092b8c7..4e3a0738 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ReportActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ReportActivity.java @@ -161,6 +161,7 @@ public class ReportActivity extends BaseActivity { case R.id.action_send_report_activity: ReportReason reportReason = mAdapter.getSelectedReason(); if (reportReason != null) { + Toast.makeText(ReportActivity.this, R.string.reporting, Toast.LENGTH_SHORT).show(); ReportThing.reportThing(mOauthRetrofit, mAccessToken, mFullname, mSubredditName, reportReason.getReasonType(), reportReason.getReportReason(), new ReportThing.ReportThingListener() { @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentMoreBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentMoreBottomSheetFragment.java index d339b5f6..fd97f1d4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentMoreBottomSheetFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/CommentMoreBottomSheetFragment.java @@ -22,6 +22,7 @@ import com.deishelon.roundedbottomsheet.RoundedBottomSheetDialogFragment; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.Activity.EditCommentActivity; +import ml.docilealligator.infinityforreddit.Activity.ReportActivity; import ml.docilealligator.infinityforreddit.Activity.ViewPostDetailActivity; import ml.docilealligator.infinityforreddit.Activity.ViewUserDetailActivity; import ml.docilealligator.infinityforreddit.CommentData; @@ -44,6 +45,8 @@ public class CommentMoreBottomSheetFragment extends RoundedBottomSheetDialogFrag TextView shareTextView; @BindView(R.id.copy_text_view_comment_more_bottom_sheet_fragment) TextView copyTextView; + @BindView(R.id.report_view_comment_more_bottom_sheet_fragment) + TextView reportTextView; private AppCompatActivity activity; public CommentMoreBottomSheetFragment() { // Required empty public constructor @@ -119,6 +122,15 @@ public class CommentMoreBottomSheetFragment extends RoundedBottomSheetDialogFrag copyTextBottomSheetFragment.show(activity.getSupportFragmentManager(), copyTextBottomSheetFragment.getTag()); }); + reportTextView.setOnClickListener(view -> { + Intent intent = new Intent(activity, ReportActivity.class); + intent.putExtra(ReportActivity.EXTRA_SUBREDDIT_NAME, commentData.getSubredditName()); + intent.putExtra(ReportActivity.EXTRA_THING_FULLNAME, commentData.getFullName()); + activity.startActivity(intent); + + dismiss(); + }); + return rootView; } diff --git a/app/src/main/res/drawable/ic_report_black_24dp.xml b/app/src/main/res/drawable/ic_report_black_24dp.xml new file mode 100644 index 00000000..6e07b06d --- /dev/null +++ b/app/src/main/res/drawable/ic_report_black_24dp.xml @@ -0,0 +1,15 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:pathData="M15.73,3H8.27L3,8.27v7.46L8.27,21h7.46L21,15.73V8.27L15.73,3zM19,14.9L14.9,19H9.1L5,14.9V9.1L9.1,5h5.8L19,9.1v5.8z" + android:fillColor="#000000"/> + <path + android:pathData="M12,16m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0" + android:fillColor="#000000"/> + <path + android:pathData="M11,7h2v7h-2z" + android:fillColor="#000000"/> +</vector> diff --git a/app/src/main/res/layout/fragment_comment_more_bottom_sheet.xml b/app/src/main/res/layout/fragment_comment_more_bottom_sheet.xml index d60fe273..ddd3e572 100644 --- a/app/src/main/res/layout/fragment_comment_more_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_comment_more_bottom_sheet.xml @@ -81,6 +81,24 @@ android:textColor="?attr/primaryTextColor" android:textSize="?attr/font_default" /> + <TextView + android:id="@+id/report_view_comment_more_bottom_sheet_fragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?attr/selectableItemBackground" + android:clickable="true" + android:drawableStart="@drawable/ic_report_black_24dp" + android:drawablePadding="48dp" + android:focusable="true" + android:gravity="center_vertical" + android:paddingStart="32dp" + android:paddingTop="16dp" + android:paddingEnd="32dp" + android:paddingBottom="16dp" + android:text="@string/report" + android:textColor="?attr/primaryTextColor" + android:textSize="?attr/font_default" /> + </LinearLayout> </androidx.core.widget.NestedScrollView>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e39cd2cf..c12d7105 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -705,6 +705,8 @@ <string name="n_awards">%1$d Awards</string> <string name="one_award">1 Award</string> + <string name="report">Report</string> + <string name="reporting">Reporting</string> <string name="report_successful">Reported</string> <string name="report_failed">Report failed</string> <string name="report_reason_not_selected">You haven\'t selected a reason</string> |