Syzix
Syzix

Reputation: 97

Heat-sensitive touch compatibility issues

After releasing my product, I've started getting complaints that a certain screen was not working for some phones. After a lot of research and a lot of attempts to fix this issue, I found out that phones that are controlled by heat instead of pressure have this issue. Unfortunately I have only identified the problem. What is happening is the mouse up and mouse move motion events seem to be the same motion. Here is how my code works:

if(event.getAction()==MotionEvent.ACTION_MOVE)
{
    lockdown=true;
}
else if(event.getAction()==MotionEvent.ACTION_UP && lockdown==false)
{
     ...
}
else if(event.getAction()==MotionEvent.ACTION_UP)
{
    ...
    lockdown=false;
}

This code works on a pressure touch phone like mine just fine. It's designed that while the touch is dragged certain things will not function. I could really use some insight on how to fix this issue.

Upvotes: 4

Views: 430

Answers (1)

Syzix
Syzix

Reputation: 97

after an exhuasting night of going back and forth with my testers this is what ive come up with

// somewhere in the prior code a pressure sample is needed
public float dwnPressure
if(event.getAction()==MotionEvent.ACTION_DOWN)
{
 dwnPressure=float(event.getPressure()*0.99)
}

back to the code where i had problems

if(event.getAction()==MotionEvent.ACTION_MOVE)
{
 if(event.getPressure>dwnPressure)
 {
  lockdown=true;
 }
}
else if(event.getAction()==MotionEvent.ACTION_UP && lockdown==false)
{
 ...
}
else if(event.getAction()==MotionEvent.ACTION_UP)
{
...
 lockdown=false;
}

this change works perfectly on some of the phones that had the problem prior. Some phones there is a significant performance improvement but is a bit finicky. I figured id at least share my hard work even if it isn't 100%, since this question wasn't answered as fast as im used to on stackoverflow

Upvotes: 2

Related Questions