android-paging

Paging Library Filter/Search

六眼飞鱼酱① 提交于 2019-11-29 20:18:12
I am using the Android Paging Library like described here: https://developer.android.com/topic/libraries/architecture/paging.html But i also have an EditText for searching Users by Name. How can i filter the results from the Paging library to display only matching Users? EDIT from 2019: hold on, I think you might be able to solve this with a MediatorLiveData. Specifically Transformations.switchMap and some additional magic. Currently I was using public void reloadTasks() { if(liveResults != null) { liveResults.removeObserver(this); } liveResults = getFilteredResults(); liveResults