use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.
the class AddToListsDialogFragment method onPlaylistsLoaded.
private void onPlaylistsLoaded(List<OdyseeCollection> collections) {
Helper.setViewVisibility(loadProgress, View.INVISIBLE);
CollectionListAdapter adapter = new CollectionListAdapter(collections, getContext());
adapter.setListener(new CollectionListAdapter.CollectionListItemCheckChangedListener() {
@Override
public void onCheckedChanged(OdyseeCollection collection, boolean checked) {
if (!Helper.isNullOrEmpty(url)) {
Context context = getContext();
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
if (checked) {
activity.handleAddUrlToList(url, collection, false);
} else {
activity.handleRemoveUrlFromList(url, collection);
}
}
}
}
});
if (collectionList != null) {
collectionList.setAdapter(adapter);
}
}
use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.
the class CreateSupportDialogFragment method onResume.
@Override
public void onResume() {
super.onResume();
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).addWalletBalanceListener(this);
}
updateInfoText();
fetchChannels();
}
use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.
the class RepostClaimDialogFragment method onPause.
@Override
public void onPause() {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).removeWalletBalanceListener(this);
}
inputDeposit.clearFocus();
super.onPause();
}
use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.
the class RepostClaimDialogFragment method onResume.
@Override
public void onResume() {
super.onResume();
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).addWalletBalanceListener(this);
}
fetchChannels();
}
use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.
the class RepostClaimDialogFragment method fetchChannels.
private void fetchChannels() {
if (Lbry.ownChannels == null || Lbry.ownChannels.size() == 0) {
startLoading();
ClaimListTask task = new ClaimListTask(Claim.TYPE_CHANNEL, repostProgress, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
Lbry.ownChannels = new ArrayList<>(claims);
loadChannels(claims);
finishLoading();
}
@Override
public void onError(Exception error) {
// could not fetch channels
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).showError(error.getMessage());
}
dismiss();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
loadChannels(Lbry.ownChannels);
}
}
Aggregations