1

I have a TextView inside a ScrollView I want to be able to change the font of the TextView whenever the user pinches it. I've been searching for a day now and I didn't find anything satisfactory. While I was hopping this to be pretty straightforward. Do you have any suggestions?

naran z
  • 486
  • 3
  • 13
Libathos
  • 3,340
  • 5
  • 36
  • 61
  • Try this link http://stackoverflow.com/questions/10239891/how-to-zoom-a-textview-in-android and another http://stackoverflow.com/a/10239924/2931489 – Harsh Patel Jul 18 '14 at 08:44

1 Answers1

0

Ok, first implement pinch to zoom in TextView, you can get some idea from here and then as according to the scale value of user pinch try to set textSize of TextView. After that immediate disable touch event of ScrollView when user pinch or touch to the TextView. You can do that in this way(Just use variable instead of true/false return):

public class InterceptScrollView extends ScrollView {

public InterceptScrollView(Context context, AttributeSet attrs) {
    super(context, attrs);
}

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
    return false;
}

}      

and when user done with TextView then again enable the touch event of ScrollView.

naran z
  • 486
  • 3
  • 13