use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.
the class PagerAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
settingsController.apply(holder.image);
Painting painting = paintings.get(position);
GlideHelper.loadFull(holder.image, painting.imageId, painting.thumbId);
}
use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.
the class PagerAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
settingsController.apply(holder.image);
Painting painting = paintings[position];
GlideHelper.loadFull(holder.image, painting.imageId, painting.thumbId);
}
use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.
the class RecyclerAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
final Painting painting = paintings[position];
// Storing item position for click handler
holder.itemView.setTag(R.id.tag_item, position);
GlideHelper.loadThumb(holder.image, painting.thumbId);
CharSequence text = new SpannableBuilder(holder.title.getContext()).createStyle().setFont(Typeface.DEFAULT_BOLD).apply().append(painting.author).append("\n").clearStyle().append(painting.title).build();
holder.title.setText(text);
}
use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.
the class FullImageActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.image_cross_animation_to_screen);
image = findViewById(R.id.single_image_to);
background = findViewById(R.id.single_image_to_back);
// Making sure image and background are invisible at first
image.setVisibility(View.INVISIBLE);
background.setVisibility(View.INVISIBLE);
// Loading image. Note, that this image should already be cached in the memory to ensure
// very fast loading. Consider using same image or its thumbnail as on prev screen.
final int paintingId = getIntent().getIntExtra(EXTRA_PAINTING_ID, 0);
Painting painting = Painting.list(getResources())[paintingId];
GlideHelper.loadFull(image, painting.imageId, painting.thumbId);
// Listening for animation state and updating our view accordingly
image.getPositionAnimator().addPositionUpdateListener(this::applyImageAnimationState);
// Starting enter image animation only once image is drawn for the first time to prevent
// image blinking on activity start
runAfterImageDraw(() -> {
// Enter animation should only be played if activity is not created from saved state
enterFullImage(savedInstanceState == null);
// Hiding original image
Events.create(CrossEvents.SHOW_IMAGE).param(false).post();
});
}
use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.
the class PagerAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
settingsController.apply(holder.image);
Painting painting = paintings[position];
GlideHelper.loadFull(holder.image, painting.imageId, painting.thumbId);
}
Aggregations