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

Set ImageZoom on RecyclerView Adapter #18

Open
edicybereye opened this issue Jun 13, 2018 · 2 comments
Open

Set ImageZoom on RecyclerView Adapter #18

edicybereye opened this issue Jun 13, 2018 · 2 comments

Comments

@edicybereye
Copy link

Hi I'm really proud and apprciate it about this library help me on Activity, can you give me knowledge how to setup in RecyclerView Adapter event we have create adapter on Class? Because I didn't know how to setup ImageZoomHelper imageZoomHelper; and imageZoomHelper = new ImageZoomHelper(this); also for dispatchTouchEvent.

Thanks and Regards
Edi Kurniawan

@edicybereye
Copy link
Author

because RecyclerAdapter need setup on Fragment and also how to call dispatchTouchEvent?

@a-bahmani
Copy link

a-bahmani commented Jun 23, 2018

Hi, I had this problem. I fixed it with this solution.
For problem 1: pass the activity from your Activity class to adapter and then set it in the ImageZoomHelper.
problem 2: assume that you want to zoom an imageView.
ImageZoomHelper.setViewZoomable(imageView);
then instead of dispathTouchEvent use below:
imageView.setOnTouchListener(new View.OnTouchListener() {
@OverRide
public boolean onTouch(View view, MotionEvent motionEvent) {
return view == imageView && imageZoomHelper.onDispatchTouchEvent(motionEvent);
}
});

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

2 participants