# PhotoView
***
## Deprecation notice
Library has currently no active maintainers, if you're interested, contact Chris Banes (repository owner)
If you have project built on top of this library, you can still submit pull-requests with fixes, for others to see, but you shall expect no response from former maintainers or Chris himself
Version **1.2.4** is the last version officially released (as of 2nd April 2015)
***
Branch **Dev**: [![Build Status](https://travis-ci.org/chrisbanes/PhotoView.png?branch=dev)](https://travis-ci.org/chrisbanes/PhotoView)
Branch **Master**: [![Build Status](https://travis-ci.org/chrisbanes/PhotoView.png?branch=master)](https://travis-ci.org/chrisbanes/PhotoView)
![PhotoView](https://raw.github.com/chrisbanes/PhotoView/master/header_graphic.png)
PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView. It is currently being used in [photup](https://play.google.com/store/apps/details?id=uk.co.senab.photup).
## Features
- Out of the box zooming, using multi-touch and double-tap.
- Scrolling, with smooth scrolling fling.
- Works perfectly when using used in a scrolling parent (such as ViewPager).
- Allows the application to be notified when the displayed Matrix has changed. Useful for when you need to update your UI based on the current zoom/scroll position.
- Allows the application to be notified when the user taps on the Photo.
## Sample Application
The sample application (the source is in the repository) has been published onto Google Play for easy access:
[![Get it on Google Play](http://www.android.com/images/brand/get_it_on_play_logo_small.png)](http://play.google.com/store/apps/details?id=uk.co.senab.photoview.sample)
## Gradle integration
Minimum code for Gradle integration, place code in your `build.gradle`
```gradle
repositories {
mavenCentral()
}
dependencies {
compile 'com.github.chrisbanes.photoview:library:1.2.4'
}
```
## Sample Usage
There is a [sample](https://github.com/chrisbanes/PhotoView/tree/master/sample) provided which shows how to use the library in a more advanced way, but for completeness here is all that is required to get PhotoView working:
```java
ImageView mImageView;
PhotoViewAttacher mAttacher;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Any implementation of ImageView can be used!
mImageView = (ImageView) findViewById(R.id.iv_photo);
// Set the Drawable displayed
Drawable bitmap = getResources().getDrawable(R.drawable.wallpaper);
mImageView.setImageDrawable(bitmap);
// Attach a PhotoViewAttacher, which takes care of all of the zooming functionality.
mAttacher = new PhotoViewAttacher(mImageView);
}
// If you later call mImageView.setImageDrawable/setImageBitmap/setImageResource/etc then you just need to call
mAttacher.update();
```
## Pull Requests / Contribution
Development happens in **dev** branch of this repository, and Pull Requests should be filled against that branch.
Any Pull Request against **master** will be rejected
## Changelog
Please see the new [Changelog](https://github.com/chrisbanes/PhotoView/wiki/Changelog) page to see what's recently changed.
## License
Copyright 2011, 2012 Chris Banes
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
没有合适的资源?快使用搜索试试~ 我知道了~
图片浏览单点/多点触摸来进行图片缩放
共55个文件
java:24个
xml:8个
gradle:5个
需积分: 16 39 下载量 180 浏览量
2015-05-07
21:08:29
上传
评论
收藏 252KB ZIP 举报
温馨提示
PhotoView 是一款扩展自Android ImageView ,支持通过单点/多点触摸来进行图片缩放的智能控件。
资源推荐
资源详情
资源评论
收起资源包目录
chrisbanes-PhotoView-v1.2.4-3-ge365829.zip (55个子文件)
chrisbanes-PhotoView-e365829
.travis.yml 1KB
gradlew.bat 2KB
gradlew 5KB
gradle.properties 609B
maven_push.gradle 4KB
sample
LICENSE 11KB
src
main
res
drawable-ldpi
ic_launcher.png 3KB
menu
main_menu.xml 2KB
viewpager_menu.xml 244B
drawable-hdpi
ic_launcher.png 7KB
drawable-xhdpi
ic_launcher.png 11KB
values
strings.xml 1KB
drawable-nodpi
wallpaper.jpg 92KB
drawable-mdpi
ic_launcher.png 4KB
layout
activity_main.xml 744B
activity_view_pager.xml 259B
activity_simple.xml 207B
java
uk
co
senab
photoview
sample
RotationSampleActivity.java 3KB
SimpleSampleActivity.java 7KB
AUILSampleActivity.java 908B
LauncherActivity.java 2KB
ViewPagerActivity.java 4KB
HackyViewPager.java 2KB
AndroidManifest.xml 1011B
build.gradle 359B
library
gradle.properties 69B
LICENSE 11KB
src
main
java
uk
co
senab
photoview
log
Logger.java 4KB
LogManager.java 1KB
LoggerDefault.java 2KB
DefaultOnDoubleTapListener.java 3KB
PhotoView.java 8KB
PhotoViewAttacher.java 36KB
scrollerproxy
IcsScroller.java 1KB
PreGingerScroller.java 2KB
GingerScroller.java 2KB
ScrollerProxy.java 2KB
IPhotoView.java 12KB
gestures
OnGestureListener.java 1KB
VersionedGestureDetector.java 1KB
EclairGestureDetector.java 3KB
FroyoGestureDetector.java 2KB
GestureDetector.java 1KB
CupcakeGestureDetector.java 5KB
Compat.java 2KB
AndroidManifest.xml 230B
build.gradle 290B
LICENSE 11KB
gradle
wrapper
gradle-wrapper.jar 51KB
gradle-wrapper.properties 231B
header_graphic.png 19KB
.gitignore 241B
README.md 4KB
settings.gradle 35B
build.gradle 385B
共 55 条
- 1
资源评论
落尘葬花
- 粉丝: 0
- 资源: 44
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功