Hi,..
Thanks for your response..

1.Left or touchedView1 is the Button..on which the setOnTouchListener is
called in main Activity.And its Ontouch is in custom class implementing
OnTouchListener..in this class I'm using UI handler thread to access the
button from main Activity.

2.Even after using Rect it doesn't give the desired result.

3.Single pointer (i.e just ACTION_DOWN)also doesn't identify the view.

4.Yes,I do get the finger count and pointer count balanced i.e restricted
to 2...but the rest is not working.


Thanks.

On Wed, May 2, 2012 at 4:07 PM, Jason Teagle <teagle.ja...@gmail.com> wrote:

>  this is the code
>>
>
> Thank you.
>
> 1. Question: What is 'left' as used here:
>
> ---
> if(location1[0] <= x && x <= (location1[0] +touchedView1.getWidth()) &&
> location1[1] <= y && y <= (location1[1] +  touchedView1 .getHeight())) {
> return touchedView1;
> }
> ---
>
> I assume it is the view itself, but since you appear to be allowing for
> multiple views, I would like to see where 'left' is declared and set -
> especially as you refer to the view itself as 'touchedView1'.
>
>
> 2. I would recommend the following change to code to make it a little
> easier to read and understand:
>
> Rect viewBounds = new Rect(location1[0], location1[1],
>   location1[0] + touchedView1.getWidth(),
>   location1[1] + touchedView1.getHeight() );
>
> if (viewBounds.contains(x, y) )
>   return touchedView1 ;
>
> (or use left.getWidth() and left.getHeight(), if that is more appropriate)
>
>
> 3. If you only touch the screen with one finger, does it then work
> correctly? It would be worth testing with one pointer only to begin with,
> rather than complicate things.
>
> 4. It might be worth gathering the X and Y of all pointers and the screen
> locations and dimensions of all views you are allowing for, and just sanity
> check them to see if there is anything unusual. For example, do you get the
> same number of pointers as fingers that are touching the screen, or does it
> appear to return more? The one with the negative values is the one to watch
> - don't just negate the values, that in itself represents a problem and you
> need to understand why. So try your code as-is for one finger first and
> check that works for various locations. Assuming that works, then try two
> fingers and just touch the screen (don't try gestures at this point) at
> various points and see if the list of X / Y and locations you get make
> sense.
>
> Let us know the results.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to 
> android-developers@**googlegroups.com<android-developers@googlegroups.com>
> To unsubscribe from this group, send email to
> android-developers+**unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to