Search in sources :

Example 1 with ConsumerParamsBuilder

use of com.zype.android.webapi.builder.ConsumerParamsBuilder in project zype-android by zype.

the class LoginActivity method handleAccessTokenInfo.

@Subscribe
public void handleAccessTokenInfo(AccessTokenInfoEvent event) {
    Logger.d("handleAccessTokenInfo");
    showProgress(false);
    TokenInfo data = event.getEventData().getModelData();
    SettingsProvider.getInstance().saveAccessTokenApplication(data.getApplicationData());
    SettingsProvider.getInstance().saveAccessTokenCreatedAt(data.getCreatedAt());
    SettingsProvider.getInstance().saveAccessTokenExpiration(data.getExpiresInSeconds());
    SettingsProvider.getInstance().saveAccessTokenResourceOwnerId(data.getResourceOwnerId());
    SettingsProvider.getInstance().saveAccessTokenScopes(data.getScopes());
    ConsumerParamsBuilder builder = new ConsumerParamsBuilder().addAccessToken();
    getApi().executeRequest(WebApiManager.Request.CONSUMER_GET, builder.build());
}
Also used : ConsumerParamsBuilder(com.zype.android.webapi.builder.ConsumerParamsBuilder) TokenInfo(com.zype.android.webapi.model.auth.TokenInfo) Subscribe(com.squareup.otto.Subscribe)

Example 2 with ConsumerParamsBuilder

use of com.zype.android.webapi.builder.ConsumerParamsBuilder in project zype-android by zype.

the class FavoritesFragment method requestConsumerFavoriteVideo.

// //////////
// Data
// 
void requestConsumerFavoriteVideo(int page) {
    ConsumerParamsBuilder builder = new ConsumerParamsBuilder().addAccessToken().addPage(page);
    getApi().executeRequest(WebApiManager.Request.CONSUMER_FAVORITE_VIDEO_GET, builder.build());
}
Also used : ConsumerParamsBuilder(com.zype.android.webapi.builder.ConsumerParamsBuilder)

Example 3 with ConsumerParamsBuilder

use of com.zype.android.webapi.builder.ConsumerParamsBuilder in project zype-android by zype.

the class SearchActivity method requestConsumerData.

private void requestConsumerData() {
    ConsumerParamsBuilder builder = new ConsumerParamsBuilder().addAccessToken();
    getApi().executeRequest(WebApiManager.Request.CONSUMER_GET, builder.build());
}
Also used : ConsumerParamsBuilder(com.zype.android.webapi.builder.ConsumerParamsBuilder)

Example 4 with ConsumerParamsBuilder

use of com.zype.android.webapi.builder.ConsumerParamsBuilder in project zype-android by zype.

the class MainActivity method requestConsumerData.

private void requestConsumerData() {
    ConsumerParamsBuilder builder = new ConsumerParamsBuilder().addAccessToken();
    getApi().executeRequest(WebApiManager.Request.CONSUMER_GET, builder.build());
}
Also used : ConsumerParamsBuilder(com.zype.android.webapi.builder.ConsumerParamsBuilder)

Aggregations

ConsumerParamsBuilder (com.zype.android.webapi.builder.ConsumerParamsBuilder)4 Subscribe (com.squareup.otto.Subscribe)1 TokenInfo (com.zype.android.webapi.model.auth.TokenInfo)1