Cod*_* Hu 2 android thumbnails android-glide
我正在尝试以这种方式显示本地视频缩略图,它确实在列表中显示了缩略图。然而,列表变得非常难以滚动。有没有更好的方法来解决这个问题? https://futurestud.io/tutorials/glide-displaying-gifs-and-videos
VideoItem current = (VideoItem) getItem(position);
mHolder.mTvName.setText(current.getName());
mHolder.mTvDuration.setText( Utils.convertDuration(current.getDuration()));
mHolder.mTvSize.setText(formatFileSize(mContext, current.getSize()));
Glide.with(mContext)
.load(Uri.fromFile(new File(current.getPath())))
.transform(new GlideRoundTransform(mContext, 12))
.into(mHolder.mIvIcon);
return convertView;
Run Code Online (Sandbox Code Playgroud)
小智 6
我发现以下答案也有效:
Uri uri = Uri.fromFile(new File(media.getPath()));
Glide.with(getContext()).
load(uri).
thumbnail(0.1f).
into(viewHolderImage.recordedMedia);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8369 次 |
| 最近记录: |