跳到正文
发现
Telephoto:Compose 图片缩放组件库
其他开发者工具

Telephoto:Compose 图片缩放组件库

为 Compose UI 提供可缩放图片、缩放手势 Modifier 等媒体体验构建块的 Android 开发库。

admin
发布于 2026-10-28
浏览
4
访问
0
下载
0
版本
v0.19.0
该作品还没有经过官方审核。访问演示、下载或复制命令前,请自行确认来源可信。

详细介绍

项目简介

Telephoto 是一个用 Kotlin 编写的 Android 库,目标是为 Compose UI 提供搭建统一媒体体验所需的「构建块」。在 Android 上做好图片浏览、缩放等媒体交互往往需要不少工作量,Telephoto 把这些常见能力封装成可直接使用的组件与 Modifier。

项目主页与完整文档:https://saket.github.io/telephoto/

主要功能

Zoomable Image

Image() composable 的开箱即用替代品(drop-in replacement),支持:

  • 平移与缩放手势
  • 对超出内存承载能力的大图自动进行 sub-sampling(子采样)

文档:https://saket.github.io/telephoto/zoomableimage/

Modifier.zoomable()

把 ZoomableImage 的手势检测逻辑单独打包成一个 Modifier,因此不仅可用于图片,也能用在视频等非图片 composable 上。

文档:https://saket.github.io/telephoto/zoomable/

Zoomable Peek Overlay

受 Instagram 启发的临时叠加放大效果。

文档:https://saket.github.io/telephoto/zoomable-peek-overlay/

安装与使用

资料中未给出具体的依赖坐标与安装命令,请前往项目网站查看完整文档,并按其中的说明接入使用。

注意事项

  • 本项目是面向 Android 的 Compose UI 库,并非独立应用,需要在自己项目的代码中引入使用。
  • 项目采用 Apache-2.0 许可证,版权归 Saket Narayan 所有。
Copyright 2025 Saket Narayan.

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.

本作品整理自 GitHub 开源项目 saket/telephoto,原作者 @saket,许可证 Apache-2.0。中文介绍由 AI 根据项目 README 整理,以原仓库为准。

更新记录

  1. v0.19.0当前版本

    新增 interactionSource 参数,可在 Modifier.zoomable()、ZoomableImage() 等 API 中观察按压手势;修复磁盘缓存条目缺失时回退到非子采样图片,以及 canBeSubSampled() 中未捕获 FileNotFoundException 的问题。

评论