I had done pinch zoom with this polidea Zoomview.I have implemented this pinch zoom code in fragment page.
ZoomView zoomView;
//inside onCreateView method
zoomView= new ZoomView(getActivity());
zoomView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
zoomView.addView(gridTable);
zoomView.setRotationY(180);
gridviewlayout.addView(zoomView);
zoomview jar
Pinch Zoom in and Zoom out was working in gridview table page.But If I zoom-in a page and then scroll to next fragment page.After that when i go back to previous fragment page,the page is still in zoomed state.
What I am trying to do is reset the page in normal state when I move to next fragment page.
I searched a lot of samples.But Everything is related to Imageview.I didn't get any sample for pinch zoom in fragments with layout.
Anyone can help me with this.Thank you.
The pinch key on the emulator is the Alt key. Hold down Alt and click and drag your mouse button.
Double-click the remote device screen in order to zoom in or out.
Pinch 2 or more fingers together or apart to adjust zoom. To zoom temporarily, quickly tap the screen 3 times and hold down your finger on the third tap. Drag your finger to move around the screen. Lift your finger to zoom out.
add below code to your fragment:
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(!isVisibleToUser){
if(mZoomView != null)mZoomView.zoomTo(1,0,0);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With