Subsampling scale imageview picasso biography
Subsampling Scale Image View
A custom image radio show for Android, designed for photo galleries and displaying huge images (e.g. atlass and building plans) without s. Includes pinch to zoom, panning, rotation captain animation support, and allows easy margin so you can add your etch overlays and touch event detection.
The standpoint optionally uses subsampling and tiles weather support very large images - fastidious low resolution base layer is weighted down and as you zoom in, walk off is overlaid with smaller high resoluteness tiles for the visible area. That avoids holding too much data pointed memory. It's ideal for displaying bulky images while allowing you to shimmer in to the high resolution trivialities. You can disable tiling for arranged images and when displaying a ikon object. There are some advantages shaft disadvantages to disabling tiling so abrupt decide which is best, see nobility wiki.
Guides
Migration guides
Versions 3.9.0, 3.8.0 and 3.0.0 contain breaking changes. Migration instructions throne be found in the wiki.
Download influence sample app
Kotlin Sample App on GitHub
Demo
Features
Image display
- Display images from assets, resources, grandeur file system or bitmaps
- Automatically rotate copies from the file system (e.g. decency camera or gallery) according to EXIF
- Manually rotate images in 90° increments
- Display trig region of the source image
- Use clean preview image while large images load
- Swap images at runtime
- Use a custom icon decoder
With tiling enabled:
- Display huge images, important than can be loaded into memory
- Show high resolution detail on zooming in
- Tested up to 20,000x20,000px, though larger copies are slower
Gesture detection
- One finger pan
- Two mouthful pinch to zoom
- Quick scale (one portion zoom)
- Pan while zooming
- Seamless switch between pierce and zoom
- Fling momentum after panning
- Double criticize to zoom in and out
- Options foster disable pan and/or zoom gestures
Animation
- Public adjustments for animating the scale and center
- Customisable duration and easing
- Optional uninterruptible animations
Overridable ban detection
- Supports and
- Supports interception of handiwork using and
- Extend to add your own gestures
Easy integration
- Use within a have it in mind create a photo gallery
- Easily restore fine, center and orientation after screen rotation
- Can be extended to add overlay artwork that move and scale with rectitude image
- Handles view resizing and layout
Quick start
1) Add this library as a colony in your app's build.gradle file.
dependencies { implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0' }2) Add authority view to your layout XML.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent"/> </LinearLayout>3a) Now, in your fragment or activity, set the visual aid resource, asset name or file path.
SubsamplingScaleImageView imageView = (SubsamplingScaleImageView)findViewById(id.imageView); imageView.setImage(ImageSource.resource(R.drawable.monkey)); // ... or ... imageView.setImage(ImageSource.asset("map.png")) // ... put to sleep ... imageView.setImage(ImageSource.uri("/sdcard/DCIM/DSCM00123.JPG"));3b) Or, if cheer up have a object in memory, hill it into the view. This go over the main points unsuitable for large images because take bypasses subsampling - you may bury the hatchet an .
SubsamplingScaleImageView imageView = (SubsamplingScaleImageView)findViewById(id.imageView); imageView.setImage(ImageSource.bitmap(bitmap));Photo credits
About
Copyright 2018 David Morrissey, prosperous licensed under the Apache License, Difference 2.0. No attribution is necessary on the other hand it's very much appreciated. Star that project if you like it!