android10 / android10/Android-CleanArchitecture

Clean Architecture with Large Cursor

未關閉
#264 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Java
星號
15.5k
分支
3.3k
PR 合併指標
30 天內沒有已合併 PR

描述

I have an app that has a recyclerview. The recyclerview loads data using an custom adapter. If we set in our adapter a cursor with large data (For example 3000 rows) the recyclerview scrolls smoothly. If we set in our adapter a list of objects (even a small amount, like 500 objects) the recyclerview lags on scroll. I suppose that the reason is that we consume a lot of resources by this approach and also the cursor uses a window and not a reference to all the data.

My question is how to handle this situation? Before using clean architecture i just passed the cursor to the recyclerview and everything worked ok. After using rxJava I create an object in every onNext call and keep them in a list.

Also there is another problem. The domain layer does not have reference to android classes. As a result I can not have Observable in order to pass it to presentation layer. Is the best way to keep an unchecked observable? Is there any different approach (For example any rxJava operator)?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。