• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StatsSnapshot类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Osmformat类代码示例发布时间:2022-05-23
下一篇:
Java BatchedRemoteIterator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap