com.example.android.unsplash.ui.ImageSize Java Examples

The following examples show how to use com.example.android.unsplash.ui.ImageSize. 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
Source File: PhotoAdapter.java    From atlas with Apache License 2.0 6 votes vote down vote up
@Override
public void onBindViewHolder(final PhotoViewHolder holder, final int position) {
    Photo data = photos.get(position);
    TextView authorview = holder.itemView.findViewById(R.id.author);
    ImageView photoview = holder.itemView.findViewById(R.id.photo);
    holder.setAuthor(data.author);
    photoview.setTransitionName(String.format(photoTransitionFormat, data.id));
    authorview.setText(data.author);
    authorview.setTransitionName(String.format(authorTransitionFormat, data.id));
    holder.setId(data.id);
    Glide.with(layoutInflater.getContext())
            .load(data.getPhotoUrl(requestedPhotoWidth))
            .placeholder(R.color.placeholder)
            .override(ImageSize.NORMAL[0], ImageSize.NORMAL[1])
            .into((ImageView) holder.itemView.findViewById(R.id.photo));
}
 
Example #2
Source File: PhotoAdapter.java    From android-instant-apps with Apache License 2.0 6 votes vote down vote up
@Override
public void onBindViewHolder(final PhotoViewHolder holder, final int position) {
    Photo data = photos.get(position);
    TextView authorview = holder.itemView.findViewById(R.id.author);
    ImageView photoview = holder.itemView.findViewById(R.id.photo);
    holder.setAuthor(data.author);
    photoview.setTransitionName(String.format(photoTransitionFormat, data.id));
    authorview.setText(data.author);
    authorview.setTransitionName(String.format(authorTransitionFormat, data.id));
    holder.setId(data.id);
    Glide.with(layoutInflater.getContext())
            .load(data.getPhotoUrl(requestedPhotoWidth))
            .placeholder(R.color.placeholder)
            .override(ImageSize.NORMAL[0], ImageSize.NORMAL[1])
            .into((ImageView) holder.itemView.findViewById(R.id.photo));
}
 
Example #3
Source File: PhotoAdapter.java    From animation-samples with Apache License 2.0 5 votes vote down vote up
@Override
public void onBindViewHolder(final PhotoViewHolder holder, final int position) {
    PhotoItemBinding binding = holder.getBinding();
    Photo data = photos.get(position);
    binding.setData(data);
    binding.executePendingBindings();
    Glide.with(layoutInflater.getContext())
            .load(holder.getBinding().getData().getPhotoUrl(requestedPhotoWidth))
            .placeholder(R.color.placeholder)
            .override(ImageSize.NORMAL[0], ImageSize.NORMAL[1])
            .into(holder.getBinding().photo);
}
 
Example #4
Source File: DetailViewPagerAdapter.java    From animation-samples with Apache License 2.0 5 votes vote down vote up
private void onViewBound(DetailViewBinding binding) {
    Glide.with(host)
            .load(binding.getData().getPhotoUrl(photoWidth))
            .placeholder(R.color.placeholder)
            .override(ImageSize.NORMAL[0], ImageSize.NORMAL[1])
            .into(binding.photo);
}
 
Example #5
Source File: DetailViewPagerAdapter.java    From atlas with Apache License 2.0 5 votes vote down vote up
private void onViewBound(ImageView imageView, Photo photo) {
    Glide.with(host)
            .load(photo.getPhotoUrl(photoWidth))
            .placeholder(R.color.placeholder)
            .override(ImageSize.NORMAL[0], ImageSize.NORMAL[1])
            .into(imageView);
}
 
Example #6
Source File: DetailViewPagerAdapter.java    From android-instant-apps with Apache License 2.0 5 votes vote down vote up
private void onViewBound(ImageView imageView, Photo photo) {
    Glide.with(host)
            .load(photo.getPhotoUrl(photoWidth))
            .placeholder(R.color.placeholder)
            .override(ImageSize.NORMAL[0], ImageSize.NORMAL[1])
            .into(imageView);
}