[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3967":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},3967,"PhotoView","Baseflow\u002FPhotoView","Baseflow","Implementation of ImageView for Android that supports zooming, by various touch gestures.","https:\u002F\u002Fbaseflow.com",null,"Java",18826,3909,627,215,0,1,6,45,"Apache License 2.0",false,"master",[],"2026-06-12 02:00:56","# PhotoView\nPhotoView aims to help produce an easily usable implementation of a zooming Android ImageView.\n\n[![](https:\u002F\u002Fjitpack.io\u002Fv\u002Fchrisbanes\u002FPhotoView.svg)](https:\u002F\u002Fjitpack.io\u002F#chrisbanes\u002FPhotoView)\n\n[![](https:\u002F\u002Fuser-images.githubusercontent.com\u002F12352397\u002F85141529-94648e80-b24f-11ea-9a14-a845fb43b181.gif)\n\n## Dependency\n\nAdd this in your root `build.gradle` file (**not** your module `build.gradle` file):\n\n```gradle\nallprojects {\n    repositories {\n        maven { url \"https:\u002F\u002Fwww.jitpack.io\" }\n    }\n}\n\nbuildscript {\n    repositories {\n        maven { url \"https:\u002F\u002Fwww.jitpack.io\" }\n    }\t\n}\n```\n\nThen, add the library to your module `build.gradle`\n```gradle\ndependencies {\n    implementation 'com.github.chrisbanes:PhotoView:latest.release.here'\n}\n```\n\n## Features\n- Out of the box zooming, using multi-touch and double-tap.\n- Scrolling, with smooth scrolling fling.\n- Works perfectly when used in a scrolling parent (such as ViewPager).\n- 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\u002Fscroll position.\n- Allows the application to be notified when the user taps on the Photo.\n\n## Usage\nThere is a [sample](https:\u002F\u002Fgithub.com\u002Fchrisbanes\u002FPhotoView\u002Ftree\u002Fmaster\u002Fsample) 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:\n```xml\n\u003Ccom.github.chrisbanes.photoview.PhotoView\n    android:id=\"@+id\u002Fphoto_view\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u002F>\n```\n```java\nPhotoView photoView = (PhotoView) findViewById(R.id.photo_view);\nphotoView.setImageResource(R.drawable.image);\n```\nThat's it!\n\n## Issues With ViewGroups\nThere are some ViewGroups (ones that utilize onInterceptTouchEvent) that throw exceptions when a PhotoView is placed within them, most notably [ViewPager](http:\u002F\u002Fdeveloper.android.com\u002Freference\u002Fandroid\u002Fsupport\u002Fv4\u002Fview\u002FViewPager.html) and [DrawerLayout](https:\u002F\u002Fdeveloper.android.com\u002Freference\u002Fandroid\u002Fsupport\u002Fv4\u002Fwidget\u002FDrawerLayout.html). This is a framework issue that has not been resolved. In order to prevent this exception (which typically occurs when you zoom out), take a look at [HackyDrawerLayout](https:\u002F\u002Fgithub.com\u002Fchrisbanes\u002FPhotoView\u002Fblob\u002Fmaster\u002Fsample\u002Fsrc\u002Fmain\u002Fjava\u002Fcom\u002Fgithub\u002Fchrisbanes\u002Fphotoview\u002Fsample\u002FHackyDrawerLayout.java) and you can see the solution is to simply catch the exception. Any ViewGroup which uses onInterceptTouchEvent will also need to be extended and exceptions caught. Use the [HackyDrawerLayout](https:\u002F\u002Fgithub.com\u002Fchrisbanes\u002FPhotoView\u002Fblob\u002Fmaster\u002Fsample\u002Fsrc\u002Fmain\u002Fjava\u002Fcom\u002Fgithub\u002Fchrisbanes\u002Fphotoview\u002Fsample\u002FHackyDrawerLayout.java) as a template of how to do so. The basic implementation is:\n```java\npublic class HackyProblematicViewGroup extends ProblematicViewGroup {\n\n    public HackyProblematicViewGroup(Context context) {\n        super(context);\n    }\n\n    @Override\n    public boolean onInterceptTouchEvent(MotionEvent ev) {\n        try {\n            return super.onInterceptTouchEvent(ev);\n        } catch (IllegalArgumentException e) {\n\t\t\t\t\t\t\u002F\u002Funcomment if you really want to see these errors\n            \u002F\u002Fe.printStackTrace();\n            return false;\n        }\n    }\n}\n```\n\n## Usage with Fresco\nDue to the complex nature of Fresco, this library does not currently support Fresco. See [this project](https:\u002F\u002Fgithub.com\u002Fongakuer\u002FPhotoDraweeView) as an alternative solution.\n\n## Subsampling Support\nThis library aims to keep the zooming implementation simple. If you are looking for an implementation that supports subsampling, check out [this project](https:\u002F\u002Fgithub.com\u002Fdavemorrissey\u002Fsubsampling-scale-image-view)\n\nLicense\n--------\n\n    Copyright 2018 Chris Banes\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","PhotoView 是一个用于Android的ImageView实现，支持通过多种触摸手势进行缩放。该项目的核心功能包括开箱即用的多点触控和双击缩放、流畅滚动及在滚动父容器如ViewPager中的完美表现。它还允许应用程序在显示矩阵变化时得到通知，这对于根据当前缩放\u002F滚动位置更新UI非常有用。此外，PhotoView也支持用户点击图片时的通知机制。适用于需要提供图片查看与交互功能的应用场景，比如图库应用或任何需要展示可缩放图片的界面。基于Java开发，并采用Apache License 2.0开源许可协议发布。",2,"2026-06-11 02:57:29","top_language"]