use of net.osmand.plus.base.SelectionBottomSheet.SelectableItem in project Osmand by osmandapp.
the class SelectIndexesHelper method showMultipleSelectionDialog.
private void showMultipleSelectionDialog() {
MultipleDownloadItem mdi = (MultipleDownloadItem) downloadItem;
List<SelectableItem<DownloadItem>> allItems = new ArrayList<>();
List<SelectableItem<DownloadItem>> selectedItems = new ArrayList<>();
for (DownloadItem di : mdi.getAllItems()) {
SelectableItem<DownloadItem> si = createSelectableItem(di);
allItems.add(si);
if (itemsToDownload.contains(di)) {
selectedItems.add(si);
}
}
MultipleSelectionBottomSheet<DownloadItem> msDialog = MultipleSelectionBottomSheet.showInstance(activity, allItems, selectedItems, true);
this.dialog = msDialog;
msDialog.setDialogStateListener(new DialogStateListener() {
@Override
public void onDialogCreated() {
dialog.setTitle(app.getString(R.string.welmode_download_maps));
}
@Override
public void onCloseDialog() {
}
});
msDialog.setSelectionUpdateListener(this::updateSize);
msDialog.setOnApplySelectionListener(getOnApplySelectionListener(listener));
}
Aggregations