use of de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter in project TumCampusApp by TCA-Team.
the class RoomFinderActivity method onSearchFinished.
@Override
protected void onSearchFinished(Optional<List<RoomFinderRoom>> result) {
if (!result.isPresent()) {
if (NetUtils.isConnected(this)) {
showErrorLayout();
} else {
showNoInternetLayout();
}
return;
}
List<RoomFinderRoom> searchResult = result.get();
if (searchResult.isEmpty()) {
list.setAdapter(new NoResultsAdapter(this));
} else {
adapter = new RoomFinderListAdapter(this, searchResult);
list.setAdapter(adapter);
}
showLoadingEnded();
}
use of de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter in project TumCampusApp by TCA-Team.
the class LecturesPersonalActivity method onLoadFinished.
@Override
public void onLoadFinished(LecturesSearchRowSet response) {
if (response == null || response.getLehrveranstaltungen() == null) {
// no results found
lvMyLecturesList.setAdapter(new NoResultsAdapter(this));
} else {
// Sort lectures by semester id
List<LecturesSearchRow> lectures = response.getLehrveranstaltungen();
Collections.sort(lectures);
// set ListView to data via the LecturesListAdapter
lvMyLecturesList.setAdapter(LecturesListAdapter.newInstance(this, lectures));
}
}
use of de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter in project TumCampusApp by TCA-Team.
the class MVVWidgetConfigureActivity method onSearchFinished.
/**
* Shows the stations
*
* @param possibleStationList list of possible StationResult
*/
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
@Override
protected void onSearchFinished(Optional<List<StationResult>> possibleStationList) {
if (!possibleStationList.isPresent()) {
return;
}
List<StationResult> stationResultList = possibleStationList.get();
showLoadingEnded();
// mQuery is not null if it was a real search
if (stationResultList.isEmpty()) {
// So show no results found
listViewResults.setAdapter(new NoResultsAdapter(this));
listViewResults.requestFocus();
return;
}
adapterStations.clear();
adapterStations.addAll(stationResultList);
adapterStations.notifyDataSetChanged();
listViewResults.setAdapter(adapterStations);
listViewResults.requestFocus();
}
use of de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter in project TumCampusApp by TCA-Team.
the class CardsActivity method onLoadFinished.
@Override
protected void onLoadFinished(List<StudyCard> cards) {
showLoadingEnded();
if (cards.size() == 0) {
binding.cardList.setAdapter(new NoResultsAdapter(this));
} else {
StudyCardListAdapter adapter = new StudyCardListAdapter(this, cards);
binding.cardList.setAdapter(adapter);
}
}
use of de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter in project TumCampusApp by TCA-Team.
the class ChatRoomsActivity method onLoadFinished.
@Override
protected void onLoadFinished(List<ChatRoomAndLastMessage> result) {
showLoadingEnded();
if (result.isEmpty()) {
lvMyChatRoomList.setAdapter(new NoResultsAdapter(this));
} else {
// set ListView to data via the LecturesListAdapter
chatRoomAdapter = new ChatRoomListAdapter(this, result, mCurrentMode);
lvMyChatRoomList.setAdapter(chatRoomAdapter);
}
}
Aggregations