use of com.odysee.app.tasks.lbryinc.FetchStatCountTask in project odysee-android by OdyseeTeam.
the class FileViewFragment method loadViewCount.
private void loadViewCount() {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
FetchStatCountTask task = new FetchStatCountTask(FetchStatCountTask.STAT_VIEW_COUNT, actualClaim.getClaimId(), null, new FetchStatCountTask.FetchStatCountHandler() {
@Override
public void onSuccess(int count) {
try {
String displayText = getResources().getQuantityString(R.plurals.view_count, count, NumberFormat.getInstance().format(count));
View root = getView();
if (root != null) {
TextView textViewCount = root.findViewById(R.id.file_view_view_count);
Helper.setViewText(textViewCount, displayText);
Helper.setViewVisibility(textViewCount, View.VISIBLE);
}
} catch (IllegalStateException ex) {
// pass
}
}
@Override
public void onError(Exception error) {
// pass
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
use of com.odysee.app.tasks.lbryinc.FetchStatCountTask in project odysee-android by OdyseeTeam.
the class ChannelFragment method loadSubCount.
private void loadSubCount() {
if (claim != null) {
FetchStatCountTask task = new FetchStatCountTask(FetchStatCountTask.STAT_SUB_COUNT, claim.getClaimId(), null, new FetchStatCountTask.FetchStatCountHandler() {
@Override
public void onSuccess(int count) {
try {
String displayText = getResources().getQuantityString(R.plurals.follower_count, count, NumberFormat.getInstance().format(count));
Helper.setViewText(textFollowerCount, displayText);
Helper.setViewVisibility(textFollowerCount, View.VISIBLE);
} catch (IllegalStateException ex) {
// pass
}
}
@Override
public void onError(Exception error) {
// pass
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
Aggregations