mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-01 05:47:10 +01:00
Removed more reddit related options
Removed options related to reddit, like flairs and awards.
This commit is contained in:
parent
6cf69ee26d
commit
926e1162f0
@ -55,12 +55,8 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott
|
|||||||
TextView shareTextView;
|
TextView shareTextView;
|
||||||
@BindView(R.id.copy_text_view_comment_more_bottom_sheet_fragment)
|
@BindView(R.id.copy_text_view_comment_more_bottom_sheet_fragment)
|
||||||
TextView copyTextView;
|
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)
|
@BindView(R.id.report_view_comment_more_bottom_sheet_fragment)
|
||||||
TextView reportTextView;
|
TextView reportTextView;
|
||||||
@BindView(R.id.see_removed_view_comment_more_bottom_sheet_fragment)
|
|
||||||
TextView seeRemovedTextView;
|
|
||||||
private BaseActivity activity;
|
private BaseActivity activity;
|
||||||
|
|
||||||
public CommentMoreBottomSheetFragment() {
|
public CommentMoreBottomSheetFragment() {
|
||||||
@ -93,18 +89,6 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott
|
|||||||
boolean showReplyAndSaveOption = bundle.getBoolean(EXTRA_SHOW_REPLY_AND_SAVE_OPTION, false);
|
boolean showReplyAndSaveOption = bundle.getBoolean(EXTRA_SHOW_REPLY_AND_SAVE_OPTION, false);
|
||||||
|
|
||||||
if (accessToken != null && !accessToken.equals("")) {
|
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) {
|
if (editAndDeleteAvailable) {
|
||||||
editTextView.setVisibility(View.VISIBLE);
|
editTextView.setVisibility(View.VISIBLE);
|
||||||
@ -193,27 +177,14 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott
|
|||||||
});
|
});
|
||||||
|
|
||||||
reportTextView.setOnClickListener(view -> {
|
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_SUBREDDIT_NAME, comment.getCommunityName());
|
||||||
intent.putExtra(ReportActivity.EXTRA_THING_FULLNAME, comment.getFullName());
|
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();
|
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) {
|
if (activity.typeface != null) {
|
||||||
Utils.setFontToAllTextViews(rootView, activity.typeface);
|
Utils.setFontToAllTextViews(rootView, activity.typeface);
|
||||||
|
@ -78,7 +78,6 @@ import eu.toldi.infinityforlemmy.SaveThing;
|
|||||||
import eu.toldi.infinityforlemmy.SortType;
|
import eu.toldi.infinityforlemmy.SortType;
|
||||||
import eu.toldi.infinityforlemmy.activities.CommentActivity;
|
import eu.toldi.infinityforlemmy.activities.CommentActivity;
|
||||||
import eu.toldi.infinityforlemmy.activities.EditPostActivity;
|
import eu.toldi.infinityforlemmy.activities.EditPostActivity;
|
||||||
import eu.toldi.infinityforlemmy.activities.GiveAwardActivity;
|
|
||||||
import eu.toldi.infinityforlemmy.activities.PostFilterPreferenceActivity;
|
import eu.toldi.infinityforlemmy.activities.PostFilterPreferenceActivity;
|
||||||
import eu.toldi.infinityforlemmy.activities.ReportActivity;
|
import eu.toldi.infinityforlemmy.activities.ReportActivity;
|
||||||
import eu.toldi.infinityforlemmy.activities.SubmitCrosspostActivity;
|
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.FetchSubredditData;
|
||||||
import eu.toldi.infinityforlemmy.subreddit.SubredditData;
|
import eu.toldi.infinityforlemmy.subreddit.SubredditData;
|
||||||
import eu.toldi.infinityforlemmy.utils.APIUtils;
|
import eu.toldi.infinityforlemmy.utils.APIUtils;
|
||||||
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
|
||||||
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
|
import eu.toldi.infinityforlemmy.utils.SharedPreferencesUtils;
|
||||||
import eu.toldi.infinityforlemmy.utils.Utils;
|
import eu.toldi.infinityforlemmy.utils.Utils;
|
||||||
import eu.toldi.infinityforlemmy.videoautoplay.ExoCreator;
|
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);
|
MenuItem spoilerItem = mMenu.findItem(R.id.action_spoiler_view_post_detail_fragment);
|
||||||
spoilerItem.setVisible(true);
|
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);
|
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;
|
return true;
|
||||||
} else if (itemId == R.id.action_spoiler_view_post_detail_fragment) {
|
} else if (itemId == R.id.action_spoiler_view_post_detail_fragment) {
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_edit_flair_view_post_detail_fragment) {
|
} else if (itemId == R.id.action_block_user_view_post_detail_fragment) {
|
||||||
FlairBottomSheetFragment flairBottomSheetFragment = new FlairBottomSheetFragment();
|
Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show();
|
||||||
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());
|
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_give_award_view_post_detail_fragment) {
|
} else if (itemId == R.id.action_block_community_view_post_detail_fragment) {
|
||||||
if (mAccessToken == null) {
|
Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show();
|
||||||
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);
|
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_report_view_post_detail_fragment) {
|
} else if (itemId == R.id.action_report_view_post_detail_fragment) {
|
||||||
if (mAccessToken == null) {
|
if (mAccessToken == null) {
|
||||||
Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Intent intent = new Intent(activity, ReportActivity.class);
|
Toast.makeText(activity, R.string.not_implemented, Toast.LENGTH_SHORT).show();
|
||||||
intent.putExtra(ReportActivity.EXTRA_SUBREDDIT_NAME, mPost.getSubredditName());
|
|
||||||
intent.putExtra(ReportActivity.EXTRA_THING_FULLNAME, mPost.getFullName());
|
|
||||||
startActivity(intent);
|
|
||||||
return true;
|
return true;
|
||||||
} else if (itemId == R.id.action_see_removed_view_post_detail_fragment) {
|
} else if (itemId == R.id.action_see_removed_view_post_detail_fragment) {
|
||||||
showRemovedPost();
|
showRemovedPost();
|
||||||
@ -1190,7 +1171,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
if (mCommentsRecyclerView != null) {
|
if (mCommentsRecyclerView != null) {
|
||||||
LinearLayoutManager myLayoutManager = (LinearLayoutManager) mCommentsRecyclerView.getLayoutManager();
|
LinearLayoutManager myLayoutManager = (LinearLayoutManager) mCommentsRecyclerView.getLayoutManager();
|
||||||
scrollPosition = myLayoutManager != null ? myLayoutManager.findFirstVisibleItemPosition() : 0;
|
scrollPosition = myLayoutManager != null ? myLayoutManager.findFirstVisibleItemPosition() : 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LinearLayoutManager myLayoutManager = (LinearLayoutManager) mRecyclerView.getLayoutManager();
|
LinearLayoutManager myLayoutManager = (LinearLayoutManager) mRecyclerView.getLayoutManager();
|
||||||
scrollPosition = myLayoutManager != null ? myLayoutManager.findFirstVisibleItemPosition() : 0;
|
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() {
|
new FetchComment.FetchCommentListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments,
|
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments,
|
||||||
@ -1438,8 +1419,8 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
@Override
|
@Override
|
||||||
public void onFetchCommentFailed() {
|
public void onFetchCommentFailed() {
|
||||||
isFetchingComments = false;
|
isFetchingComments = false;
|
||||||
|
if(pages_loaded == 0)
|
||||||
mCommentsAdapter.initiallyLoadCommentsFailed();
|
mCommentsAdapter.initiallyLoadCommentsFailed();
|
||||||
if (changeRefreshState) {
|
if (changeRefreshState) {
|
||||||
isRefreshing = false;
|
isRefreshing = false;
|
||||||
}
|
}
|
||||||
@ -1459,7 +1440,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
isLoadingMoreChildren = true;
|
isLoadingMoreChildren = true;
|
||||||
|
|
||||||
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken,
|
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
|
@Override
|
||||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, Integer parentId, ArrayList<Integer> children) {
|
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, Integer parentId, ArrayList<Integer> children) {
|
||||||
pages_loaded++;
|
pages_loaded++;
|
||||||
|
@ -124,25 +124,6 @@
|
|||||||
android:fontFamily="?attr/font_family"
|
android:fontFamily="?attr/font_family"
|
||||||
app:drawableStartCompat="@drawable/ic_copy_24dp" />
|
app:drawableStartCompat="@drawable/ic_copy_24dp" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/give_award_text_view_comment_more_bottom_sheet_fragment"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
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/action_give_award"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="?attr/font_default"
|
|
||||||
android:fontFamily="?attr/font_family"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:drawableStartCompat="@drawable/ic_give_award_24dp" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/report_view_comment_more_bottom_sheet_fragment"
|
android:id="@+id/report_view_comment_more_bottom_sheet_fragment"
|
||||||
@ -163,25 +144,6 @@
|
|||||||
android:fontFamily="?attr/font_family"
|
android:fontFamily="?attr/font_family"
|
||||||
app:drawableStartCompat="@drawable/ic_report_24dp" />
|
app:drawableStartCompat="@drawable/ic_report_24dp" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/see_removed_view_comment_more_bottom_sheet_fragment"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
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/see_removed_comment"
|
|
||||||
android:textColor="?attr/primaryTextColor"
|
|
||||||
android:textSize="?attr/font_default"
|
|
||||||
android:fontFamily="?attr/font_family"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:drawableStartCompat="@drawable/ic_preview_24dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -76,16 +76,16 @@
|
|||||||
android:visible="false" />
|
android:visible="false" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_edit_flair_view_post_detail_fragment"
|
android:id="@+id/action_block_user_view_post_detail_fragment"
|
||||||
android:orderInCategory="12"
|
android:orderInCategory="12"
|
||||||
android:title="@string/action_edit_flair"
|
android:title="@string/block_user"
|
||||||
app:showAsAction="never"
|
app:showAsAction="never"
|
||||||
android:visible="false" />
|
android:visible="true" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_give_award_view_post_detail_fragment"
|
android:id="@+id/action_block_community_view_post_detail_fragment"
|
||||||
android:orderInCategory="13"
|
android:orderInCategory="13"
|
||||||
android:title="@string/action_give_award"
|
android:title="@string/block_community"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
@ -1347,4 +1347,6 @@
|
|||||||
<string name="mentions">Mentions</string>
|
<string name="mentions">Mentions</string>
|
||||||
<string name="replies">Replies</string>
|
<string name="replies">Replies</string>
|
||||||
<string name="use_circular_fab">Use Circular FAB</string>
|
<string name="use_circular_fab">Use Circular FAB</string>
|
||||||
|
<string name="block_community">Block Community\n</string>
|
||||||
|
<string name="not_implemented">Feature not implemented yet :(</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user