Search in sources :

Example 11 with Painting

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);
}
Also used : Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Example 12 with Painting

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);
}
Also used : Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Example 13 with Painting

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);
}
Also used : SpannableBuilder(com.alexvasilkov.android.commons.texts.SpannableBuilder) Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Example 14 with Painting

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();
    });
}
Also used : Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Example 15 with Painting

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);
}
Also used : Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Aggregations

Painting (com.alexvasilkov.gestures.sample.ex.utils.Painting)23 SpannableBuilder (com.alexvasilkov.android.commons.texts.SpannableBuilder)4 RecyclePagerAdapter (com.alexvasilkov.gestures.commons.RecyclePagerAdapter)3 SimpleTracker (com.alexvasilkov.gestures.transition.tracker.SimpleTracker)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1