Search in sources :

Example 1 with FileArrayAdapter

use of org.odk.collect.android.adapters.FileArrayAdapter in project collect by opendatakit.

the class GoogleDriveActivity method updateAdapter.

@Override
protected void updateAdapter() {
    CharSequence charSequence = getFilterText();
    filteredList.clear();
    if (charSequence.length() > 0) {
        for (DriveListItem item : driveList) {
            if (item.getName().toLowerCase(Locale.US).contains(charSequence.toString().toLowerCase(Locale.US))) {
                filteredList.add(item);
            }
        }
    } else {
        filteredList.addAll(driveList);
    }
    sortList();
    if (adapter == null) {
        adapter = new FileArrayAdapter(this, filteredList);
        listView.setAdapter(adapter);
    } else {
        adapter.notifyDataSetChanged();
    }
    adapter.notifyDataSetChanged();
    checkPreviouslyCheckedItems();
}
Also used : DriveListItem(org.odk.collect.android.logic.DriveListItem) FileArrayAdapter(org.odk.collect.android.adapters.FileArrayAdapter)

Aggregations

FileArrayAdapter (org.odk.collect.android.adapters.FileArrayAdapter)1 DriveListItem (org.odk.collect.android.logic.DriveListItem)1