Search in sources :

Example 21 with Painting

use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.

the class ImageViewerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.image_viewer_screen);
    setTitle(R.string.example_image_viewer);
    setInfoText(R.string.info_image_viewer);
    // Initializing image viewer
    imageViewer = findViewById(R.id.image_viewer);
    // Applying custom settings (note, that all settings can be also set in XML)
    imageViewer.getController().getSettings().setMaxZoom(6f).setDoubleTapZoom(3f);
    imageViewer.setOnClickListener(view -> showToast("Single click"));
    imageViewer.setOnLongClickListener(view -> {
        showToast("Long click");
        return true;
    });
    final Painting painting = Painting.list(getResources())[PAINTING_ID];
    GlideHelper.loadFull(imageViewer, painting.imageId, painting.thumbId);
}
Also used : Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Example 22 with Painting

use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.

the class LayoutsPagerAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
    settingsController.apply(holder.layout);
    Painting painting = paintings[position];
    GlideHelper.loadFull(holder.image, painting.imageId, painting.thumbId);
    final CharSequence titleText = new SpannableBuilder(holder.itemView.getContext()).createStyle().setFont(Typeface.DEFAULT_BOLD).apply().append(paintings[position].author).append("\n").clearStyle().append(paintings[position].title).build();
    holder.title.setText(titleText);
    holder.button.setTag(paintings[position].link);
}
Also used : SpannableBuilder(com.alexvasilkov.android.commons.texts.SpannableBuilder) Painting(com.alexvasilkov.gestures.sample.ex.utils.Painting)

Example 23 with Painting

use of com.alexvasilkov.gestures.sample.ex.utils.Painting in project GestureViews by alexvasilkov.

the class ImageControlActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.image_control_screen);
    setTitle(R.string.example_image_state_control);
    imageView = findViewById(R.id.image_control_viewer);
    initControlOptions();
    // Loading sample image
    final Painting painting = Painting.list(getResources())[PAINTING_ID];
    GlideHelper.loadFull(imageView, 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