Support the mastodon 4 filter api (#3188)

* Replace "warn"-filtered posts in timelines and thread view with placeholders

* Adapt hashtag muting interface

* Rework filter UI

* Add icon for account preferences

* Clean up UI

* WIP: Use chips instead of a list. Adjust padding

* Scroll the filter edit activity

Nested scrolling views (e.g., an activity that scrolls with an embedded list
that also scrolls) can be difficult UI.

Since the list of contexts is fixed, replace it with a fixed collection of
switches, so there's no need to scroll the list.

Since the list of actions is only two (warn, hide), and are mutually
exclusive, replace the spinner with two radio buttons.

Use the accent colour and title styles on the different heading titles in
the layout, to match the presentation in Preferences.

Add an explicit "Cancel" button.

The layout is a straightforward LinearLayout, so use that instead of
ConstraintLayout, and remove some unncessary IDs.

Update EditFilterActivity to handle the new layout.

* Cleanup

* Add more information to the filter list view

* First pass on code review comments

* Add view model to filters activity

* Add view model to edit filters activity

* Only use the status wrapper for filtered statuses

* Relint

---------

Co-authored-by: Nik Clayton <nik@ngo.org.uk>
This commit is contained in:
Levi Bard 2023-03-11 13:12:50 +01:00 committed by GitHub
commit ff8dd37855
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 2770 additions and 631 deletions

View file

@ -412,6 +412,8 @@
<string name="post_media_attachments">Attachments</string>
<string name="status_count_one_plus">1+</string>
<string name="status_created_at_now">now</string>
<string name="status_filtered_show_anyway">Show anyway</string>
<string name="status_filter_placeholder_label_format">Filtered: %s</string>
<string name="state_follow_requested">Follow requested</string>
@ -436,8 +438,9 @@
<string name="pref_title_public_filter_keywords">Public timelines</string>
<string name="pref_title_thread_filter_keywords">Conversations</string>
<string name="filter_addition_dialog_title">Add filter</string>
<string name="filter_edit_dialog_title">Edit filter</string>
<string name="pref_title_account_filter_keywords">Profiles</string>
<string name="filter_addition_title">Add filter</string>
<string name="filter_edit_title">Edit filter</string>
<string name="filter_dialog_remove_button">Remove</string>
<string name="filter_dialog_update_button">Update</string>
<string name="filter_dialog_whole_word">Whole word</string>
@ -760,7 +763,6 @@
<string name="status_edit_info">%1$s edited %2$s</string>
<!--@Tusky created 19th December 2022 13:12 -->
<string name="status_created_info">%1$s created %2$s</string>
<string name="a11y_label_loading_thread">Loading thread</string>
<!--@knossos@fosstodon.org created 2023-01-07 -->
@ -784,4 +786,19 @@
<!-- Success messages, displayed in snackbars, when an action succeeded -->
<string name="ui_success_accepted_follow_request">Follow request accepted</string>
<string name="ui_success_rejected_follow_request">Follow request blocked</string>
<string name="hint_filter_title">My filter</string>
<string name="label_filter_title">Title</string>
<string name="filter_action_warn">Warn</string>
<string name="filter_action_hide">Hide</string>
<string name="filter_description_warn">Hide with a warning</string>
<string name="filter_description_hide">Hide completely</string>
<string name="label_filter_action">Filter action</string>
<string name="label_filter_context">Filter contexts</string>
<string name="label_filter_keywords">Keywords or phrases to filter</string>
<string name="action_add">Add</string>
<string name="filter_keyword_display_format">%s (whole word)</string>
<string name="filter_keyword_addition_title">Add keyword</string>
<string name="filter_edit_keyword_title">Edit keyword</string>
<string name="filter_description_format">%s: %s</string>
</resources>