use of com.braintreepayments.api.interfaces.QueuedCallback in project braintree_android by braintree.
the class BraintreeFragment method waitForConfiguration.
protected void waitForConfiguration(final ConfigurationListener listener) {
fetchConfiguration();
postOrQueueCallback(new QueuedCallback() {
@Override
public boolean shouldRun() {
return getConfiguration() != null && isAdded();
}
@Override
public void run() {
listener.onConfigurationFetched(getConfiguration());
}
});
}
use of com.braintreepayments.api.interfaces.QueuedCallback in project braintree_android by braintree.
the class BraintreeFragment method postCallback.
protected void postCallback(final List<PaymentMethodNonce> paymentMethodNonceList) {
mCachedPaymentMethodNonces.clear();
mCachedPaymentMethodNonces.addAll(paymentMethodNonceList);
mHasFetchedPaymentMethodNonces = true;
postOrQueueCallback(new QueuedCallback() {
@Override
public boolean shouldRun() {
return mPaymentMethodNoncesUpdatedListener != null;
}
@Override
public void run() {
mPaymentMethodNoncesUpdatedListener.onPaymentMethodNoncesUpdated(paymentMethodNonceList);
}
});
}
Aggregations