当前位置: 首页>>代码示例>>Java>>正文


Java BitmapTransitionOptions类代码示例

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


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

示例1: PhotoHolder

import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions; //导入依赖的package包/类
public PhotoHolder(View itemView) {
    super(itemView);

    thumbIv = findViewById(R.id.photo_thumb);
    authorTv = findViewById(R.id.photo_author);
    options = BitmapTransitionOptions.withCrossFade();
}
 
开发者ID:boybeak,项目名称:DelegateAdapter,代码行数:8,代码来源:PhotoHolder.java

示例2: loadImage

import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions; //导入依赖的package包/类
@Override
public void loadImage(String path, ImageView imageView, ImageType imageType) {
    Glide.with(imageView)
            .asBitmap()
            .load(path)
            .transition(BitmapTransitionOptions.withCrossFade())
            .apply(REQUEST_OPTIONS)
            .into(imageView);
}
 
开发者ID:esafirm,项目名称:android-image-picker,代码行数:10,代码来源:GrayscaleImageLoader.java

示例3: bindDescription

import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions; //导入依赖的package包/类
private void bindDescription() {
    final TextView storyComment = header.findViewById(R.id.story_comment);
    if (!TextUtils.isEmpty(story.comment)) {
        HtmlUtils.parseMarkdownAndSetText(storyComment, story.comment, markdown,
                (src, loadingSpan) -> GlideApp.with(DesignerNewsStory.this)
                        .asBitmap()
                        .load(src)
                        .transition(BitmapTransitionOptions.withCrossFade())
                        .diskCacheStrategy(DiskCacheStrategy.ALL)
                        .into(new ImageSpanTarget(storyComment, loadingSpan)));
    } else {
        storyComment.setVisibility(View.GONE);
    }

    upvoteStory = header.findViewById(R.id.story_vote_action);
    upvoteStory.setText(getResources().getQuantityString(R.plurals.upvotes, story.vote_count,
            NumberFormat.getInstance().format(story.vote_count)));
    upvoteStory.setOnClickListener(v -> upvoteStory());

    final TextView share = header.findViewById(R.id.story_share_action);
    share.setOnClickListener(v -> {
        ((AnimatedVectorDrawable) share.getCompoundDrawables()[1]).start();
        startActivity(ShareCompat.IntentBuilder.from(DesignerNewsStory.this)
                .setText(story.url)
                .setType("text/plain")
                .setSubject(story.title)
                .getIntent());
    });

    TextView storyPosterTime = header.findViewById(R.id.story_poster_time);
    SpannableString poster = new SpannableString(story.user_display_name.toLowerCase());
    poster.setSpan(new TextAppearanceSpan(this, R.style.TextAppearance_CommentAuthor),
            0, poster.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    CharSequence job =
            !TextUtils.isEmpty(story.user_job) ? "\n" + story.user_job.toLowerCase() : "";
    CharSequence timeAgo = DateUtils.getRelativeTimeSpanString(story.created_at.getTime(),
            System.currentTimeMillis(),
            DateUtils.SECOND_IN_MILLIS)
            .toString().toLowerCase();
    storyPosterTime.setText(TextUtils.concat(poster, job, "\n", timeAgo));
    ImageView avatar = header.findViewById(R.id.story_poster_avatar);
    if (!TextUtils.isEmpty(story.user_portrait_url)) {
        GlideApp.with(this)
                .load(story.user_portrait_url)
                .transition(withCrossFade())
                .placeholder(R.drawable.avatar_placeholder)
                .circleCrop()
                .into(avatar);
    } else {
        avatar.setVisibility(View.GONE);
    }
}
 
开发者ID:nickbutcher,项目名称:plaid,代码行数:53,代码来源:DesignerNewsStory.java


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