I do not know what is going on. I am hiding the gesture drawing , rather then this I am planning to show the the drawing drawn by the paint and canvas.I am using the drawing panel class which is working fine if used alone as shown in this question. It is drawing perfectly.
Now what I was thinking and tried is this , I have implemented the gesture overlay view alone and it was working and detecting gesture. But due to some reasons I am manipulating these two methods all together 1.Paint to draw on canvas 2 gesture to recognize user gesture while drawing on Canvas
Now what I am trying and expecting is , When user draw A on canvas the the canvas starting following the user finger and starts drawing but I think as when the gesture overlay starts detecting gesture, it looks like that the touch is passed to gesture overlay view where as the Paint and canvas stops further drawing.
What I want :
I want that the touch event should be received by the canvas and gesture overlay equally , so that they both work independently.
In simple Words , Do you have any idea how to send touch event to both of these equally ?
Ok there it is , I found the solution , if some one also trying to get it , I mean to use Gesture overlay view , while having other child. Just put the following line in the gesture overlay view xml
android:eventsInterceptionEnabled="false"
and it would start working .
Related
I have a canvas in which I am drawing a horizontal line as seen below. I draw this line based on user touch events , and I move the line along y axix only. This canvas is inside viewpager. When I try to swipe to next page canvas detects the touch event and changes the position of line . So how can I differentiate between when user wants to change the position of line or user wants to swipe to next page. I have tried experiments with touch event of pager and canvas , and the fragment that contain canvas , nothing worked as I required. Any help , suggestions appreciated.
I am drawing a number of ShapeDrawables through a canvas in a custom android view. I have an onTouchEvent method and it's working fine. Everything is working fine. Now I want to be able to detect if a touch event intersects (i.e. happens inside) a certain ShapeDrawable. Is there a way to do that?
I got the answer:
sd.getBounds().contains(x, y)
I want to make drag and drop game in android
at initial stage image is drawn on canvas and at touch event it will move from that position and put at the specific point
what i can do for this? can any one suggest me something
I want to use a WebView with a canvas, and to be able to use touch to drag items in the canvas. The canvas is displayed just fine, and clicking works, but moving only scrolls. I've disabled scrolling, but it still doesn't work. Any ideas?
I found working html here
http://developer.appcelerator.com/question/55121/html5-canvas-drawing-in-webview
It appears that I need to learn more about the difference between touch events and mouse events.
I am implementing a drawing canvas and zoom for custom imageview in android. Both are implementing the touch event, if the user touches, I have to draw canvas and if the user flings with two finger I have to zoom imageview. Touch will fire for only one event canvas is working the zoom is not working. Can anybody tell me how to implement these two functionalities?
Thanks
Using a GestureListener you can do it, or you should read all the inputs and make the logic to know what the user is doing.