I would like to make a TextView that can change the size of it's text based on pinch zooming. The TextView is inside a ScrollView. I've got the TextView to zoom when pinching BUT only when you move your fingers almost perfectly horizontally. If there is a vertical component to the pinch-zoom it defaults to scrolling instead of zooming
Is there a way to disable the scrolling of the ScrollView when there is more than 1 pointer on it then re-enable scrolling when the pointer count returns to 1 or 0? Is the best way to create a CustomScrollView widget or is there an easier way?
I think it is simpler to use:
textView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
if(event.getPointerCount() == 1) {
Log.d("Scroll","1-pointer touch");
v.getParent().requestDisallowInterceptTouchEvent(false);
}
if(event.getPointerCount() == 2){
Log.d("Zoom","2-pointer touch");
v.getParent().requestDisallowInterceptTouchEvent(true);
}
return false;
}
});
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