</br> <p align="center"> <a href="https://opensource.org/licenses/Apache-2.0"><img alt="许可证" src="https://yellow-cdn.veclightyear.com/835a84d5/624fcb21-de72-48f8-b77d-fff950602d95.svg"/></a> <a href="https://android-arsenal.com/api?level=21"><img alt="API" src="https://yellow-cdn.veclightyear.com/835a84d5/7830643f-aed5-40d5-b83b-f0a824cdff8c.svg?style=flat"/></a> <a href="https://github.com/GetStream/photoview-android/actions/workflows/android.yml"><img alt="构建状态" src="https://yellow-cdn.veclightyear.com/835a84d5/8b4d592b-0d8c-423c-917a-17070fccfc58.svg"/></a> <a href="https://androidweekly.net/issues/issue-610"><img alt="Android 周刊" src="https://yellow-cdn.veclightyear.com/835a84d5/d673799c-57b3-4111-8d2f-7844e57e8f65.svg"/></a> <a href="https://getstream.io?utm_source=Github&utm_medium=Jaewoong_OSS&utm_content=Developer&utm_campaign=Github_Feb2024_Jaewoong_PhotoView&utm_term=DevRelOss"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/HayesGordon/e7f3c4587859c17f3e593fd3ff5b13f4/raw/11d9d9385c9f34374ede25f6471dc743b977a914/badge.json" alt="Stream Feeds"></a> </p><br> <p align="center"> <img src="https://yellow-cdn.veclightyear.com/835a84d5/751a3ef9-dca5-4579-88d3-d05e76c33250.gif" width="270"/> <img src="https://yellow-cdn.veclightyear.com/835a84d5/3f10963e-9307-4afe-920b-3a03cffc261a.gif" width="270"/> <img src="https://yellow-cdn.veclightyear.com/835a84d5/9195899a-69f6-4bae-84a4-3aa4965f3d5b.gif" width="252"/> </p>该库的目标是同步最新的 androidx 库,修复 bug,增强功能,并通过 Maven Central 而不是 Jitpack 分发软件包。
<a href="https://getstream.io/video/docs/android/tutorials/video-calling?utm_source=Github&utm_medium=Jaewoong_OSS&utm_content=Developer&utm_campaign=Github_Feb2024_Jaewoong_PhotoView&utm_term=DevRelOss"><img src="https://yellow-cdn.veclightyear.com/835a84d5/11048b7d-022f-4595-93ff-573a91a8236f.png" align="right" width="13%"/></a>
PhotoView 由 Stream 维护。 如果您对构建强大的实时视频/音频通话、音频室和直播感兴趣,请查看 Compose 版 Stream Video SDK! 此外,任何人都可以按照我们的贡献指南来改进代码、文档或其他内容。
将以下依赖添加到您的模块的 build.gradle 文件中:
dependencies { implementation("io.getstream:photoview:1.0.2") }
PhotoView 可以像 ImageView 一样使用,如下例所示:
<io.getstream.photoview.PhotoView android:id="@+id/phptoView" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/wallpaper"/>
在使用第三方图片加载库如 Glide 或 Coil 时,可以按照以下示例加载图片。
val photoView = binding.photoView photoView.load(IMAGE_URL) { crossfade(true) }
val photoView = binding.photoView Glide.with(this) .load(IMAGE_URL) .into(photoView)
查看 sample 目录可以找到多种实用示例,包括与 ViewPager 集成、使用共享过渡元素的 PhotoView、使用第三方图片库(如 Coil、Glide 和 Picasso)等。
您可以使用 photoview-dialog 包来实现显示 PhotoView 图片列表的对话框。首先,您可以简单地添加以下依赖:
dependencies { implementation("io.getstream:photoview-dialog:$version") }
现在,您可以使用 PhotoViewDialog 组件来显示 PhotoView 图片对话框,如下所示:
val imageUrls = listOf( .., ) val button = binding.button button.setOnClickListener { PhotoViewDialog.Builder(context = this, images = imageUrls) { imageView, url -> Glide.with(this) .load(url) .into(imageView) }.build().show() }
然后,您将看到如下结果:
<img src="https://yellow-cdn.veclightyear.com/835a84d5/9195899a-69f6-4bae-84a4-3aa4965f3d5b.gif" width="340"/>通过加入这个仓库的 stargazers 来支持它。:star: <br> 另外,请在 GitHub 上 关注我,了解我的下一个创作!🤩
Copyright 2024 Stream.IO, Inc. 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.


职场AI,就用扣子
AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!


多风格AI绘画神器
堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。


零代码AI应用开发平台
零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具

