Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add show colored posts option #1455

Open
wants to merge 1 commit into
base: multi-feature
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ protected void buildMenu() {
() -> threadLayout.getPresenter().showRemovedPostsDialog()
)
.withSubItem(R.string.view_my_posts, this::showYourPosts)
.withSubItem(R.string.view_colored_posts, this::showColoredPosts)
.withSubItem(R.string.action_sort, () -> handleSorting(null))
.withSubItem(R.string.action_open_browser, () -> handleShareAndOpenInBrowser(false))
.withSubItem(R.string.action_share, () -> handleShareAndOpenInBrowser(true))
Expand Down Expand Up @@ -183,6 +184,20 @@ public void showYourPosts() {
}
}

public void showColoredPosts() {
if (!threadLayout.getPresenter().isBound() || threadLayout.getPresenter().getChanThread() == null) return;
List<Post> coloredPosts = new ArrayList<>();
for (Post post : threadLayout.getPresenter().getChanThread().getPosts()) {
if (post.filterHighlightedColors.length > 0) coloredPosts.add(post);
}

if (coloredPosts.isEmpty()) {
showToast(context, R.string.no_saved_posts_for_current_thread);
} else {
threadLayout.showPostsPopup(null, coloredPosts);
}
}

@Override
public void onShow() {
super.onShow();
Expand Down
3 changes: 3 additions & 0 deletions Kuroba/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@ Don't have a 4chan Pass?<br>
<string name="view_my_posts">View my posts</string>
<string name="no_saved_posts_for_current_thread">You haven\'t posted in this thread!</string>

<string name="view_colored_posts">View colored posts</string>
<string name="no_colored_posts_for_current_thread">No colored posts in this thread!</string>

<string name="linkable_copied_to_clipboard">Linkable URL copied to clipboard</string>

<string name="options_button_sage">Sage</string>
Expand Down