I have a canvas.DrawText. I want to use gestures to dynamically change the text color and font. This is all working nice using a popup view class. But I want to make this more direct maybe using Fling scroll.
There are millions of colors and by sliding finger on the screen I thought I could increase/decrease the colorInteger and send it to paint.setColor(colorInteger ); before I draw. I have tried all day using various methods.
I have public boolean onTouchEvent(MotionEvent event) {
I know I must catch the x/y in MotionEvent.ACTION_DOWN
Wanted to use the screen left edge for color change and screen right for Font change. I have 21 ttf fonts.
The thing is, I see there is the OnGestureListener onscroll implementation but that will disable my onTouchEvent right? I have lots of movement going on in there.
public boolean onTouchEvent(MotionEvent event) {
Any idea?
You can use
GestureDetector. Implement aGestureDetector.OnGestureListenerand catch gestures there.Provide GestureDetector with touch events like this:
In
GestureDetector.OnGestureListener‘sonDownyou must returntrueif you want to process this gesture. E.g. then the user puts his finger donw in a specified area returntrue, andfalseotherwise. Iffalseis returned here, complicated sequences (like fling or scroll) started with this event will not be detected.