commit | 7421e93317318dc7825bda70cd2351d6bab41286 | [log] [tgz] |
---|---|---|
author | davemorrissey <davemorrissey@gmail.com> | Tue Jun 16 19:53:06 2015 +0100 |
committer | davemorrissey <davemorrissey@gmail.com> | Tue Jun 16 19:53:06 2015 +0100 |
tree | aa59644ca2638f3b15997761e9180fe735264260 | |
parent | 1a28c3cb5c0a8ddbec4eb07b82bf9d6c93555594 [diff] | |
parent | 952218ffaf2b0a5a0a8677aca17feb9051644c8b [diff] |
Merge pull request #80 from enderminh/master Updating README file to point to new 3.1.4 version
A custom image view for Android, designed for photo galleries and displaying huge images (e.g. maps and building plans) without OutOfMemoryError
s. Includes pinch to zoom, panning, rotation and animation support, and allows easy extension so you can add your own overlays and touch event detection.
The view optionally uses subsampling and tiles to support very large images - a low resolution base layer is loaded and as you zoom in, it is overlaid with smaller high resolution tiles for the visible area. This avoids holding too much data in memory. It's ideal for displaying large images while allowing you to zoom in to the high resolution details. You can disable tiling for smaller images and when displaying a bitmap object. There are some advantages and disadvantages to disabling tiling so to decide which is best, see the wiki.
Version 3.x.x includes breaking changes. Please view the migration guide.
Are you using this library in your app? Let me know and I'll add it to this list.
Fourth Mate | Sync for reddit | Journal | Clover |
Tag Gallery | nycTrans.it | RR File Locker |
With tiling enabled:
OnClickListener
and OnLongClickListener
GestureDetector
and OnTouchListener
ViewPager
to create a photo gallerywrap_content
layout1) Add com.davemorrissey.labs:subsampling-scale-image-view:3.1.4
as a dependency in your build.gradle file.
2) Add the 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"/> </RelativeLayout>
3) Now, in your fragment or activity, set the image 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")) // ... or ... imageView.setImage(ImageSource.uri("/sdcard/DCIM/DSCM00123.JPG"));
Copyright 2015 David Morrissey, and licensed under the Apache License, Version 2.0. No attribution is necessary but it's very much appreciated. Star this project if you like it, and send a link to your project on GitHub or app in Google Play if you'd like me to add it to this page.