use of org.musicbrainz.mobile.adapter.list.CollectionListAdapter in project musicbrainz-android by jdamcd.
the class CollectionListFragment method onListItemClick.
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
CollectionListAdapter adapter = (CollectionListAdapter) getListAdapter();
String title = adapter.getItem(position).getName();
String mbid = adapter.getItem(position).getMbid();
startActivity(IntentFactory.getCollection(appContext, title, mbid));
}
use of org.musicbrainz.mobile.adapter.list.CollectionListAdapter in project musicbrainz-android by jdamcd.
the class CollectionAddDialog method onLoadFinished.
@Override
public void onLoadFinished(Loader<AsyncResult<List<UserCollectionInfo>>> loader, AsyncResult<List<UserCollectionInfo>> result) {
loading.setVisibility(View.GONE);
switch(result.getStatus()) {
case SUCCESS:
List<UserCollectionInfo> collection = result.getData();
try {
adapter = new CollectionListAdapter(getActivity(), collection);
if (adapter.isEmpty()) {
empty.setVisibility(View.VISIBLE);
}
list.setAdapter(adapter);
} catch (Exception e) {
// Fragment not connected.
}
break;
case EXCEPTION:
showConnectionErrorWarning();
}
}
Aggregations