mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Add update nearby items with location change methods to list fragment too
This commit is contained in:
parent
35fe1a5d89
commit
1cc1efe182
2 changed files with 10 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import java.util.List;
|
|||
|
||||
class NearbyAdapterFactory {
|
||||
|
||||
|
||||
NearbyAdapterFactory(){
|
||||
|
||||
}
|
||||
|
|
@ -20,4 +21,9 @@ class NearbyAdapterFactory {
|
|||
placeList != null ? placeList : Collections.emptyList());
|
||||
return new RVRendererAdapter<>(builder, collection);
|
||||
}
|
||||
|
||||
public void updateAdapterData(List<Place> newPlaceList, RVRendererAdapter<Place> rendererAdapter) {
|
||||
rendererAdapter.notifyDataSetChanged();
|
||||
rendererAdapter.diffUpdate(newPlaceList);
|
||||
}
|
||||
}
|
||||
|
|
@ -71,4 +71,8 @@ public class NearbyListFragment extends DaggerFragment {
|
|||
|
||||
recyclerView.setAdapter(adapterFactory.create(placeList));
|
||||
}
|
||||
|
||||
public void updateNearbyListSignificantly() {
|
||||
adapterFactory.updateAdapterData();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue