1

The Android SDK recommends the use of

ViewConfiguration.getScaledTouchSlop()

for detecting if the finger on the touch screen has been moved. According to Android, the ScaledTouchSlop depends on the device, and with that upon resolution and screen sensitivity.

I have written a view where the user can use Canvas for painting on the screen, and I have realized that painting works differently well on different devices. Further investigation showed that ScaledTouchSlop seems to be defined by the device manufacturer and varies a lot between manufacturers. For example

  • The ASUS Memo Pad 7 has a ScaledTouchSlop of 11 pixels on a 7 inch screen with approx. 1280x720.
  • The Samsung Galaxy Note 2 has a ScaledTouchSlop of 32 on a 5.5 inch screen with approx. 1280x720.

Both screens have about the same resolution, so when looking at the ASUS device, I would have expected ScaledTouchSlop to be around 14 on the Samsung device (11 pixels * 7 inch / 5.5 inch), but it is 32. This results in not being able to fluently draw on the Samsung, as smaller strokes are often not recognized.

Sure, I can just define my own "slop" for drawing, and if I do drawing works perfectly well, also on the Samsung device. But I guess that would cause trouble on other devices, which are smaller or have a less sensitive screen.

Is there are a way how the touch slop should be calculated for drawing or does anyone have a recipe that works well on all devices?

Oliver Hausler
  • 4,900
  • 4
  • 35
  • 70

0 Answers0