Search in sources :

Example 1 with NoResultsAdapter

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();
}
Also used : RoomFinderRoom(de.tum.in.tumcampusapp.component.tumui.roomfinder.model.RoomFinderRoom) NoResultsAdapter(de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter)

Example 2 with NoResultsAdapter

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));
    }
}
Also used : NoResultsAdapter(de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter) LecturesSearchRow(de.tum.in.tumcampusapp.component.tumui.lectures.model.LecturesSearchRow)

Example 3 with NoResultsAdapter

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();
}
Also used : NoResultsAdapter(de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter) StationResult(de.tum.in.tumcampusapp.component.ui.transportation.model.efa.StationResult)

Example 4 with NoResultsAdapter

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);
    }
}
Also used : NoResultsAdapter(de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter)

Example 5 with NoResultsAdapter

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);
    }
}
Also used : NoResultsAdapter(de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter) ChatRoomListAdapter(de.tum.in.tumcampusapp.component.ui.chat.adapter.ChatRoomListAdapter)

Aggregations

NoResultsAdapter (de.tum.in.tumcampusapp.component.other.generic.adapter.NoResultsAdapter)5 LecturesSearchRow (de.tum.in.tumcampusapp.component.tumui.lectures.model.LecturesSearchRow)1 RoomFinderRoom (de.tum.in.tumcampusapp.component.tumui.roomfinder.model.RoomFinderRoom)1 ChatRoomListAdapter (de.tum.in.tumcampusapp.component.ui.chat.adapter.ChatRoomListAdapter)1 StationResult (de.tum.in.tumcampusapp.component.ui.transportation.model.efa.StationResult)1