本文整理匯總了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