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