1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

JatpackComposeで画像をズームさせるためのライブラリ"Zoomable"

Posted at

Zoomable

ImageViewをズームするためのライブラリです

準備

新規で作成しても大体書いてありますが、settings.gradle内にmavenCentral()があることを確認します。

pluginManagement {
    repositories {
        mavenCentral()
    }
}
dependencies {

    implementation("net.engawapg.lib:zoomable:1.6.2")
    
}

使い方

基本的には Modifierに

.zoomable(rememberZoomState())

を追加するだけで使えます

    Image(
        painter = painterResource(id = R.drawable.ic_launcher_background),
        contentDescription = null,
        modifier = Modifier.padding(150.dp,150.dp)
            .zoomable(rememberZoomState()),
    )

Videotogif.gif

できること

  • シングルタップ、ダブルタップでのズームの無効
 onTap = {},
 onDoubleTap = {},
  • 1本指でのズーム
 enableOneFingerZoom = false,
  • ズーム中に画面端へ到達した際にさらにスクロールできるようにするか否か
 scrollGesturePropagation = ScrollGesturePropagation.ContentEdge
 // または
 scrollGesturePropagation = ScrollGesturePropagation.NotZoomed
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?