Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setRotationBy setRotationTo does not work with ViewPager #843

Open
hyvenzhu opened this issue Dec 10, 2024 · 1 comment
Open

setRotationBy setRotationTo does not work with ViewPager #843

hyvenzhu opened this issue Dec 10, 2024 · 1 comment

Comments

@hyvenzhu
Copy link

sample code:

class ImageAdapter(val context: Context, dataList: List?) : BannerAdapter<String, ImageAdapter.ImageViewHolder>(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)
}

}

@hyvenzhu
Copy link
Author

Is there any way to use 'rotation' with ViewPager?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant