mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Nearby: make list resize and display message when empty (#3746)
* Nearby: make list resize and display message when empty * refactored and renamed for clarity * refactoring and simplifying based on comments * refactoring and simplifying based on comments * removing vertical orientation
This commit is contained in:
parent
fbd057b87e
commit
7084fd2535
3 changed files with 22 additions and 3 deletions
|
|
@ -154,6 +154,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
MapView mapView;
|
||||
@BindView(R.id.rv_nearby_list)
|
||||
RecyclerView rvNearbyList;
|
||||
@BindView(R.id.no_results_message) TextView noResultsView;
|
||||
|
||||
@Inject LocationServiceManager locationManager;
|
||||
@Inject NearbyController nearbyController;
|
||||
|
|
@ -626,6 +627,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
@Override
|
||||
public void updateListFragment(List<Place> placeList) {
|
||||
adapterFactory.updateAdapterData(placeList, (RVRendererAdapter<Place>) rvNearbyList.getAdapter());
|
||||
noResultsView.setVisibility(placeList.size() <= 0 ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
public void clearNearbyList() {
|
||||
|
|
@ -634,6 +636,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
|
||||
public void updateNearbyList() {
|
||||
adapterFactory.update((RVRendererAdapter<Place>) rvNearbyList.getAdapter());
|
||||
noResultsView.setVisibility(rvNearbyList.getAdapter().getItemCount() <= 0 ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
public void addPlaceToNearbyList(Place place) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue