chinwag-android/app/src/main/java/com/keylesspalace/tusky
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
..
adapter Show a close button for hashtag tab chips (#3140) 2023-01-09 21:24:37 +01:00
appstore improve logout (#2579) 2022-06-20 16:45:54 +02:00
components Improve the actual and perceived speed of thread loading (#3118) 2023-01-09 21:31:31 +01:00
db Improve the actual and perceived speed of thread loading (#3118) 2023-01-09 21:31:31 +01:00
di show status edits (#3049) 2023-01-02 14:09:18 +01:00
entity show status edits (#3049) 2023-01-02 14:09:18 +01:00
fragment Improve muted users list (#3127) 2023-01-02 14:09:40 +01:00
interfaces show status edits (#3049) 2023-01-02 14:09:18 +01:00
json don't crash on unparseable date (#3129) 2023-01-09 21:24:04 +01:00
network show status edits (#3049) 2023-01-02 14:09:18 +01:00
pager move AccountActivity and related classes to a new package (#2216) 2022-01-11 19:55:17 +01:00
receiver Handoff media upload (#2947) 2022-12-29 19:58:23 +01:00
service Handoff media upload (#2947) 2022-12-29 19:58:23 +01:00
settings 2952/proxy (#2961) 2022-12-07 19:29:18 +01:00
usecase Remove rxjava from API calls used by AccountViewModel::changeRelationship() (#3008) 2022-12-28 19:06:31 +01:00
util Add new mastodon status url format to looksLikeMastodonUrl. (#3136) 2023-01-09 21:07:22 +01:00
view Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046) 2022-12-31 13:01:35 +01:00
viewdata show status edits (#3049) 2023-01-02 14:09:18 +01:00
viewmodel Handle even more instance defaults (#2612) 2022-07-26 20:24:50 +02:00
AboutActivity.kt add ktlint plugin to project and apply default code style (#2209) 2021-06-28 21:13:24 +02:00
AccountListActivity.kt revert CompatExtensions (#2773) 2022-11-09 19:32:54 +01:00
AccountsInListFragment.kt migrate Lists from RxJava to Kotlin coroutines (#2537) 2022-05-18 18:45:35 +02:00
BaseActivity.java Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046) 2022-12-31 13:01:35 +01:00
BottomSheetActivity.kt Load goto social and microblog.pub urls in the app (#2945) 2022-12-03 12:16:17 +01:00
EditProfileActivity.kt Handle even more instance defaults (#2612) 2022-07-26 20:24:50 +02:00
FiltersActivity.kt Implement getFilters() without rxjava (#2990) 2022-12-07 19:30:53 +01:00
LicenseActivity.kt migrate IOUtils to Kotlin (#2763) 2022-11-07 20:10:06 +01:00
ListsActivity.kt Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046) 2022-12-31 13:01:35 +01:00
MainActivity.kt Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046) 2022-12-31 13:01:35 +01:00
SplashActivity.kt remove legacy notification channel cleanup (#2550) 2022-05-25 20:54:25 +02:00
StatusListActivity.kt Fix tests (#3022) 2022-12-08 09:58:58 +01:00
TabData.kt Replace the default federated timeline tab with the direct messages tab. (#2866) 2022-11-19 19:01:00 +01:00
TabPreferenceActivity.kt Api 33 support (#2719) 2022-11-04 19:22:38 +01:00
TuskyApplication.kt Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046) 2022-12-31 13:01:35 +01:00
ViewMediaActivity.kt Support a swipe down to dismiss video (#2879) 2022-12-05 14:33:38 +01:00