• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ProductTypes类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.solovyev.android.checkout.ProductTypes的典型用法代码示例。如果您正苦于以下问题:Java ProductTypes类的具体用法?Java ProductTypes怎么用?Java ProductTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ProductTypes类属于org.solovyev.android.checkout包,在下文中一共展示了ProductTypes类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

点赞 3

import org.solovyev.android.checkout.ProductTypes; //导入依赖的package包/类
/**
 * Must be called at {@link android.app.Application#onCreate()}
 */
public void init(@NonNull Application application, @NonNull IConfiguration configuration) {
    mRefWatcher = LeakCanary.install(application);

    mCheckoutInternal = new CheckoutInternal(application, Products.create()
            .add(ProductTypes.IN_APP, configuration.getBilling().getProducts())
            .add(ProductTypes.SUBSCRIPTION, Collections.singletonList("")));
    mConfiguration = configuration;
    mApplication = application;

    // Setup log
    /*
    if (DEBUG) {
        Timber.plant(new Timber.DebugTree());
    } else {
        Timber.plant(new ReleaseTree());
    }
    */
    Timber.plant(new ReleaseTree());

    TypefaceHelper.initialize(application);
    RuntimePermissions.getInstance().load(application);
}
 

开发者ID:AChep,
项目名称:AcDisplay,
代码行数:26,
代码来源:AppHeap.java

示例2: reloadInventory

点赞 2

import org.solovyev.android.checkout.ProductTypes; //导入依赖的package包/类
private void reloadInventory() {
    final Inventory.Request request = Inventory.Request.create();
    // load purchase info
    request.loadAllPurchases();
    // load SKU details
    request.loadSkus(ProductTypes.IN_APP, getInAppSkus());
    mCheckout.loadInventory(request, mInventoryCallback);
}
 

开发者ID:RajneeshSingh007,
项目名称:MusicX-music-player,
代码行数:9,
代码来源:DonationActivity.java

示例3: onLoaded

点赞 2

import org.solovyev.android.checkout.ProductTypes; //导入依赖的package包/类
@Override
public void onLoaded(@Nonnull Inventory.Products products) {
    final Inventory.Product product = products.get(ProductTypes.IN_APP);
    if (!product.supported) {
        // billing is not supported, user can't purchase anything
        return;
    }
    mAdapter.update(product);
}
 

开发者ID:RajneeshSingh007,
项目名称:MusicX-music-player,
代码行数:10,
代码来源:DonationActivity.java

示例4: onLoaded

点赞 2

import org.solovyev.android.checkout.ProductTypes; //导入依赖的package包/类
@Override
public void onLoaded(@NonNull Inventory.Products products) {
    final Inventory.Product product = products.get(ProductTypes.IN_APP);
    mAdapter.setNotifyOnChange(false);
    mAdapter.clear();

    if (product.supported) {
        for (Sku sku : product.getSkus()) {
            final Purchase purchase = product.getPurchaseInState(sku, Purchase.State.PURCHASED);
            final SkuUi skuUi = new SkuUi(sku, purchase != null);
            mAdapter.add(skuUi);
        }

        // Sort items by prices.
        mAdapter.sort(new Comparator<SkuUi>() {
            @Override
            public int compare(@NonNull SkuUi l, @NonNull SkuUi r) {
                return (int) (l.sku.detailedPrice.amount - r.sku.detailedPrice.amount);
            }
        });
        showScene(SCREEN_INVENTORY);
    } else {
        mEmptyView.setText(R.string.donate_billing_not_supported);
        showScene(SCREEN_EMPTY_VIEW);
    }

    mAdapter.notifyDataSetChanged();
}
 

开发者ID:shaobin0604,
项目名称:HeartbeatFixerForGCM,
代码行数:29,
代码来源:DonateDialogFragment.java

示例5: onCreate

点赞 2

import org.solovyev.android.checkout.ProductTypes; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath("fonts/GothamRnd-Book.otf")
                    .setFontAttrId(R.attr.fontPath)
                    .build());
    mCheckoutInternal = new CheckoutInternal(this, Products.create().add(ProductTypes.IN_APP,
            IabProducts.PRODUCT_LIST));
    Once.initialise(this);
}
 

开发者ID:shaobin0604,
项目名称:HeartbeatFixerForGCM,
代码行数:12,
代码来源:HeartbeatFixerForGcmApp.java

示例6: onLoaded

点赞 2

import org.solovyev.android.checkout.ProductTypes; //导入依赖的package包/类
@Override
public void onLoaded(@NonNull Inventory.Products products) {
    final Inventory.Product product = products.get(ProductTypes.IN_APP);
    mAdapter.setNotifyOnChange(false);
    mAdapter.clear();

    if (product.supported) {
        for (Sku sku : product.getSkus()) {
            final Purchase purchase = product.getPurchaseInState(sku, Purchase.State.PURCHASED);
            final SkuUi skuUi = new MySkuUi(sku, purchase != null);
            mAdapter.add(skuUi);
        }

        // Sort items by prices.
        mAdapter.sort(new Comparator<SkuUi>() {
            @Override
            public int compare(@NonNull SkuUi l, @NonNull SkuUi r) {
                return (int) (l.sku.detailedPrice.amount - r.sku.detailedPrice.amount);
            }
        });

        // Show the inventory.
        refreshUi(SCREEN_INVENTORY);
    } else refreshUi(SCREEN_EMPTY_VIEW);

    mAdapter.notifyDataSetChanged();
}
 

开发者ID:AChep,
项目名称:AcDisplay,
代码行数:28,
代码来源:DonateDialog.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)