use of com.odysee.app.tasks.claim.ClaimListTask in project odysee-android by OdyseeTeam.
the class MainActivity method fetchOwnChannels.
public void fetchOwnChannels() {
ClaimListTask task = new ClaimListTask(Claim.TYPE_CHANNEL, null, Lbryio.AUTH_TOKEN, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
Lbry.ownChannels = Helper.filterDeletedClaims(new ArrayList<>(claims));
for (FetchChannelsListener listener : fetchChannelsListeners) {
listener.onChannelsFetched(claims);
}
}
@Override
public void onError(Exception error) {
Log.e("FetchingChannels", "onError: ".concat(error.getLocalizedMessage()));
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
use of com.odysee.app.tasks.claim.ClaimListTask in project odysee-android by OdyseeTeam.
the class FileViewFragment method fetchChannels.
private void fetchChannels() {
if (Lbry.ownChannels != null && !Lbry.ownChannels.isEmpty()) {
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);
}
use of com.odysee.app.tasks.claim.ClaimListTask in project odysee-android by OdyseeTeam.
the class CreateSupportDialogFragment method fetchChannels.
private void fetchChannels() {
if (Lbry.ownChannels != null && !Lbry.ownChannels.isEmpty()) {
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);
}
use of com.odysee.app.tasks.claim.ClaimListTask in project odysee-android by OdyseeTeam.
the class FirstRunActivity method checkChannelStep.
private void checkChannelStep() {
ClaimListTask task = new ClaimListTask(Claim.TYPE_CHANNEL, null, Lbryio.AUTH_TOKEN, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
onRequestInProgress(false);
if (claims.size() == 0) {
// no channels, move to first run step: channel
checkEmailVerifiedRewardForChannelStep();
} else {
// this user already has a channel, move to the final step: rewards verification
proceedToRewardsStep();
}
}
@Override
public void onError(Exception error) {
checkEmailVerifiedRewardForChannelStep();
// onRequestCompleted(FIRST_RUN_STEP_CHANNEL);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
use of com.odysee.app.tasks.claim.ClaimListTask in project odysee-android by OdyseeTeam.
the class LibraryFragment method fetchOwnClaimsAndShowDownloads.
private void fetchOwnClaimsAndShowDownloads() {
if (Lbry.ownClaims != null && Lbry.ownClaims.size() > 0) {
initialOwnClaimsFetched = true;
fetchDownloads();
return;
}
linkStats.setVisibility(View.INVISIBLE);
ClaimListTask task = new ClaimListTask(Arrays.asList(Claim.TYPE_STREAM, Claim.TYPE_REPOST), listLoading, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
Lbry.ownClaims = Helper.filterDeletedClaims(new ArrayList<>(claims));
initialOwnClaimsFetched = true;
if (currentFilter == FILTER_DOWNLOADS) {
fetchDownloads();
}
checkStatsLink();
}
@Override
public void onError(Exception error) {
initialOwnClaimsFetched = true;
checkStatsLink();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Aggregations