Search in sources :

Example 16 with Subscription

use of com.odysee.app.model.lbryinc.Subscription in project odysee-android by OdyseeTeam.

the class FollowingFragment method onChannelItemSelected.

public void onChannelItemSelected(Claim claim) {
    // subscribe
    Subscription subscription = Subscription.fromClaim(claim);
    String channelClaimId = claim.getClaimId();
    ChannelSubscribeTask task = new ChannelSubscribeTask(getContext(), channelClaimId, subscription, false, new ChannelSubscribeTask.ChannelSubscribeHandler() {

        @Override
        public void onSuccess() {
            Lbryio.addSubscription(subscription);
            Lbryio.addCachedResolvedSubscription(claim);
            resetClaimSearchContent = true;
            fetchLoadedSubscriptions(subscriptionsShown);
            saveSharedUserState();
        }

        @Override
        public void onError(Exception error) {
        }
    });
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    updateSuggestedDoneButtonText();
}
Also used : ChannelSubscribeTask(com.odysee.app.tasks.lbryinc.ChannelSubscribeTask) Subscription(com.odysee.app.model.lbryinc.Subscription) JSONException(org.json.JSONException) LbryUriException(com.odysee.app.exceptions.LbryUriException)

Aggregations

Subscription (com.odysee.app.model.lbryinc.Subscription)16 LbryUriException (com.odysee.app.exceptions.LbryUriException)10 JSONException (org.json.JSONException)9 LbryUri (com.odysee.app.utils.LbryUri)8 ArrayList (java.util.ArrayList)7 SQLiteException (android.database.sqlite.SQLiteException)5 MainActivity (com.odysee.app.MainActivity)5 ApiCallException (com.odysee.app.exceptions.ApiCallException)5 ChannelSubscribeTask (com.odysee.app.tasks.lbryinc.ChannelSubscribeTask)5 JSONObject (org.json.JSONObject)5 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)4 Context (android.content.Context)3 Intent (android.content.Intent)3 CustomTabsIntent (androidx.browser.customtabs.CustomTabsIntent)3 LbryioRequestException (com.odysee.app.exceptions.LbryioRequestException)3 LbryioResponseException (com.odysee.app.exceptions.LbryioResponseException)3 ExecutionException (java.util.concurrent.ExecutionException)3 JSONArray (org.json.JSONArray)3 Claim (com.odysee.app.model.Claim)2 Tag (com.odysee.app.model.Tag)2