Java Code Examples for com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions

The following examples show how to use com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void presentManifest(@NonNull StickerManifest manifest) {
  stickerTitle.setText(manifest.getTitle().or(getString(R.string.StickerPackPreviewActivity_untitled)));
  stickerAuthor.setText(manifest.getAuthor().or(getString(R.string.StickerPackPreviewActivity_unknown)));
  adapter.setStickers(manifest.getStickers());

  Sticker first = manifest.getStickers().isEmpty() ? null : manifest.getStickers().get(0);
  Sticker cover = manifest.getCover().or(Optional.fromNullable(first)).orNull();

  if (cover != null) {
    Object  model = cover.getUri().isPresent() ? new DecryptableStreamUriLoader.DecryptableUri(cover.getUri().get())
                                               : new StickerRemoteUri(cover.getPackId(), cover.getPackKey(), cover.getId());
    GlideApp.with(this).load(model)
                       .transition(DrawableTransitionOptions.withCrossFade())
                       .into(coverImage);
  } else {
    coverImage.setImageDrawable(null);
  }
}
 
Example 2
Source Project: GestureViews   Source File: DemoGlideHelper.java    License: Apache License 2.0 6 votes vote down vote up
public static void loadFlickrThumb(Photo photo, ImageView image) {
    final RequestOptions options = new RequestOptions()
            .diskCacheStrategy(DiskCacheStrategy.DATA)
            .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
            .dontTransform();

    final RequestBuilder<Drawable> thumbRequest = Glide.with(image)
            .load(photo.getThumbnailUrl())
            .apply(options)
            .transition(DrawableTransitionOptions.with(TRANSITION_FACTORY));

    Glide.with(image).load(photo.getMediumUrl())
            .apply(options)
            .thumbnail(thumbRequest)
            .into(image);
}
 
Example 3
Source Project: v9porn   Source File: ExoMediaPlayerActivity.java    License: MIT License 6 votes vote down vote up
@Override
public void playVideo(String title, String videoUrl, String name, String thumImgUrl) {

    if (isPauseByActivityEvent) {
        isPauseByActivityEvent = false;
        videoPlayer.reset();
    }
    videoControlsMobile.setOnBackButtonClickListener(new ExoVideoControlsMobile.OnBackButtonClickListener() {
        @Override
        public void onBackClick(View view) {
            onBackPressed();
        }
    });
    if (!TextUtils.isEmpty(thumImgUrl)) {
        GlideApp.with(this).load(Uri.parse(thumImgUrl)).transition(new DrawableTransitionOptions().crossFade(300)).into(videoPlayer.getPreviewImageView());
    }
    videoPlayer.setVideoURI(Uri.parse(videoUrl));
    videoControlsMobile.setTitle(title);
}
 
Example 4
Source Project: hipda   Source File: GlideHelper.java    License: GNU General Public License v2.0 6 votes vote down vote up
public static void loadAvatar(RequestManager glide, ImageView view, String avatarUrl) {
    avatarUrl = Utils.nullToText(avatarUrl);
    String cacheKey = AVATAR_CACHE_KEYS.get(avatarUrl);
    if (cacheKey == null) {
        cacheKey = avatarUrl;
    }
    if (HiSettingsHelper.getInstance().isCircleAvatar()) {
        glide.load(new AvatarModel(avatarUrl))
                .signature(new ObjectKey(cacheKey))
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .circleCrop()
                .error(DEFAULT_USER_ICON)
                .transition(DrawableTransitionOptions.withCrossFade())
                .into(view);
    } else {
        glide.load(new AvatarModel(avatarUrl))
                .signature(new ObjectKey(cacheKey))
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .transform(new CenterCrop(), new RoundedCorners(Utils.dpToPx(4)))
                .error(DEFAULT_USER_ICON)
                .transition(DrawableTransitionOptions.withCrossFade())
                .into(view);
    }
}
 
Example 5
Source Project: AndroidPlusJava   Source File: MeFragment.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void init() {
    super.init();
    mUser = AVUser.getCurrentUser(User.class);
    mUserName.setText(mUser.getUsername());
    if (mUser.getSlogan() != null) {
        mSlogan.setText(mUser.getSlogan());
    }
    GlideApp.with(this)
            .load(mUser.getAvatar())
            .transform(new CircleCrop())
            .transition(new DrawableTransitionOptions().crossFade())
            .placeholder(R.mipmap.ic_launcher_round)
            .into(mAvatar);

}
 
Example 6
Source Project: AndroidPlusJava   Source File: MeFragment.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    switch (requestCode) {
        case REQUEST_GALLERY_IMAGES:
            if (resultCode == RESULT_OK) {
                Uri uri = data.getData();
                GlideApp.with(this).load(uri).transform(new CircleCrop()).into(mAvatar);
                ImageUtils.saveAvatar(getContext(), uri);
            }
            break;
        case REQUEST_CAMERA_IMAGES:
            if (resultCode == RESULT_OK) {
                GlideApp.with(getContext())
                        .load(IMAGE_DIR + mImageName)
                        .transform(new CircleCrop())
                        .transition(new DrawableTransitionOptions().crossFade())
                        .into(mAvatar);
                ImageUtils.saveAvatar(mImageName, IMAGE_DIR + mImageName);

            }
            break;

    }
}
 
Example 7
Source Project: CloudReader   Source File: EverydayAdapter.java    License: Apache License 2.0 6 votes vote down vote up
@Override
        protected void onBindingView(BaseBindingHolder holder, List<AndroidBean> object, int position) {
            DensityUtil.setWidthHeight(binding.ivOnePhoto, width, 2.6f);
            if ("福利".equals(object.get(0).getType())) {
                binding.tvOnePhotoTitle.setVisibility(View.GONE);
                binding.ivOnePhoto.setScaleType(ImageView.ScaleType.CENTER_CROP);
//                ImageLoadUtil.displayEspImage(object.get(0).getUrl(), binding.ivOnePhoto, 1);
                Glide.with(binding.ivOnePhoto.getContext())
                        .load(object.get(0).getUrl())
                        .transition(DrawableTransitionOptions.withCrossFade(1500))
                        .placeholder(R.drawable.img_two_bi_one)
                        .error(R.drawable.img_two_bi_one)
                        .into(binding.ivOnePhoto);

            } else {
                binding.tvOnePhotoTitle.setVisibility(View.VISIBLE);
                setDes(object, 0, binding.tvOnePhotoTitle);
                displayRandomImg(1, 0, binding.ivOnePhoto, object);
            }
            setOnClick(binding.llOnePhoto, object.get(0));
        }
 
Example 8
Source Project: v9porn   Source File: ExoMediaPlayerActivity.java    License: MIT License 6 votes vote down vote up
@Override
public void playVideo(String title, String videoUrl, String name, String thumImgUrl) {

    if (isPauseByActivityEvent) {
        isPauseByActivityEvent = false;
        videoPlayer.reset();
    }
    videoControlsMobile.setOnBackButtonClickListener(new ExoVideoControlsMobile.OnBackButtonClickListener() {
        @Override
        public void onBackClick(View view) {
            onBackPressed();
        }
    });
    if (!TextUtils.isEmpty(thumImgUrl)) {
        GlideApp.with(this).load(Uri.parse(thumImgUrl)).transition(new DrawableTransitionOptions().crossFade(300)).into(videoPlayer.getPreviewImageView());
    }
    videoPlayer.setVideoURI(Uri.parse(videoUrl));
    videoControlsMobile.setTitle(title);
}
 
Example 9
Source Project: DelegateAdapter   Source File: UserRowHolder.java    License: Apache License 2.0 6 votes vote down vote up
public UserRowHolder(View itemView) {
    super(itemView);

    profileIv = findViewById(R.id.user_row_profile);
    nameTv = findViewById(R.id.user_row_name);
    locationTv = findViewById(R.id.user_row_location);
    bioTv = findViewById(R.id.user_row_bio);

    moreView = findViewById(R.id.user_row_more);
    socialView = findViewById(R.id.user_row_social_layout);
    emailIv = findViewById(R.id.user_row_email);
    twitterIv = findViewById(R.id.user_row_twitter);
    insIv = findViewById(R.id.user_row_instagram);

    fadeInOptions = DrawableTransitionOptions.withCrossFade();
    mCircleCropOption = RequestOptions.circleCropTransform();
}
 
Example 10
Source Project: DanDanPlayForAndroid   Source File: PersonalFavoriteAnimeItem.java    License: MIT License 6 votes vote down vote up
@Override
public void onUpdateViews(AnimeFavoriteBean.FavoritesBean model, int position) {
    RequestOptions options = new RequestOptions()
            .centerCrop()
            .transform(new CornersCenterCrop(3));

    Glide.with(imageView.getContext())
            .load(model.getImageUrl())
            .apply(options)
            .transition((DrawableTransitionOptions.withCrossFade()))
            .into(imageView);

    animeTitle.setText(model.getAnimeTitle());

    mView.setOnClickListener(v ->
            AnimeDetailActivity.launchAnimeDetail(
                    (Activity)mView.getContext(),
                    model.getAnimeId()+"")
    );
}
 
Example 11
Source Project: DanDanPlayForAndroid   Source File: AnimeRecommendItem.java    License: MIT License 6 votes vote down vote up
@Override
public void onUpdateViews(AnimeBean model, int position) {
    RequestOptions options = new RequestOptions()
            .centerCrop()
            .transform(new CornersCenterCrop(ConvertUtils.dp2px(5)));

    Glide.with(imageIv.getContext())
            .load(model.getImageUrl())
            .apply(options)
            .transition((DrawableTransitionOptions.withCrossFade()))
            .into(imageIv);

    titleTv.setText(model.getAnimeTitle());

    typeTv.setText(model.isIsOnAir() ? "连载中" : "已完结");

    ratingTv.setText(model.getRating()+"");

    mView.setOnClickListener(v ->
            AnimeDetailActivity.launchAnimeDetail(
                    (Activity)mView.getContext(),
                    model.getAnimeId()+"")
    );
}
 
Example 12
Source Project: AppsMonitor   Source File: MainActivity.java    License: MIT License 6 votes vote down vote up
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
    AppItem item = getItemInfoByPosition(position);
    holder.mName.setText(item.mName);
    holder.mUsage.setText(AppUtil.formatMilliSeconds(item.mUsageTime));
    holder.mTime.setText(String.format(Locale.getDefault(),
            "%s · %d %s",
            new SimpleDateFormat("yyyy.MM.dd HH:mm:ss", Locale.getDefault()).format(new Date(item.mEventTime)),
            item.mCount,
            getResources().getString(R.string.times_only))
    );
    holder.mDataUsage.setText(String.format(Locale.getDefault(), "%s", AppUtil.humanReadableByteCount(item.mMobile)));
    if (mTotal > 0) {
        holder.mProgress.setProgress((int) (item.mUsageTime * 100 / mTotal));
    } else {
        holder.mProgress.setProgress(0);
    }
    GlideApp.with(MainActivity.this)
            .load(AppUtil.getPackageIcon(MainActivity.this, item.mPackageName))
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .transition(new DrawableTransitionOptions().crossFade())
            .into(holder.mIcon);
    holder.setOnClickListener(item);
}
 
Example 13
public Target<Drawable> loadWithShadowCircleTransformWithPlaceholder(String url,
    ImageView imageView, float strokeSize, @AttrRes int placeHolderDrawable) {
  Context context = weakContext.get();
  if (context != null) {
    return Glide.with(context)
        .load(AptoideUtils.IconSizeU.generateSizeStoreString(url, resources, windowManager))
        .apply(getRequestOptions().transform(
            new ShadowCircleTransformation(context, imageView, strokeSize))
            .placeholder(getAttrDrawable(placeHolderDrawable)))
        .transition(DrawableTransitionOptions.withCrossFade())
        .into(imageView);
  } else {
    Log.e(TAG, "::loadWithShadowCircleTransform() Context is null");
  }
  return null;
}
 
Example 14
Source Project: CloudReader   Source File: GlideUtil.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 显示高斯模糊效果(电影详情页)
 */
private static void displayGaussian(Context context, String url, ImageView imageView) {
    // "23":模糊度;"4":图片缩放4倍后再进行模糊
    Glide.with(context)
            .load(url)
            .transition(DrawableTransitionOptions.withCrossFade())
            .error(R.drawable.stackblur_default)
            .placeholder(R.drawable.stackblur_default)
            .transition(DrawableTransitionOptions.withCrossFade(500))
            .transform(new BlurTransformation(50, 8))
            .into(imageView);
}
 
Example 15
void bind(@NonNull GlideRequests glideRequests,
          @NonNull EventListener eventListener,
          @NonNull StickerPackRecord stickerPack,
          boolean lastInList)
{
  title.setText(stickerPack.getTitle().or(itemView.getResources().getString(R.string.StickerManagementAdapter_untitled)));
  author.setText(stickerPack.getAuthor().or(itemView.getResources().getString(R.string.StickerManagementAdapter_unknown)));
  divider.setVisibility(lastInList ? View.GONE : View.VISIBLE);

  if (BlessedPacks.contains(stickerPack.getPackId())) {
    title.setOverflowText(blessedBadge);
  } else {
    title.setOverflowText(null);
  }

  glideRequests.load(new DecryptableUri(stickerPack.getCover().getUri()))
               .transition(DrawableTransitionOptions.withCrossFade())
               .into(cover);

  if (stickerPack.isInstalled()) {
    actionButtonImage.setImageResource(R.drawable.ic_x);
    actionButton.setOnClickListener(v -> eventListener.onStickerPackUninstallClicked(stickerPack.getPackId(), stickerPack.getPackKey()));

    shareButton.setVisibility(View.VISIBLE);
    shareButtonImage.setVisibility(View.VISIBLE);
    shareButton.setOnClickListener(v -> eventListener.onStickerPackShareClicked(stickerPack.getPackId(), stickerPack.getPackKey()));
  } else {
    actionButtonImage.setImageResource(R.drawable.ic_arrow_down);
    actionButton.setOnClickListener(v -> eventListener.onStickerPackInstallClicked(stickerPack.getPackId(), stickerPack.getPackKey()));

    shareButton.setVisibility(View.GONE);
    shareButtonImage.setVisibility(View.GONE);
    shareButton.setOnClickListener(null);
  }

  itemView.setOnClickListener(v -> eventListener.onStickerPackClicked(stickerPack.getPackId(), stickerPack.getPackKey()));
}
 
Example 16
Source Project: FirebaseUI-Android   Source File: ImageActivity.java    License: Apache License 2.0 5 votes vote down vote up
@OnClick(R.id.button_download_direct)
protected void downloadDirect() {
    // Download directly from StorageReference using Glide
    // (See MyAppGlideModule for Loader registration)
    GlideApp.with(this)
            .load(mImageRef)
            .centerCrop()
            .transition(DrawableTransitionOptions.withCrossFade())
            .into(mImageView);
}
 
Example 17
void bind(@NonNull GlideRequests glideRequests, @NonNull EventListener eventListener, @NonNull StickerRecord sticker) {
  glideRequests.load(new DecryptableUri(sticker.getUri()))
               .transition(DrawableTransitionOptions.withCrossFade())
               .into(image);

  itemView.setOnClickListener(v -> {
    eventListener.onStickerSuggestionClicked(sticker);
  });
}
 
Example 18
void bind(@NonNull MediaFolder folder, @NonNull GlideRequests glideRequests, @NonNull EventListener eventListener) {
  title.setText(folder.getTitle());
  count.setText(String.valueOf(folder.getItemCount()));
  icon.setImageResource(folder.getFolderType() == MediaFolder.FolderType.CAMERA ? R.drawable.ic_camera_solid_white_24 : R.drawable.ic_folder_white_48dp);

  glideRequests.load(folder.getThumbnailUri())
               .diskCacheStrategy(DiskCacheStrategy.NONE)
               .transition(DrawableTransitionOptions.withCrossFade())
               .into(thumbnail);

  itemView.setOnClickListener(v -> eventListener.onFolderClicked(folder));
}
 
Example 19
Source Project: mollyim-android   Source File: GiphyAdapter.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onBindViewHolder(@NonNull GiphyViewHolder holder, int position) {
  GiphyImage image = images.get(position);

  holder.modelReady = false;
  holder.image      = image;
  holder.thumbnail.setAspectRatio(image.getGifAspectRatio());
  holder.gifProgress.setVisibility(View.GONE);

  RequestBuilder<Drawable> thumbnailRequest = GlideApp.with(context)
                                                      .load(new ChunkedImageUrl(image.getStillUrl(), image.getStillSize()))
                                                      .diskCacheStrategy(DiskCacheStrategy.ALL);

  if (Util.isLowMemory(context)) {
    glideRequests.load(new ChunkedImageUrl(image.getStillUrl(), image.getStillSize()))
                 .placeholder(new ColorDrawable(Util.getRandomElement(MaterialColor.values()).toConversationColor(context)))
                 .diskCacheStrategy(DiskCacheStrategy.ALL)
                 .transition(DrawableTransitionOptions.withCrossFade())
                 .listener(holder)
                 .into(holder.thumbnail);

    holder.setModelReady();
  } else {
    glideRequests.load(new ChunkedImageUrl(image.getGifUrl(), image.getGifSize()))
                 .thumbnail(thumbnailRequest)
                 .placeholder(new ColorDrawable(Util.getRandomElement(MaterialColor.values()).toConversationColor(context)))
                 .diskCacheStrategy(DiskCacheStrategy.ALL)
                 .transition(DrawableTransitionOptions.withCrossFade())
                 .listener(holder)
                 .into(holder.thumbnail);
  }
}
 
Example 20
@Override
public void onBindItemViewHolder(RecentPhotoViewHolder viewHolder, @NonNull Cursor cursor) {
  viewHolder.imageView.setImageDrawable(null);

  String path         = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.DATA));
  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));
  String bucketId     = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.BUCKET_ID));
  int    orientation  = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.ORIENTATION));
  long   size         = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.SIZE));
  int    width        = cursor.getInt(cursor.getColumnIndexOrThrow(getWidthColumn(orientation)));
  int    height       = cursor.getInt(cursor.getColumnIndexOrThrow(getHeightColumn(orientation)));

  final Uri uri = Uri.fromFile(new File(path));

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

  GlideApp.with(getContext().getApplicationContext())
          .load(uri)
          .signature(signature)
          .diskCacheStrategy(DiskCacheStrategy.NONE)
          .transition(DrawableTransitionOptions.withCrossFade())
          .into(viewHolder.imageView);

  viewHolder.imageView.setOnClickListener(v -> {
    if (clickedListener != null) clickedListener.onItemClicked(uri, mimeType, bucketId, dateTaken, width, height, size);
  });

}
 
Example 21
Source Project: v9porn   Source File: KeDouAdapter.java    License: MIT License 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, KeDouModel item) {
    helper.setText(R.id.tv_kedou_title, getTitleWithDuration(item));
    helper.setText(R.id.tv_kedou_info, item.getInfo());
    ImageView simpleDraweeView = helper.getView(R.id.iv_kedou_img);
    Uri uri = Uri.parse(item.getImgUrl());
    GlideApp.with(helper.itemView).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);
}
 
Example 22
Source Project: v9porn   Source File: V91PornAdapter.java    License: MIT License 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, V9PornItem item) {
    helper.setText(R.id.tv_91porn_item_title, item.getTitleWithDuration());
    helper.setText(R.id.tv_91porn_item_info, item.getInfo());
    ImageView simpleDraweeView = helper.getView(R.id.iv_91porn_item_img);
    Uri uri = Uri.parse(item.getImgUrl());
    GlideApp.with(helper.itemView).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);
}
 
Example 23
Source Project: v9porn   Source File: FavoriteAdapter.java    License: MIT License 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, V9PornItem item) {
    helper.setText(R.id.tv_91porn_item_title, item.getTitle() + "  (" + item.getDuration() + ")");
    helper.setText(R.id.tv_91porn_item_info, item.getInfo());
    ImageView simpleDraweeView = helper.getView(R.id.iv_91porn_item_img);
    Uri uri = Uri.parse(item.getImgUrl());
    GlideApp.with(helper.itemView).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);

    helper.addOnClickListener(R.id.right_menu_delete);
}
 
Example 24
Source Project: v9porn   Source File: HuaBanAdapter.java    License: MIT License 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, HuaBan.Picture item) {
    ImageView imageView = helper.getView(R.id.iv_item_hua_ban);
    GlideApp.with(helper.itemView.getContext()).load(item.getPictureUrl(item.getPictureKey(), width)).transition(new DrawableTransitionOptions().crossFade(300)).into(imageView);
    int height;
    if (!heightMap.containsKey(item.getPictureKey())) {
        height = item.getPictureHeight() * width / item.getPictureWidth();
        heightMap.put(item.getPictureKey(), height);
    } else {
        height = heightMap.get(item.getPictureKey());
    }
    StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) helper.itemView.getLayoutParams();
    layoutParams.height = height;
    helper.itemView.setLayoutParams(layoutParams);
}
 
Example 25
public Target<Drawable> loadUsingCircleTransform(@NonNull String url,
    @NonNull ImageView imageView) {
  Context context = weakContext.get();
  if (context != null) {
    return Glide.with(context)
        .load(url)
        .apply(getRequestOptions().transform(new CircleCrop()))
        .transition(DrawableTransitionOptions.withCrossFade())
        .into(imageView);
  } else {
    Log.e(TAG, "::loadUsingCircleTransform() Context is null");
  }
  return null;
}
 
Example 26
Source Project: v9porn   Source File: HistoryAdapter.java    License: MIT License 5 votes vote down vote up
@Override
protected void convert(BaseViewHolder helper, V9PornItem item) {
    helper.setText(R.id.tv_91porn_item_title, item.getTitle() + "  (" + item.getDuration() + ")");
    helper.setText(R.id.tv_91porn_item_info, item.getInfo());
    ImageView simpleDraweeView = helper.getView(R.id.iv_91porn_item_img);
    Uri uri = Uri.parse(item.getImgUrl());
    GlideApp.with(helper.itemView).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);

    helper.addOnClickListener(R.id.right_menu_delete);
}
 
Example 27
Source Project: v9porn   Source File: UserRegisterActivity.java    License: MIT License 5 votes vote down vote up
/**
 * 加载验证码,目前似乎是非必须,不填也是可以登录的
 */
private void loadCaptcha() {
    String url = presenter.getVideo9PornAddress() + "captcha2.php";
    Logger.t(TAG).d("验证码链接:" + url);
    Uri uri = Uri.parse(url);
    GlideApp.with(this).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(wbCaptcha);
}
 
Example 28
public void bindView(Comment comment) {
    mUserName.setText(comment.getUser().getUsername());
    mComment.setText(comment.getContent());
    GlideApp.with(this).load(comment.getUser().getAvatar())
            .transform(new CircleCrop())
            .placeholder(R.mipmap.ic_launcher_round)
            .transition(new DrawableTransitionOptions().crossFade())
            .into(mAvatar);
    mPublishDate.setText(DateUtils.getDisplayString(getContext(), comment.getCreatedAt()));
}
 
Example 29
Source Project: CloudReader   Source File: GlideUtil.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 电影详情页显示电影图片(等待被替换)(测试的还在,已可以弃用)
 * 没有加载中的图
 */
@BindingAdapter("android:showImg")
public static void showImg(ImageView imageView, String url) {
    Glide.with(imageView.getContext())
            .load(url)
            .transition(DrawableTransitionOptions.withCrossFade(500))
            .error(getDefaultPic(3))
            .into(imageView);
}
 
Example 30
public void bindView(Answer answer) {
    mAnswer = answer;
    mAnswerText.setText(answer.getContent());
    mUserName.setText(answer.getUser().getUsername());
    Date createAt = answer.getCreatedAt();
    mFavourCount.setText(String.valueOf(answer.getLikeCount()));
    mCommentCount.setText(String.valueOf(answer.getCommentCount()));
    mPublishDate.setText(DateUtils.getDisplayString(getContext(), createAt));
    GlideApp.with(this)
            .load(answer.getUser().getAvatar())
            .placeholder(R.mipmap.ic_launcher_round)
            .transform(new CircleCrop())
            .transition(new DrawableTransitionOptions().crossFade())
            .into(mAvatar);
}