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

Java MediaStoreSignature类代码示例

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

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



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

示例1: loadFileImage

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
@SuppressWarnings("ConstantConditions")
protected void loadFileImage(File file, final ViewHolder holder) {
    final int iconColor = ATHUtil.resolveColor(activity, R.attr.iconColor);
    if (file.isDirectory()) {
        holder.image.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN);
        holder.image.setImageResource(R.drawable.ic_folder_white_24dp);
    } else {
        Drawable error = Util.getTintedVectorDrawable(activity, R.drawable.ic_file_music_white_24dp, iconColor);
        Glide.with(activity)
                .load(new AudioFileCover(file.getPath()))
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .error(error)
                .placeholder(error)
                .animate(android.R.anim.fade_in)
                .signature(new MediaStoreSignature("", file.lastModified(), 0))
                .into(holder.image);
    }
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:19,代码来源:SongFileAdapter.java


示例2: onBindViewHolder

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
@Override
public void onBindViewHolder(ListViewHolder viewHolder, int position) {
  MediaStoreData current = data.get(position);

  Key signature =
      new MediaStoreSignature(current.mimeType, current.dateModified, current.orientation);

  requestBuilder
      .clone()
      .signature(signature)
      .load(current.uri)
      .into(viewHolder.image);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:RecyclerAdapter.java


示例3: getPreloadRequestBuilder

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
@Override
public RequestBuilder<Drawable> getPreloadRequestBuilder(MediaStoreData item) {
  MediaStoreSignature signature =
      new MediaStoreSignature(item.mimeType, item.dateModified, item.orientation);
  return requestBuilder
      .clone()
      .signature(signature)
      .load(item.uri);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:RecyclerAdapter.java


示例4: getPreloadRequestBuilder

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
@NonNull
@Override
public RequestBuilder<GifDrawable> getPreloadRequestBuilder(MediaStoreData item) {
  MediaStoreSignature signature =
      new MediaStoreSignature(item.mimeType, item.dateModified, item.orientation);
  return requestBuilder
      .clone()
      .signature(signature)
      .load(item.uri);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:RecyclerAdapter.java


示例5: onBindItemViewHolder

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
@Override
public void onBindItemViewHolder(RecentPhotoViewHolder viewHolder, @NonNull Cursor cursor) {
  viewHolder.imageView.setImageDrawable(null);

  long   id           = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns._ID));
  long   dateTaken    = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.DATE_TAKEN));
  long   dateModified = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.DATE_MODIFIED));
  String mimeType     = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.MIME_TYPE));
  int    orientation  = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.ORIENTATION));

  final Uri uri = Uri.withAppendedPath(baseUri, Long.toString(id));

  Key signature = new MediaStoreSignature(mimeType, dateModified, orientation);

  Glide.with(getContext())
       .fromMediaStore()
       .load(uri)
       .signature(signature)
       .diskCacheStrategy(DiskCacheStrategy.NONE)
       .into(viewHolder.imageView);

  viewHolder.imageView.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
      if (clickedListener != null) clickedListener.onItemClicked(uri);
    }
  });

}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:30,代码来源:RecentPhotoViewRail.java


示例6: createSignature

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
public static Key createSignature(Song song) {
    return new MediaStoreSignature("", song.dateModified, 0);
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:4,代码来源:SongGlideRequest.java


示例7: getView

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder v = null;
    int type = getItem(position).getItemType();
    if(convertView != null) {
        v = (ViewHolder)convertView.getTag();
        if(v == null) {
            v = new ViewHolder();
            v.imgView = convertView.findViewById(R.id.img);
            v.videoIcon = convertView.findViewById(R.id.videoIcon);
        }
    } else {
        convertView = attachActivity.getLayoutInflater().inflate(R.layout.picshow_img_item,null);
        v = new ViewHolder();
        v.imgView = convertView.findViewById(R.id.img);
        v.videoIcon = convertView.findViewById(R.id.videoIcon);
    }
    convertView.setTag(v);
    if(v != null && v.imgView != null) {
        if(thubNailSize != 0) {
            GlideApp.with(attachActivity)
                    .load(getItem(position).getPath())
                    .override(thubNailSize)
                    .placeholder(R.drawable.other)
                    .centerCrop()
                    .dontAnimate()
                    .format(DecodeFormat.PREFER_RGB_565)
                    .into(v.imgView);
        } else {
            GlideApp.with(attachActivity)
                    .load(getItem(position).getPath())
                    .placeholder(R.drawable.other)
                    .centerCrop()
                    .dontAnimate()
                    .format(DecodeFormat.PREFER_RGB_565)
                    .signature(new MediaStoreSignature(type == MediaSetUtils.TYPE_VIDEO ? "video/*" : "image/*"
                            ,getItem(position).getDateToken(), 0))
                    .into(v.imgView);
        }
        if(type == MediaSetUtils.TYPE_VIDEO)
            v.videoIcon.setVisibility(View.VISIBLE);
        else
            v.videoIcon.setVisibility(View.GONE);
    }
    return convertView;
}
 
开发者ID:YuntaoWei,项目名称:PictureShow,代码行数:47,代码来源:TimeLineAdapter.java


示例8: createSignature

import com.bumptech.glide.signature.MediaStoreSignature; //导入依赖的package包/类
static Key createSignature(Song song) {
    return new MediaStoreSignature("", song.dateModified, 0);
}
 
开发者ID:h4h13,项目名称:RetroMusicPlayer,代码行数:4,代码来源:SongGlideRequest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Home类代码示例发布时间:2022-05-23
下一篇:
Java UndoInterface类代码示例发布时间: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