TakefiveInteractive/Ledger-Android

UI Lists' lag

Opened this issue · 2 comments

The cause seems to be loading Realm in UI Thread. However, even if loading Realm in UI is avoided, the asynchronous procedure of refreshing any list item just due to scrolling is not acceptable.

We could fix this by loading full data in before enabling ListAdapters or rendering lists.

An example of such an issue appears in MainBillFragment. It was solved in f5f1b28.

But we still have many other fragments to fix.

Steps:

  1. Change a function signature in some IView: avoid passing in RawXXX and pass ShownXXX instead, which should contain all the data needed to inflate the view (it's fine for images to be given by URL, though)
  2. Fix related function implementations. And move the code fetching extra data from Views to Presenters.