Search in sources :

Example 1 with QuickSearchSelectAllListItem

use of net.osmand.plus.search.listitems.QuickSearchSelectAllListItem in project Osmand by osmandapp.

the class QuickSearchListAdapter method setSelectionMode.

public void setSelectionMode(boolean selectionMode, int position) {
    this.selectionMode = selectionMode;
    selectAll = false;
    selectedItems.clear();
    if (position != -1) {
        QuickSearchListItem item = getItem(position);
        selectedItems.add(item);
    }
    if (selectionMode) {
        QuickSearchSelectAllListItem selectAllListItem = new QuickSearchSelectAllListItem(app, null, null);
        insertListItem(selectAllListItem, 0);
        if (selectionListener != null) {
            selectionListener.onUpdateSelectionMode(selectedItems);
        }
    } else {
        if (selectionListener != null) {
            selectionListener.reloadData();
        }
    }
// notifyDataSetInvalidated();
}
Also used : QuickSearchListItem(net.osmand.plus.search.listitems.QuickSearchListItem) QuickSearchSelectAllListItem(net.osmand.plus.search.listitems.QuickSearchSelectAllListItem)

Aggregations

QuickSearchListItem (net.osmand.plus.search.listitems.QuickSearchListItem)1 QuickSearchSelectAllListItem (net.osmand.plus.search.listitems.QuickSearchSelectAllListItem)1