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);
}
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);
}
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);
}
Aggregations