feat(Android): Multitouch and pointer exit support (#10848) 9bcc4a6d11

Adds multitouch and pointer exit support.

Also bumps the compile and target SDK to 36, adding `core-ktx` dependency for one method.

Co-authored-by: Erik <erik@rive.app>
This commit is contained in:
ErikUggeldahl
2025-10-22 21:14:00 +00:00
parent 0d561aad6f
commit 9de0e5a497
3 changed files with 9 additions and 7 deletions

View File

@@ -1 +1 @@
33c9ac9f95498a294246e58b0c072650f00cda20
9bcc4a6d11ef0f197026ed109a144a24eee394cf

View File

@@ -518,6 +518,7 @@ public:
Vec2D screenBounds; // the bounds of coordinate system of the cursor
Vec2D position; // the cursor position
float scaleFactor = 1.0f; // scale factor for things like retina display
int pointerId = 0; // stable pointer identifier for multitouch
};
// All pointer events will automatically convert between artboard and screen

View File

@@ -1262,8 +1262,7 @@ bool CommandServer::processCommands()
requestId,
CommandQueue::Message::viewModelError)
<< "Property type " << data.type
<< " is not valid when "
<< "subscribing";
<< " is not valid when subscribing";
}
}
else
@@ -2558,7 +2557,9 @@ bool CommandServer::processCommands()
{
Vec2D position =
cursorPosForPointerEvent(stateMachine, pointerEvent);
stateMachine->pointerMove(position);
stateMachine->pointerMove(position,
0.0f,
pointerEvent.pointerId);
}
else
{
@@ -2586,7 +2587,7 @@ bool CommandServer::processCommands()
{
Vec2D position =
cursorPosForPointerEvent(stateMachine, pointerEvent);
stateMachine->pointerDown(position, 0);
stateMachine->pointerDown(position, pointerEvent.pointerId);
}
else
{
@@ -2614,7 +2615,7 @@ bool CommandServer::processCommands()
{
Vec2D position =
cursorPosForPointerEvent(stateMachine, pointerEvent);
stateMachine->pointerUp(position, 0);
stateMachine->pointerUp(position, pointerEvent.pointerId);
}
else
{
@@ -2642,7 +2643,7 @@ bool CommandServer::processCommands()
{
Vec2D position =
cursorPosForPointerEvent(stateMachine, pointerEvent);
stateMachine->pointerExit(position, 0);
stateMachine->pointerExit(position, pointerEvent.pointerId);
}
else
{