chinwag-android/app/src/main/res/layout
Nik Clayton c650ca9362
Improve the actual and perceived speed of thread loading (#3118)
* Improve the actual and perceived speed of thread loading

To improve the actual speed, note that if the user has opened a thread from
their home timeline then the initial status is cached in the database. Other
statuses in the same thread may be cached as well.

So try and load the initial status from the database, falling back to the
network if it's not present (e.g., the user has opened a thread from the
local or federated timelines, or a search).

Introduce a new loading state to deal with this case.

In typical cases this allows the UI to display the initial status immediately
with no need to show a progress indicator.

To improve the perceived speed, delay showing the initial loading circular
progress indicators by 500ms. If loading the initial status completes within
that time no spinner is shown and the user will perceive the action as
close-to-immediate
(https://www.nngroup.com/articles/response-times-3-important-limits/).

Additionally, introduce an extra indeterminate progress indicator.

The new indicator is linear, anchored to the bottom of the screen, and shows
progress loading ancestor/descendant statuses. Like the other indicator is
also delayed 500ms from when ancestor/descendant status information is
fetched, and if the fetch completes in that time it will not be shown.

* Mark `getStatus` as suspend so it doesn't run on the main thread

* Save an allocation, use an isDetailed parameter to TimelineStatusWithAccount.toViewData

Rename Status.toViewData's "detailed" parameter to "isDetailed" for
consistency with other uses.

* Ensure suspend functions run to completion when testing

* Delay-load the status from the network even if it's cached

This speeds up the UI while ensuring it will eventually contain accurate data
from the remote.

* Load the network status before updating the list

Avoids excess animations if the network copy has changes

* Fix UI flicker when loading reblogged statuses

* Lint

* Fixup tests
2023-01-09 21:31:31 +01:00
..
activity_about.xml migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
activity_account.xml #2752: enable to copy the profile bio and its account fields (#2756) 2022-11-07 19:57:58 +01:00
activity_account_list.xml migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
activity_announcements.xml migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
activity_compose.xml 2890 show warning on missing description (#2919) 2022-12-06 19:28:44 +01:00
activity_drafts.xml Drafts v2 (#2032) 2021-01-21 18:57:09 +01:00
activity_edit_profile.xml update Android Image Cropper and get rid of deprecated onActivityResult (#2351) 2022-03-02 20:39:56 +01:00
activity_filters.xml migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
activity_followed_tags.xml Add view for browsing and unfollowing followed hashtags (#2794) 2022-12-01 19:24:27 +01:00
activity_license.xml update licenses (#2315) 2022-02-04 21:59:42 +01:00
activity_lists.xml migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
activity_login.xml Implement Login via WebView (#2371) 2022-03-08 21:22:19 +01:00
activity_login_webview.xml show rules on the login screen (#2746) 2022-11-05 17:37:20 +01:00
activity_main.xml Show Avatar next to tabs when main top bar is disabled (#2973) 2022-12-03 12:16:54 +01:00
activity_preferences.xml migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
activity_report.xml migrating to ViewBinding part 2: Activities (#2093) 2021-03-07 19:05:51 +01:00
activity_scheduled_status.xml Rename Toots to Posts (#2396) 2022-03-20 20:21:42 +01:00
activity_search.xml never collapse tabs in SearchActivity (#2505) 2022-05-17 19:37:09 +02:00
activity_statuslist.xml merge ModalTimelineActivity & ViewTagActivity into StatusListActivity (#2332) 2022-02-25 18:57:31 +01:00
activity_tab_preference.xml add content description to add tab button (#2910) 2022-11-23 20:06:35 +01:00
activity_view_media.xml Theme refactoring (#1656) 2020-01-30 21:37:28 +01:00
activity_view_thread.xml rewrite threads with Kotlin & coroutines (#2617) 2022-08-15 11:00:18 +02:00
card_license.xml explicitly set text colors in LicenseCard (#1910) 2020-08-26 18:46:44 +02:00
dialog_add_poll.xml Instance configuration: the easy parts (#2341) 2022-03-01 19:43:36 +01:00
dialog_filter.xml Support setting filter expirations (#2667) 2022-08-17 17:50:34 +02:00
dialog_focus.xml Add a description to the focus dialog (#2711) 2022-10-15 19:04:27 +02:00
dialog_mute_account.xml migrating to ViewBinding part 1: Dialogs + Views (#2091) 2021-03-07 19:04:22 +01:00
fragment_account_list.xml Error artwork (#1000) 2019-01-28 19:02:31 +01:00
fragment_accounts_in_list.xml fix list editing by moving account_ids from query to form param (#1690) 2020-02-18 08:45:10 +01:00
fragment_instance_list.xml Implement instance mutes (#1311) 2019-06-11 15:56:27 +02:00
fragment_lists_for_account.xml Add done button to lists dialog 2022-11-16 21:54:11 +09:00
fragment_report_done.xml Redesign report activity (#1295) 2019-06-09 16:55:34 +02:00
fragment_report_note.xml Theme refactoring (#1656) 2020-01-30 21:37:28 +01:00
fragment_report_statuses.xml Redesign report activity (#1295) 2019-06-09 16:55:34 +02:00
fragment_search.xml migrating to ViewBinding part 4: Fragments (#2108) 2021-03-13 21:27:20 +01:00
fragment_timeline.xml migrating to ViewBinding part 4: Fragments (#2108) 2021-03-13 21:27:20 +01:00
fragment_timeline_notifications.xml remove scrolling from notification options bar (#1858) 2020-07-20 11:25:36 +02:00
fragment_view_image.xml Left-align image alt text & make it selectable (#3063) 2022-12-30 11:20:25 +01:00
fragment_view_thread.xml Improve the actual and perceived speed of thread loading (#3118) 2023-01-09 21:31:31 +01:00
fragment_view_video.xml Audio caption improvements (#2220) 2021-09-17 21:55:54 +02:00
item_account.xml Convert AccountViewHolder from Java to Kotlin (#3044) 2022-12-28 19:07:43 +01:00
item_account_field.xml #2752: enable to copy the profile bio and its account fields (#2756) 2022-11-07 19:57:58 +01:00
item_account_media.xml AccountMediaFragment improvements (#2684) 2022-09-02 16:52:47 +02:00
item_add_or_remove_from_list.xml Update dialog colors 2022-11-16 20:55:36 +09:00
item_add_poll_option.xml Theme refactoring (#1656) 2020-01-30 21:37:28 +01:00
item_announcement.xml add content description to add reaction button (#2838) 2022-11-16 19:04:12 +01:00
item_autocomplete_account.xml modernize autocomplete (#2510) 2022-05-17 19:55:37 +02:00
item_autocomplete_emoji.xml modernize autocomplete (#2510) 2022-05-17 19:55:37 +02:00
item_autocomplete_hashtag.xml modernize autocomplete (#2510) 2022-05-17 19:55:37 +02:00
item_blocked_user.xml New emoji picker (#2395) 2022-04-26 18:50:58 +02:00
item_conversation.xml show status edits (#3049) 2023-01-02 14:09:18 +01:00
item_draft.xml New emoji picker (#2395) 2022-04-26 18:50:58 +02:00
item_edit_field.xml Handle even more instance defaults (#2612) 2022-07-26 20:24:50 +02:00
item_emoji_button.xml ComposeActivity improvements (#548) 2018-04-13 22:37:21 +02:00
item_emoji_pref.xml migrating to ViewBinding part 3: EmojiPreference (#2094) 2021-03-07 19:06:05 +01:00
item_follow.xml New emoji picker (#2395) 2022-04-26 18:50:58 +02:00
item_follow_request.xml Increase the size of the accept/reject follow buttons (#2987) 2022-12-05 14:44:32 +01:00
item_follow_requests_header.xml always show follow requests in main menu (#1809) 2021-04-10 20:30:44 +02:00
item_followed_hashtag.xml Add view for browsing and unfollowing followed hashtags (#2794) 2022-12-01 19:24:27 +01:00
item_footer.xml fix account list loading and clean up a lot of code (#823) 2018-08-31 21:52:09 +02:00
item_hashtag.xml migrating to ViewBinding part 4: Adapters (#2095) 2021-03-07 19:24:01 +01:00
item_image_preview_overlay.xml issue 2890: Add an "ALT" sticker to the media preview container (#2942) 2022-12-18 16:50:30 +01:00
item_list.xml Theme refactoring (#1656) 2020-01-30 21:37:28 +01:00
item_media_preview.xml issue 2890: Add an "ALT" sticker to the media preview container (#2942) 2022-12-18 16:50:30 +01:00
item_muted_domain.xml Theme refactoring (#1656) 2020-01-30 21:37:28 +01:00
item_muted_user.xml Improve muted users list (#3127) 2023-01-02 14:09:40 +01:00
item_network_state.xml Tab customization & direct messages tab (#1012) 2019-02-12 19:22:37 +01:00
item_picker_list.xml migrating to ViewBinding part 4: Adapters (#2095) 2021-03-07 19:24:01 +01:00
item_poll.xml show status edits (#3049) 2023-01-02 14:09:18 +01:00
item_poll_preview_option.xml remove ThemeUtils.getTintedDrawable (#2015) 2020-12-09 19:08:16 +01:00
item_report_notification.xml Add support for moderation report notifications (#2887) 2022-12-01 20:11:55 +01:00
item_report_status.xml New emoji picker (#2395) 2022-04-26 18:50:58 +02:00
item_scheduled_status.xml New emoji picker (#2395) 2022-04-26 18:50:58 +02:00
item_status.xml show status edits (#3049) 2023-01-02 14:09:18 +01:00
item_status_bottom_sheet.xml Upgrade to AndroidX, move to MaterialComponents theme (#953) 2018-12-17 15:25:35 +01:00
item_status_detailed.xml show status edits (#3049) 2023-01-02 14:09:18 +01:00
item_status_edit.xml show status edits (#3049) 2023-01-02 14:09:18 +01:00
item_status_notification.xml show status edits (#3049) 2023-01-02 14:09:18 +01:00
item_status_placeholder.xml #2177 enhance 'show more' visibility (#2765) 2022-11-07 20:18:33 +01:00
item_tab_preference.xml remove ThemeUtils.getTintedDrawable (#2015) 2020-12-09 19:08:16 +01:00
item_tab_preference_small.xml remove ThemeUtils.getTintedDrawable (#2015) 2020-12-09 19:08:16 +01:00
material_drawer_header.xml convert MainActivity to Kotlin and upgrade MaterialDrawer to version 8 (#1748) 2020-04-15 18:57:53 +02:00
notifications_filter.xml Ensure the "Apply" button is always visible (#3004) 2022-12-06 20:31:16 +01:00
search_view.xml Upgrade to AndroidX, move to MaterialComponents theme (#953) 2018-12-17 15:25:35 +01:00
toolbar_basic.xml Drafts v2 (#2032) 2021-01-21 18:57:09 +01:00
view_background_message.xml Make image in BackgroundMessageView adapt to the height, fix #1618 (#1649) 2020-02-25 19:57:28 +01:00
view_compose_options.xml simplify ComposeOptionsView (#1734) 2020-03-24 21:07:10 +01:00
view_compose_schedule.xml remove ThemeUtils.getTintedDrawable (#2015) 2020-12-09 19:08:16 +01:00
view_poll_preview.xml Create polls (#1452) 2019-08-22 20:30:08 +02:00