本文整理汇总了Java中org.solovyev.android.checkout.Sku类的典型用法代码示例。如果您正苦于以下问题:Java Sku类的具体用法?Java Sku怎么用?Java Sku使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sku类属于org.solovyev.android.checkout包,在下文中一共展示了Sku类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onBind
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
private void onBind(Sku sku, boolean purchased) {
mSku = sku;
mTitle.setText(getTitle(sku));
mDescription.setText(sku.description);
strikeThrough(mTitle, purchased);
strikeThrough(mDescription, purchased);
mPrice.setText(sku.price);
ColorGenerator generator = ColorGenerator.MATERIAL;
int color = generator.getRandomColor();
String scaleTitle = getTitle(sku).substring(0,1);
TextDrawable drawable = TextDrawable.builder().beginConfig()
.bold()
.toUpperCase()
.endConfig().buildRound(scaleTitle, color);
mIcon.setImageDrawable(drawable);
if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
mTitle.setTextColor(Color.WHITE);
mDescription.setTextColor(ContextCompat.getColor(DonationActivity.this, R.color.darkthemeTextColor));
} else {
mTitle.setTextColor(Color.BLACK);
mDescription.setTextColor(Color.DKGRAY);
}
}
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:24,代码来源:DonationActivity.java
示例2: createDescription
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
@NonNull
private static String createDescription(@NonNull Sku sku) {
// String prefix = "donation_";
// if (sku.id.startsWith(prefix)) {
// int[] data = new int[]{
// 1, R.string.donation_1,
// 4, R.string.donation_4,
// 10, R.string.donation_10,
// 20, R.string.donation_20,
// 50, R.string.donation_50,
// 99, R.string.donation_99,
// };
//
// int price = Integer.parseInt(sku.id.substring(prefix.length()));
// for (int i = 0; i < data.length; i += 2) {
// if (price == data[i]) {
// Context context = AppHeap.getContext();
// return context.getString(data[i + 1]);
// }
// }
// }
//
// Log.wtf(TAG, "Alien sku found!");
// return "Alien sku found!";
return sku.description;
}
开发者ID:shaobin0604,项目名称:HeartbeatFixerForGCM,代码行数:27,代码来源:DonateDialogFragment.java
示例3: getView
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
Sku item = items.get(position);
if (v == null) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = inflater.inflate(R.layout.item_donation, parent, false);
}
TextView title = (TextView) v.findViewById(R.id.title);
TextView desc = (TextView) v.findViewById(R.id.description);
TextView price = (TextView) v.findViewById(R.id.price);
title.setText(item.getDisplayTitle());
desc.setText(item.description);
price.setText(item.price);
return v;
}
开发者ID:xiprox,项目名称:WaniKani-for-Android,代码行数:20,代码来源:DonationsAdapter.java
示例4: createDescription
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
@NonNull
private static String createDescription(@NonNull Sku sku) {
String prefix = "donation_";
if (sku.id.startsWith(prefix)) {
int[] data = new int[]{
1, R.string.donation_1,
4, R.string.donation_4,
10, R.string.donation_10,
20, R.string.donation_20,
50, R.string.donation_50,
99, R.string.donation_99,
};
int price = Integer.parseInt(sku.id.substring(prefix.length()));
for (int i = 0; i < data.length; i += 2) {
if (price == data[i]) {
Context context = App.get();
return context.getString(data[i + 1]);
}
}
}
Log.wtf(TAG, "Alien sku found!");
return "Alien sku found!";
}
开发者ID:AChep,项目名称:HeadsUp,代码行数:26,代码来源:DonateDialog.java
示例5: onClick
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public void onClick(Sku sku) {
final Purchase purchase = mProduct.getPurchaseInState(sku, Purchase.State.PURCHASED);
if (purchase != null) {
consume(purchase);
} else {
purchase(sku);
}
}
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:9,代码来源:DonationActivity.java
示例6: getTitle
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
/**
* @return SKU title without application name that is automatically added by Play Services
*/
private String getTitle(Sku sku) {
final int i = sku.title.indexOf("(");
if (i > 0) {
return sku.title.substring(0, i);
}
return sku.title;
}
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:11,代码来源:DonationActivity.java
示例7: purchase
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
private void purchase(@NonNull final Sku sku) {
if (DEBUG) Log.d(TAG, "Purchasing " + sku.toString() + "...");
mCheckout.whenReady(new Checkout.ListenerAdapter() {
@Override
public void onReady(@NonNull BillingRequests requests) {
requests.purchase(sku, null, mCheckout.getPurchaseFlow());
}
});
}
开发者ID:shaobin0604,项目名称:HeartbeatFixerForGCM,代码行数:10,代码来源:DonateDialogFragment.java
示例8: onLoaded
import org.solovyev.android.checkout.Sku; //导入依赖的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
示例9: getIssueBySku
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public Issue getIssueBySku(Sku sku) {
for(Issue issue : getIssues()) {
if(issue.getProductId() != null && issue.getProductId().equals(sku.id)) {
return issue;
}
}
return null;
}
开发者ID:MagLoft,项目名称:magloft-android-app,代码行数:9,代码来源:IssueCollection.java
示例10: onLoaded
import org.solovyev.android.checkout.Sku; //导入依赖的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
示例11: onCreateDescription
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
@NonNull
@Override
protected String onCreateDescription(@NonNull Sku sku) {
/*
* Those are highly app specific and should probably be
* moved.
*/
String prefix = "donation_";
if (sku.id.startsWith(prefix)) {
int[] data = new int[]{
1, R.string.donation_1,
4, R.string.donation_4,
10, R.string.donation_10,
20, R.string.donation_20,
50, R.string.donation_50,
99, R.string.donation_99,
};
int price = Integer.parseInt(sku.id.substring(prefix.length()));
for (int i = 0; i < data.length; i += 2) {
if (price == data[i]) {
Context context = AppHeap.getContext();
return context.getString(data[i + 1]);
}
}
}
Log.wtf(TAG, "Alien sku found!");
return "Alien sku found!";
}
开发者ID:AChep,项目名称:AcDisplay,代码行数:31,代码来源:DonateDialog.java
示例12: onSubscribeClicked
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
@Override
public void onSubscribeClicked(Sku subscription) {
Map<String, String> dimensions = new HashMap<>();
dimensions.put("Title", subscription.title);
dimensions.put("Id", subscription.id);
dimensions.put("Price", subscription.price);
ParseAnalytics.trackEventInBackground("Subscribe_Clicked", dimensions);
}
开发者ID:bakerframework,项目名称:baker-android-refactor,代码行数:9,代码来源:ParsePlugin.java
示例13: purchase
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
private void purchase(Sku sku) {
final RequestListener<Purchase> listener = makeRequestListener();
mCheckout.startPurchaseFlow(sku, null, listener);
}
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:5,代码来源:DonationActivity.java
示例14: onBindViewHolder
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
final Sku sku = mProduct.getSkus().get(position);
holder.onBind(sku, mProduct.isPurchased(sku));
}
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:6,代码来源:DonationActivity.java
示例15: SkuUi
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public SkuUi(@NonNull Sku sku, boolean isPurchased) {
this.sku = sku;
this.isPurchased = isPurchased;
}
开发者ID:shaobin0604,项目名称:HeartbeatFixerForGCM,代码行数:5,代码来源:DonateDialogFragment.java
示例16: getSubscriptionSku
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public Sku getSubscriptionSku() {
return subscriptionSku;
}
开发者ID:MagLoft,项目名称:magloft-android-app,代码行数:4,代码来源:IssueCollection.java
示例17: getSku
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public Sku getSku() {
return sku;
}
开发者ID:MagLoft,项目名称:magloft-android-app,代码行数:4,代码来源:Issue.java
示例18: setSku
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public void setSku(Sku sku) {
this.sku= sku;
}
开发者ID:MagLoft,项目名称:magloft-android-app,代码行数:4,代码来源:Issue.java
示例19: MySkuUi
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public MySkuUi(@NonNull Sku sku, boolean isPurchased) {
super(sku, isPurchased);
}
开发者ID:AChep,项目名称:AcDisplay,代码行数:4,代码来源:DonateDialog.java
示例20: SkuUi
import org.solovyev.android.checkout.Sku; //导入依赖的package包/类
public SkuUi(@NonNull Sku sku, boolean isPurchased) {
this.sku = sku;
this.mIsPurchased = isPurchased;
}
开发者ID:AChep,项目名称:AcDisplay,代码行数:5,代码来源:SkuUi.java
注:本文中的org.solovyev.android.checkout.Sku类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论