# 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)
## 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
attacher.update();
```
## 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.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
PhotoView.zip (36个子文件)
PhotoView-master
pom.xml 3KB
sample
pom.xml 1KB
res
drawable-ldpi
ic_launcher.png 3KB
menu
main_menu.xml 1KB
drawable-hdpi
ic_launcher.png 7KB
drawable-xhdpi
ic_launcher.png 11KB
values
strings.xml 677B
drawable-nodpi
wallpaper.jpg 92KB
drawable-mdpi
ic_launcher.png 4KB
layout
activity_main.xml 691B
LICENSE 11KB
src
uk
co
senab
photoview
sample
SimpleSampleActivity.java 4KB
LauncherActivity.java 2KB
ViewPagerActivity.java 2KB
HackyViewPager.java 928B
project.properties 602B
AndroidManifest.xml 836B
libs
android-support-v4.jar 377KB
lint.xml 53B
library
pom.xml 719B
res
values
strings.xml 121B
layout
main.xml 406B
LICENSE 11KB
src
uk
co
senab
photoview
PhotoView.java 4KB
VersionedGestureDetector.java 7KB
PhotoViewAttacher.java 25KB
IPhotoView.java 5KB
ScrollerProxy.java 3KB
SDK16.java 982B
Compat.java 450B
project.properties 584B
AndroidManifest.xml 285B
LICENSE 11KB
header_graphic.png 19KB
.gitignore 217B
README.md 3KB
共 36 条
- 1
LZM_HUAN_MIE
- 粉丝: 1
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页