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();
}
Aggregations