use of de.westnordost.streetcomplete.view.GroupedImageSelectAdapter in project StreetComplete by westnordost.
the class AddRoadSurfaceForm method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
View contentView = setContentView(R.layout.quest_street_surface);
RecyclerView surfaceSelect = contentView.findViewById(R.id.surfaceSelect);
GridLayoutManager lm = new GridLayoutManager(getActivity(), 3);
surfaceSelect.setLayoutManager(lm);
surfaceSelect.setNestedScrollingEnabled(false);
imageSelector = new GroupedImageSelectAdapter(lm);
imageSelector.setItems(Arrays.asList(TOP_SURFACES));
surfaceSelect.setAdapter(imageSelector);
Button showMoreButton = contentView.findViewById(R.id.buttonShowMore);
showMoreButton.setOnClickListener(v -> {
imageSelector.setItems(Arrays.asList(ALL_SURFACES));
showMoreButton.setVisibility(View.GONE);
});
return view;
}
Aggregations