Baseflow / Baseflow/PhotoView

setRotationBy setRotationTo does not work with ViewPager

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

Description

sample code:

class ImageAdapter(val context: Context, dataList: List?) : BannerAdapter(dataList) {

class ImageViewHolder(val imageView: PhotoView) : RecyclerView.ViewHolder(imageView)

override fun onCreateHolder(parent: ViewGroup, viewType: Int): ImageViewHolder {
val imageView = PhotoView(context)
imageView.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
imageView.scaleType = ImageView.ScaleType.CENTER_CROP
return ImageViewHolder(imageView)
}

override fun onBindView(
holder: ImageViewHolder,
data: String,
position: Int,
size: Int
) {
ImageUtils.displayLocal(context, File(data), holder.imageView)
holder.imageView.setRotationBy(20f)
}
}

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.