本文整理汇总了Java中com.squareup.picasso.StatsSnapshot类的典型用法代码示例。如果您正苦于以下问题:Java StatsSnapshot类的具体用法?Java StatsSnapshot怎么用?Java StatsSnapshot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatsSnapshot类属于com.squareup.picasso包,在下文中一共展示了StatsSnapshot类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onBindInformation
import com.squareup.picasso.StatsSnapshot; //导入依赖的package包/类
@Override
protected void onBindInformation() {
StatsSnapshot info = Picasso.with(getContext())
.getSnapshot();
setSubHeading("Cache", String.format("%s / %s (%f percent)",
humanReadableByteCount(info.size, true),
humanReadableByteCount(info.maxSize, true),
((info.size * 100f) / info.maxSize)));
setValue("\tHits", String.valueOf(info.cacheHits));
setValue("\tMisses", String.valueOf(info.cacheMisses));
setSubHeading("Decoded", String.valueOf(info.downloadCount));
setValue("\tTotal", humanReadableByteCount(info.totalDownloadSize, true));
setValue("\tAverage", humanReadableByteCount(info.averageDownloadSize, true));
setSubHeading("Transformed", String.valueOf(info.transformedBitmapCount));
setValue("\tTotal", humanReadableByteCount(info.totalTransformedBitmapSize, true));
setValue("\tAverage", humanReadableByteCount(info.averageTransformedBitmapSize, true));
}
开发者ID:ozodrukh,项目名称:Green,代码行数:22,代码来源:PicassoCard.java
示例2: refreshPicassoStats
import com.squareup.picasso.StatsSnapshot; //导入依赖的package包/类
private void refreshPicassoStats() {
StatsSnapshot snapshot = picasso.getSnapshot();
String size = getSizeString(snapshot.size);
String total = getSizeString(snapshot.maxSize);
int percentage = (int) ((1f * snapshot.size / snapshot.maxSize) * 100);
picassoCacheSizeView.setText(size + " / " + total + " (" + percentage + "%)");
picassoCacheHitView.setText(String.valueOf(snapshot.cacheHits));
picassoCacheMissView.setText(String.valueOf(snapshot.cacheMisses));
picassoDecodedView.setText(String.valueOf(snapshot.originalBitmapCount));
picassoDecodedTotalView.setText(getSizeString(snapshot.totalOriginalBitmapSize));
picassoDecodedAvgView.setText(getSizeString(snapshot.averageOriginalBitmapSize));
picassoTransformedView.setText(String.valueOf(snapshot.transformedBitmapCount));
picassoTransformedTotalView.setText(getSizeString(snapshot.totalTransformedBitmapSize));
picassoTransformedAvgView.setText(getSizeString(snapshot.averageTransformedBitmapSize));
}
开发者ID:rogues-dev,项目名称:superglue,代码行数:16,代码来源:DebugView.java
示例3: printPicassoStatsSnapshot
import com.squareup.picasso.StatsSnapshot; //导入依赖的package包/类
/**
* overarching stats of all Picasso requests
*/
private void printPicassoStatsSnapshot() {
StatsSnapshot picassoStats = Picasso.with(context).getSnapshot();
// you could set the debugger here to analyze the picassoStats object
// or print the stats to Android Logcat
Log.d("Picasso Stats", picassoStats.toString());
}
开发者ID:fs-opensource,项目名称:android-tutorials-picasso,代码行数:12,代码来源:UsageExampleLoggingAndStats.java
示例4: refresh
import com.squareup.picasso.StatsSnapshot; //导入依赖的package包/类
private void refresh() {
final StatsSnapshot snapshot = picasso.getSnapshot();
final String size = getSizeString(snapshot.size);
final String total = getSizeString(snapshot.maxSize);
final int percentage = (int) ((1f * snapshot.size / snapshot.maxSize) * 100);
cacheLabel.setText(size + " / " + total + " (" + percentage + "%)");
cacheHitsLabel.setText(String.valueOf(snapshot.cacheHits));
cacheMissesLabel.setText(String.valueOf(snapshot.cacheMisses));
decodedLabel.setText(String.valueOf(snapshot.originalBitmapCount));
decodedTotalLabel.setText(getSizeString(snapshot.totalOriginalBitmapSize));
decodedAverageLabel.setText(getSizeString(snapshot.averageOriginalBitmapSize));
transformedLabel.setText(String.valueOf(snapshot.transformedBitmapCount));
transformedTotalLabel.setText(getSizeString(snapshot.totalTransformedBitmapSize));
transformedAverageLabel.setText(getSizeString(snapshot.averageTransformedBitmapSize));
}
开发者ID:palaima,项目名称:DebugDrawer,代码行数:16,代码来源:PicassoModule.java
示例5: refreshPicassoStats
import com.squareup.picasso.StatsSnapshot; //导入依赖的package包/类
private void refreshPicassoStats() {
StatsSnapshot snapshot = picasso.getSnapshot();
String size = getSizeString(snapshot.size);
String total = getSizeString(snapshot.maxSize);
int percentage = (int) ((1f * snapshot.size / snapshot.maxSize) * 100);
picassoCacheSizeView.setText(size + " / " + total + " (" + percentage + "%)");
picassoCacheHitView.setText(String.valueOf(snapshot.cacheHits));
picassoCacheMissView.setText(String.valueOf(snapshot.cacheMisses));
picassoDecodedView.setText(String.valueOf(snapshot.originalBitmapCount));
picassoDecodedTotalView.setText(getSizeString(snapshot.totalOriginalBitmapSize));
picassoDecodedAvgView.setText(getSizeString(snapshot.averageOriginalBitmapSize));
picassoTransformedView.setText(String.valueOf(snapshot.transformedBitmapCount));
picassoTransformedTotalView.setText(getSizeString(snapshot.totalTransformedBitmapSize));
picassoTransformedAvgView.setText(getSizeString(snapshot.averageTransformedBitmapSize));
}
开发者ID:berwyn,项目名称:ponyville-live-android,代码行数:16,代码来源:DebugAppContainer.java
注:本文中的com.squareup.picasso.StatsSnapshot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论