hi Volker,
i did further testing.
if we use the Samsung native library, maybe the S Pen side button touch event can be detected. But using the Samsung SDK seems to require a lot of Samsung specific API, such as SCanvasView, may that makes the code much harder to maintain.
if we do not use the Samsung native libraries, there is a way to get it work with the Android 4 / API Level 14, onHoverEvent
{code}
@Override
public boolean onHoverEvent(MotionEvent event) {
Log.d(TAG,"onHoverEvent()\tisSideButtonPressed: " + SPenLibrary.getEvent(event).isSideButtonPressed() );
return super.onHoverEvent(event);
}
{code}
SPenLibrary is from Samsung's jar and it doesn't require the native .so libraries. I believe we can check the button status in another way without depend to the SPenLibrary util class.
Apparently, when S Pen's side button is pressed, the Samsung devices do not fire a touch event but only fire a hover event. That's why our current implementation cannot catch the side button touch to do erasing.
So, how do you want Quill to handle the side button case?
- ignore the request and do not support side button erasing
- use Samsung native library and may need a major refactor of the design (that when it is using Samsung device, it needs to create a Samsung SCanvas view)
- change the minimum Android API requirement from level 11 to level 14, i.e. no longer support Android 3 and require Android 4.
It seems to me there ain't too many Android 3 phone anyway, and I propose to go for option 3. What do you think?
regards,
mingfai