本文整理汇总了Java中org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoUtils.getDisplayedSnackbarPromoSavedBytes方法的典型用法代码示例。如果您正苦于以下问题:Java DataReductionPromoUtils.getDisplayedSnackbarPromoSavedBytes方法的具体用法?Java DataReductionPromoUtils.getDisplayedSnackbarPromoSavedBytes怎么用?Java DataReductionPromoUtils.getDisplayedSnackbarPromoSavedBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoUtils
的用法示例。
在下文中一共展示了DataReductionPromoUtils.getDisplayedSnackbarPromoSavedBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: maybeShowDataReductionPromoSnackbar
import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoUtils; //导入方法依赖的package包/类
/**
* Shows the Data Reduction Proxy promo snackbar if the current data savings are over
* specific thresholds set by finch and the snackbar has not been shown for that
*
* @param dataSavingsInBytes The amount of data the Data Reduction Proxy has saved in bytes.
*/
public void maybeShowDataReductionPromoSnackbar(long dataSavingsInBytes) {
// Prevents users who upgrade and have already saved mPromoDataSavingsInMB from seeing the
// promo.
if (!DataReductionPromoUtils.hasSnackbarPromoBeenInitWithStartingSavedBytes()) {
DataReductionPromoUtils.saveSnackbarPromoDisplayed(dataSavingsInBytes);
return;
}
for (int promoDataSavingsMB : mPromoDataSavingsMB) {
long promoDataSavingsBytes = promoDataSavingsMB * BYTES_PER_MEGABYTE;
if (promoDataSavingsMB > 0 && dataSavingsInBytes >= promoDataSavingsBytes
&& DataReductionPromoUtils
.getDisplayedSnackbarPromoSavedBytes() < promoDataSavingsBytes) {
mSnackbarManager.showSnackbar(Snackbar
.make(getStringForBytes(promoDataSavingsBytes),
this,
Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_DATA_REDUCTION_PROMO)
.setAction(
mContext.getString(R.string.data_reduction_promo_snackbar_button),
null));
DataReductionProxyUma.dataReductionProxySnackbarPromo(promoDataSavingsMB);
DataReductionPromoUtils.saveSnackbarPromoDisplayed(dataSavingsInBytes);
break;
}
}
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:33,代码来源:DataReductionPromoSnackbarController.java