Search in sources :

Example 11 with ClaimListTask

use of com.odysee.app.tasks.claim.ClaimListTask in project odysee-android by OdyseeTeam.

the class PublishFormFragment method fetchChannels.

private void fetchChannels() {
    if (Lbry.ownChannels != null && Lbry.ownChannels.size() > 0) {
        updateChannelList(Lbry.ownChannels);
        return;
    }
    fetchingChannels = true;
    disableChannelSpinner();
    ClaimListTask task = new ClaimListTask(Claim.TYPE_CHANNEL, progressLoadingChannels, new ClaimListResultHandler() {

        @Override
        public void onSuccess(List<Claim> claims) {
            Lbry.ownChannels = new ArrayList<>(claims);
            updateChannelList(Lbry.ownChannels);
            enableChannelSpinner();
            fetchingChannels = false;
        }

        @Override
        public void onError(Exception error) {
            enableChannelSpinner();
            fetchingChannels = false;
        }
    });
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Also used : ClaimListResultHandler(com.odysee.app.tasks.claim.ClaimListResultHandler) ClaimListTask(com.odysee.app.tasks.claim.ClaimListTask) Claim(com.odysee.app.model.Claim) JSONException(org.json.JSONException)

Aggregations

Claim (com.odysee.app.model.Claim)11 ClaimListResultHandler (com.odysee.app.tasks.claim.ClaimListResultHandler)11 ClaimListTask (com.odysee.app.tasks.claim.ClaimListTask)11 ApiCallException (com.odysee.app.exceptions.ApiCallException)6 ArrayList (java.util.ArrayList)5 JSONException (org.json.JSONException)5 LbryioRequestException (com.odysee.app.exceptions.LbryioRequestException)4 LbryioResponseException (com.odysee.app.exceptions.LbryioResponseException)4 ExecutionException (java.util.concurrent.ExecutionException)4 Context (android.content.Context)3 MainActivity (com.odysee.app.MainActivity)3 LbryUriException (com.odysee.app.exceptions.LbryUriException)3 SQLiteException (android.database.sqlite.SQLiteException)2 ClaimListAdapter (com.odysee.app.adapter.ClaimListAdapter)2 AuthTokenInvalidatedException (com.odysee.app.exceptions.AuthTokenInvalidatedException)2 IOException (java.io.IOException)2 ParseException (java.text.ParseException)2 Account (android.accounts.Account)1 AccountManager (android.accounts.AccountManager)1 View (android.view.View)1