diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java b/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java index 5b18c49e..eacf058b 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java @@ -55,12 +55,8 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott TextView shareTextView; @BindView(R.id.copy_text_view_comment_more_bottom_sheet_fragment) TextView copyTextView; - @BindView(R.id.give_award_text_view_comment_more_bottom_sheet_fragment) - TextView giveAwardTextView; @BindView(R.id.report_view_comment_more_bottom_sheet_fragment) TextView reportTextView; - @BindView(R.id.see_removed_view_comment_more_bottom_sheet_fragment) - TextView seeRemovedTextView; private BaseActivity activity; public CommentMoreBottomSheetFragment() { @@ -93,18 +89,6 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott boolean showReplyAndSaveOption = bundle.getBoolean(EXTRA_SHOW_REPLY_AND_SAVE_OPTION, false); if (accessToken != null && !accessToken.equals("")) { - giveAwardTextView.setVisibility(View.VISIBLE); - giveAwardTextView.setOnClickListener(view -> { - Intent intent = new Intent(activity, GiveAwardActivity.class); - intent.putExtra(GiveAwardActivity.EXTRA_THING_FULLNAME, comment.getFullName()); - intent.putExtra(GiveAwardActivity.EXTRA_ITEM_POSITION, bundle.getInt(EXTRA_POSITION)); - if (activity instanceof ViewPostDetailActivity) { - activity.startActivityForResult(intent, ViewPostDetailActivity.GIVE_AWARD_REQUEST_CODE); - } else if (activity instanceof ViewUserDetailActivity) { - activity.startActivityForResult(intent, ViewUserDetailActivity.GIVE_AWARD_REQUEST_CODE); - } - dismiss(); - }); if (editAndDeleteAvailable) { editTextView.setVisibility(View.VISIBLE); @@ -193,27 +177,14 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott }); reportTextView.setOnClickListener(view -> { - Intent intent = new Intent(activity, ReportActivity.class); + /*Intent intent = new Intent(activity, ReportActivity.class); intent.putExtra(ReportActivity.EXTRA_SUBREDDIT_NAME, comment.getCommunityName()); intent.putExtra(ReportActivity.EXTRA_THING_FULLNAME, comment.getFullName()); - activity.startActivity(intent); - + activity.startActivity(intent);*/ + Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show(); dismiss(); }); - if ("[deleted]".equals(comment.getAuthor()) || - "[deleted]".equals(comment.getCommentRawText()) || - "[removed]".equals(comment.getCommentRawText()) - ) { - seeRemovedTextView.setVisibility(View.VISIBLE); - - seeRemovedTextView.setOnClickListener(view -> { - dismiss(); - if (activity instanceof ViewPostDetailActivity) { - ((ViewPostDetailActivity) activity).showRemovedComment(comment, bundle.getInt(EXTRA_POSITION)); - } - }); - } if (activity.typeface != null) { Utils.setFontToAllTextViews(rootView, activity.typeface); diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java b/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java index 1b857363..f939bb91 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java @@ -78,7 +78,6 @@ import eu.toldi.infinityforlemmy.SaveThing; import eu.toldi.infinityforlemmy.SortType; import eu.toldi.infinityforlemmy.activities.CommentActivity; import eu.toldi.infinityforlemmy.activities.EditPostActivity; -import eu.toldi.infinityforlemmy.activities.GiveAwardActivity; import eu.toldi.infinityforlemmy.activities.PostFilterPreferenceActivity; import eu.toldi.infinityforlemmy.activities.ReportActivity; import eu.toldi.infinityforlemmy.activities.SubmitCrosspostActivity; @@ -114,7 +113,6 @@ import eu.toldi.infinityforlemmy.readpost.InsertReadPost; import eu.toldi.infinityforlemmy.subreddit.FetchSubredditData; import eu.toldi.infinityforlemmy.subreddit.SubredditData; import eu.toldi.infinityforlemmy.utils.APIUtils; -import eu.toldi.infinityforlemmy.utils.LemmyUtils; import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils; import eu.toldi.infinityforlemmy.utils.Utils; import eu.toldi.infinityforlemmy.videoautoplay.ExoCreator; @@ -709,7 +707,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic MenuItem spoilerItem = mMenu.findItem(R.id.action_spoiler_view_post_detail_fragment); spoilerItem.setVisible(true); - mMenu.findItem(R.id.action_edit_flair_view_post_detail_fragment).setVisible(true); + mMenu.findItem(R.id.action_block_user_view_post_detail_fragment).setVisible(false); } mMenu.findItem(R.id.action_view_crosspost_parent_view_post_detail_fragment).setVisible(mPost.getCrosspostParentId() != null); @@ -1072,35 +1070,18 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic return true; } else if (itemId == R.id.action_spoiler_view_post_detail_fragment) { return true; - } else if (itemId == R.id.action_edit_flair_view_post_detail_fragment) { - FlairBottomSheetFragment flairBottomSheetFragment = new FlairBottomSheetFragment(); - Bundle bundle = new Bundle(); - bundle.putString(FlairBottomSheetFragment.EXTRA_ACCESS_TOKEN, mAccessToken); - bundle.putString(FlairBottomSheetFragment.EXTRA_SUBREDDIT_NAME, mPost.getSubredditName()); - bundle.putLong(FlairBottomSheetFragment.EXTRA_VIEW_POST_DETAIL_FRAGMENT_ID, viewPostDetailFragmentId); - flairBottomSheetFragment.setArguments(bundle); - flairBottomSheetFragment.show(activity.getSupportFragmentManager(), flairBottomSheetFragment.getTag()); + } else if (itemId == R.id.action_block_user_view_post_detail_fragment) { + Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show(); return true; - } else if (itemId == R.id.action_give_award_view_post_detail_fragment) { - if (mAccessToken == null) { - Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show(); - return true; - } - - Intent giveAwardIntent = new Intent(activity, GiveAwardActivity.class); - giveAwardIntent.putExtra(GiveAwardActivity.EXTRA_THING_FULLNAME, mPost.getFullName()); - giveAwardIntent.putExtra(GiveAwardActivity.EXTRA_ITEM_POSITION, 0); - activity.startActivityForResult(giveAwardIntent, ViewPostDetailActivity.GIVE_AWARD_REQUEST_CODE); + } else if (itemId == R.id.action_block_community_view_post_detail_fragment) { + Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show(); return true; } else if (itemId == R.id.action_report_view_post_detail_fragment) { if (mAccessToken == null) { Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show(); return true; } - Intent intent = new Intent(activity, ReportActivity.class); - intent.putExtra(ReportActivity.EXTRA_SUBREDDIT_NAME, mPost.getSubredditName()); - intent.putExtra(ReportActivity.EXTRA_THING_FULLNAME, mPost.getFullName()); - startActivity(intent); + Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show(); return true; } else if (itemId == R.id.action_see_removed_view_post_detail_fragment) { showRemovedPost(); @@ -1190,7 +1171,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic if (mCommentsRecyclerView != null) { LinearLayoutManager myLayoutManager = (LinearLayoutManager) mCommentsRecyclerView.getLayoutManager(); scrollPosition = myLayoutManager != null ? myLayoutManager.findFirstVisibleItemPosition() : 0; - + } else { LinearLayoutManager myLayoutManager = (LinearLayoutManager) mRecyclerView.getLayoutManager(); scrollPosition = myLayoutManager != null ? myLayoutManager.findFirstVisibleItemPosition() : 0; @@ -1369,7 +1350,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } - FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken, mPost.getId(), commentId, sortType, mExpandChildren, pages_loaded + 1, + FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken, mPost.getId(), mSingleCommentId == 0 ? null : mSingleCommentParentId == 0 ? mSingleCommentId : mSingleCommentParentId, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() { @Override public void onFetchCommentSuccess(ArrayList expandedComments, @@ -1438,8 +1419,8 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic @Override public void onFetchCommentFailed() { isFetchingComments = false; - - mCommentsAdapter.initiallyLoadCommentsFailed(); + if(pages_loaded == 0) + mCommentsAdapter.initiallyLoadCommentsFailed(); if (changeRefreshState) { isRefreshing = false; } @@ -1459,7 +1440,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic isLoadingMoreChildren = true; FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken, - mPost.getId(), null, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() { + mPost.getId(), mSingleCommentId == 0 ? null : mSingleCommentParentId == 0 ? mSingleCommentId : mSingleCommentParentId, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() { @Override public void onFetchCommentSuccess(ArrayList expandedComments, Integer parentId, ArrayList children) { pages_loaded++; 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 fcae03f0..12a96099 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 @@ -124,25 +124,6 @@ android:fontFamily="?attr/font_family" app:drawableStartCompat="@drawable/ic_copy_24dp" /> - - diff --git a/app/src/main/res/menu/view_post_detail_fragment.xml b/app/src/main/res/menu/view_post_detail_fragment.xml index 5f732534..d87a04f5 100644 --- a/app/src/main/res/menu/view_post_detail_fragment.xml +++ b/app/src/main/res/menu/view_post_detail_fragment.xml @@ -76,16 +76,16 @@ android:visible="false" /> + android:visible="true" /> Mentions Replies Use Circular FAB + Block Community\n + Feature not implemented yet :(