use of com.amazon.device.iap.model.Product in project SeriesGuide by UweTrottmann.
the class AmazonIapManager method enablePurchaseForSkus.
protected void enablePurchaseForSkus(final Map<String, Product> productData) {
Product product = productData.get(AmazonSku.SERIESGUIDE_SUB_YEARLY.getSku());
if (product != null) {
subscriptionAvailable = true;
EventBus.getDefault().post(new AmazonIapProductEvent(product));
}
product = productData.get(AmazonSku.SERIESGUIDE_PASS.getSku());
if (product != null) {
passAvailable = true;
EventBus.getDefault().post(new AmazonIapProductEvent(product));
}
}
use of com.amazon.device.iap.model.Product in project SeriesGuide by UweTrottmann.
the class AmazonBillingActivity method onEventMainThread.
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventMainThread(AmazonIapManager.AmazonIapProductEvent event) {
Product product = event.product;
// display the actual price like "1.23 C"
String price = product.getPrice();
if (price == null) {
price = "--";
}
if (AmazonSku.SERIESGUIDE_SUB_YEARLY.getSku().equals(product.getSku())) {
if (textViewPriceSub != null) {
textViewPriceSub.setText(getString(R.string.billing_price_subscribe, price));
}
return;
}
if (AmazonSku.SERIESGUIDE_PASS.getSku().equals(product.getSku())) {
if (textViewPricePass != null) {
textViewPricePass.setText(String.format("%s\n%s", price, getString(R.string.billing_price_pass)));
}
}
}