Search in sources :

Example 1 with FetchInviteStatusTask

use of com.odysee.app.tasks.lbryinc.FetchInviteStatusTask in project odysee-android by OdyseeTeam.

the class InvitesFragment method fetchInviteStatus.

private void fetchInviteStatus() {
    FetchInviteStatusTask task = new FetchInviteStatusTask(progressLoadingStatus, new FetchInviteStatusTask.FetchInviteStatusHandler() {

        @Override
        public void onSuccess(List<Invitee> invitees) {
            if (inviteHistoryAdapter == null) {
                inviteHistoryAdapter = new InviteeListAdapter(invitees, getContext());
                inviteHistoryAdapter.addHeader();
            } else {
                inviteHistoryAdapter.addInvitees(invitees);
            }
            if (inviteHistoryList != null) {
                inviteHistoryList.setAdapter(inviteHistoryAdapter);
            }
            Helper.setViewVisibility(inviteHistoryList, inviteHistoryAdapter == null || inviteHistoryAdapter.getItemCount() < 2 ? View.GONE : View.VISIBLE);
        }

        @Override
        public void onError(Exception error) {
            Helper.setViewVisibility(inviteHistoryList, inviteHistoryAdapter == null || inviteHistoryAdapter.getItemCount() < 2 ? View.GONE : View.VISIBLE);
        }
    });
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Also used : Invitee(com.odysee.app.model.lbryinc.Invitee) FetchInviteStatusTask(com.odysee.app.tasks.lbryinc.FetchInviteStatusTask) InviteeListAdapter(com.odysee.app.adapter.InviteeListAdapter)

Aggregations

InviteeListAdapter (com.odysee.app.adapter.InviteeListAdapter)1 Invitee (com.odysee.app.model.lbryinc.Invitee)1 FetchInviteStatusTask (com.odysee.app.tasks.lbryinc.FetchInviteStatusTask)1