Baseflow / Baseflow/PhotoView

set zoom level programmatically

Open
#756 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

i try [this](https://github.com/chrisbanes/PhotoView/issues/557)solution but it didn't work for me
```
val img: PhotoView = PhotoView(container.context)

Glide.with(container.context)
.load(if (images[position].isNullOrBlank()) "error" else images[position])
.into(img)
val vto: ViewTreeObserver = img.getViewTreeObserver()
vto.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
img.getViewTreeObserver().removeOnGlobalLayoutListener(this)
img.setScale(2f)
}
})

val layout = img
container.addView(layout)

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.