use of org.odk.collect.android.adapters.SortDialogAdapter in project collect by opendatakit.
the class AppListActivity method setupBottomSheet.
private void setupBottomSheet() {
bottomSheetDialog = new BottomSheetDialog(this, R.style.MaterialDialogSheet);
View sheetView = getLayoutInflater().inflate(R.layout.bottom_sheet, null);
final RecyclerView recyclerView = sheetView.findViewById(R.id.recyclerView);
final SortDialogAdapter adapter = new SortDialogAdapter(this, recyclerView, sortingOptions, getSelectedSortingOrder(), new RecyclerViewClickListener() {
@Override
public void onItemClicked(SortDialogAdapter.ViewHolder holder, int position) {
holder.updateItemColor(selectedSortingOrder);
performSelectedSearch(position);
bottomSheetDialog.dismiss();
isBottomDialogShown = false;
}
});
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
recyclerView.setItemAnimator(new DefaultItemAnimator());
bottomSheetDialog.setContentView(sheetView);
if (isBottomDialogShown) {
bottomSheetDialog.show();
}
}
use of org.odk.collect.android.adapters.SortDialogAdapter in project collect by opendatakit.
the class AppListFragment method setupBottomSheet.
private void setupBottomSheet() {
CollectAbstractActivity activity = (CollectAbstractActivity) getActivity();
if (activity == null) {
Timber.e("Activity is null");
return;
}
bottomSheetDialog = new BottomSheetDialog(activity);
View sheetView = getActivity().getLayoutInflater().inflate(R.layout.bottom_sheet, null);
final RecyclerView recyclerView = sheetView.findViewById(R.id.recyclerView);
final SortDialogAdapter adapter = new SortDialogAdapter(getActivity(), recyclerView, sortingOptions, getSelectedSortingOrder(), new RecyclerViewClickListener() {
@Override
public void onItemClicked(SortDialogAdapter.ViewHolder holder, int position) {
holder.updateItemColor(selectedSortingOrder);
performSelectedSearch(position);
bottomSheetDialog.dismiss();
}
});
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
recyclerView.setItemAnimator(new DefaultItemAnimator());
bottomSheetDialog.setContentView(sheetView);
}
use of org.odk.collect.android.adapters.SortDialogAdapter in project collect by opendatakit.
the class AppListActivity method showBottomSheetDialog.
private void showBottomSheetDialog() {
bottomSheetDialog = new BottomSheetDialog(this);
final View sheetView = getLayoutInflater().inflate(R.layout.bottom_sheet, null);
final RecyclerView recyclerView = sheetView.findViewById(R.id.recyclerView);
final SortDialogAdapter adapter = new SortDialogAdapter(this, recyclerView, sortingOptions, getSelectedSortingOrder(), new RecyclerViewClickListener() {
@Override
public void onItemClicked(SortDialogAdapter.ViewHolder holder, int position) {
holder.updateItemColor(selectedSortingOrder);
performSelectedSearch(position);
bottomSheetDialog.dismiss();
}
});
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
recyclerView.setItemAnimator(new DefaultItemAnimator());
bottomSheetDialog.setContentView(sheetView);
bottomSheetDialog.show();
}
Aggregations