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

Java ObjectKey类代码示例

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

本文整理汇总了Java中com.bumptech.glide.signature.ObjectKey的典型用法代码示例。如果您正苦于以下问题:Java ObjectKey类的具体用法?Java ObjectKey怎么用?Java ObjectKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectKey类属于com.bumptech.glide.signature包,在下文中一共展示了ObjectKey类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadExperimentImage

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
public static void loadExperimentImage(Context context, ImageView view, String experimentId,
        String relativeFilePath) {
    if (isDestroyed(context)) {
        if (Log.isLoggable(TAG, Log.ERROR)) {
            Log.e(TAG, "Trying to load image for destroyed context");
        }
        // Nothing we can do, return
        return;
    }

    File file = FileMetadataManager.getExperimentFile(context, experimentId, relativeFilePath);
    // Use last modified time as part of the signature to force a glide cache refresh.
    GlideApp.with(context)
            .load(file.getAbsolutePath())
            .signature(new ObjectKey(file.getPath() + file.lastModified()))
            .fitCenter()
            // caches only the final image, after reducing the resolution
            .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
            .into(view);
}
 
开发者ID:google,项目名称:science-journal,代码行数:21,代码来源:PictureUtils.java


示例2: loadExperimentOverviewImage

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
public static void loadExperimentOverviewImage(ImageView imageView,
        String experimentOverviewFilePath) {
    imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
    Context context = imageView.getContext();
    String fullPath = PictureUtils.getExperimentOverviewFullImagePath(context,
            experimentOverviewFilePath);
    File file = new File(fullPath);
    GlideApp.with(context)
            .load(fullPath)
            // Create a signature based on the last modified time so that cached images will
            // not be used if the underlying file changes. This may happen if the user has
            // picked an experiment photo from the "edit experiment" page because there is only
            // one filename used for that photo.
            .signature(new ObjectKey(file.getPath() + file.lastModified()))
            .into(imageView);
}
 
开发者ID:google,项目名称:science-journal,代码行数:17,代码来源:PictureUtils.java


示例3: getKey

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
public String getKey(String value) {
    String safeKey;
    synchronized (lruCache) {
        safeKey = lruCache.get(value);
    }
    if (safeKey == null) {
        try {
            Key key = new ObjectKey(value);
            MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
            key.updateDiskCacheKey(messageDigest);
            safeKey = Util.sha256BytesToHex(messageDigest.digest());
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        synchronized (lruCache) {
            lruCache.put(value, safeKey);
        }
    }
    return safeKey;
}
 
开发者ID:ykrank,项目名称:S1-Next,代码行数:21,代码来源:EditorDiskCache.java


示例4: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
@Nullable
public LoadData<InputStream> buildLoadData(Uri model, int width, int height, Options options) {
  if (MediaStoreUtil.isThumbnailSize(width, height) && isRequestingDefaultFrame(options)) {
    // TODO(nnaze): Tighten down this call to just the dependencies neede by buildVideoFetcher
    return new LoadData<>(new ObjectKey(model), ThumbFetcher.buildVideoFetcher(context, model));
  } else {
    return null;
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:MediaStoreVideoThumbLoader.java


示例5: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<InputStream> buildLoadData(Uri model, int width, int height, Options options) {
  if (MediaStoreUtil.isThumbnailSize(width, height)) {
    return new LoadData<>(new ObjectKey(model), ThumbFetcher.buildImageFetcher(context, model));
  } else {
    return null;
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:MediaStoreImageThumbLoader.java


示例6: testDifferIfSourceKeyDiffers

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Test
public void testDifferIfSourceKeyDiffers()
    throws UnsupportedEncodingException, NoSuchAlgorithmException {
  mutateAndAssertDifferent(new FactoryMutation() {
    @Override
    public void mutate(Factory factory) {
      factory.sourceKey = new ObjectKey("secondKey");
    }
  });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:ResourceCacheKeyTest.java


示例7: testDiffersIfSignatureDiffers

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Test
public void testDiffersIfSignatureDiffers() {
  mutateAndAssertDifferent(new FactoryMutation() {
    @Override
    public void mutate(Factory factory) {
      factory.signature = new ObjectKey("secondSignature");
    }
  });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:ResourceCacheKeyTest.java


示例8: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
@Nullable
public LoadData<InputStream> buildLoadData(Uri model, int width, int height, Options options) {
  if (MediaStoreUtil.isThumbnailSize(width, height) && isRequestingDefaultFrame(options)) {
    return new LoadData<>(new ObjectKey(model), ThumbFetcher.buildVideoFetcher(context, model));
  } else {
    return null;
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:MediaStoreVideoThumbLoader.java


示例9: updateDiskCacheKey_throwsException

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Test
public void updateDiskCacheKey_throwsException() throws NoSuchAlgorithmException {
  // If this test fails, update testEqualsAndHashcode to use KeyTester including regression tests.
  EngineKey key = new EngineKey(
      "id",
      new ObjectKey("signature"),
      100,
      100,
      Collections.<Class<?>, Transformation<?>>emptyMap(),
      Object.class,
      Object.class,
      new Options());
  expectedException.expect(UnsupportedOperationException.class);
  key.updateDiskCacheKey(MessageDigest.getInstance("SHA-1"));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:EngineKeyTest.java


示例10: setUp

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Before
public void setUp() {
  dir = RuntimeEnvironment.application.getCacheDir();
  cache = DiskLruCacheWrapper.create(dir, 10 * 1024 * 1024);
  key = new ObjectKey("test" + Math.random());
  data = new byte[] { 1, 2, 3, 4, 5, 6 };
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:DiskLruCacheWrapperTest.java


示例11: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<File> buildLoadData(Uri uri, int width, int height, Options options) {
  return new LoadData<>(new ObjectKey(uri), new FilePathFetcher(context, uri));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:MediaStoreFileLoader.java


示例12: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<ByteBuffer> buildLoadData(File file, int width, int height,
    Options options) {
  return new LoadData<>(new ObjectKey(file), new ByteBufferFetcher(file));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:ByteBufferFileLoader.java


示例13: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<Data> buildLoadData(Uri model, int width, int height,
    Options options) {
  String assetPath = model.toString().substring(ASSET_PREFIX_LENGTH);
  return new LoadData<>(new ObjectKey(model), factory.buildFetcher(assetManager, assetPath));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:AssetUriLoader.java


示例14: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<Data> buildLoadData(String model, int width, int height, Options options) {
  return new LoadData<>(new ObjectKey(model), new DataUriFetcher<Data>(model, dataDecoder));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:DataUrlLoader.java


示例15: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<Model> buildLoadData(Model model, int width, int height,
    Options options) {
  return new LoadData<>(new ObjectKey(model), new UnitFetcher<>(model));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:UnitModelLoader.java


示例16: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<Data> buildLoadData(File model, int width, int height,
    Options options) {
  return new LoadData<>(new ObjectKey(model), new FileFetcher<>(model, fileOpener));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:FileLoader.java


示例17: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<Data> buildLoadData(Uri model, int width, int height,
    Options options) {
  return new LoadData<>(new ObjectKey(model), factory.build(model));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:UriLoader.java


示例18: getFrameSignature

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
private static Key getFrameSignature() {
  // Some devices seem to have crypto bugs that throw exceptions when you create a new UUID.
  // See #1510.
  return new ObjectKey(Math.random());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:GifFrameLoader.java


示例19: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Override
public LoadData<Data> buildLoadData(String model, int width, int height, Options options) {
  return new LoadData<>(new ObjectKey(model), new DataUriFetcher<>(model, dataDecoder));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:DataUrlLoader.java


示例20: buildLoadData

import com.bumptech.glide.signature.ObjectKey; //导入依赖的package包/类
@Nullable
@Override
public LoadData<InputStream> buildLoadData(String category, int width, int height, Options options) {
    return new LoadData<>(new ObjectKey(category), new ArtworkDataFetcher(category));
}
 
开发者ID:komamj,项目名称:KomaMusic,代码行数:6,代码来源:ArtworkModeLoader.java



注:本文中的com.bumptech.glide.signature.ObjectKey类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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