parentButton.Add(buttonB);
Wait(application);
- // Move second child out of parent area
+ // Set highlight to first child (A) to enable movement tracking
auto* accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonA));
DALI_TEST_CHECK(accessible);
accessible->GrabHighlight();
Wait(application);
+ // Move first child (A) out of parent area through the parent's area top edge - single move outed event expected for A object and OUTGOING_TOP_LEFT direction
buttonA.SetProperty( Dali::Actor::Property::POSITION, Dali::Vector2(0.0f, -200.0f) );
Wait(application);
// Need one more seding notificaiton to get correct updated position
// Reset verdict data
Dali::Accessibility::TestResetMoveOutedCalled();
- // Move second child out of parent area
+ // Move first child (A) outside of parent area (both start and end position are outside of parent area) - no move outed event expected for A object
+ buttonA.SetProperty( Dali::Actor::Property::POSITION, Dali::Vector2(0.0f, -300.0f) );
+ Wait(application);
+ // Need one more seding notificaiton to get correct updated position
+ application.SendNotification();
+ DALI_TEST_EQUALS( false, Dali::Accessibility::TestGetMoveOutedCalled(), TEST_LOCATION );
+
+ // Reset verdict data
+ Dali::Accessibility::TestResetMoveOutedCalled();
+
+ // Set highlight to second child (B) to enable movement tracking
accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonB));
DALI_TEST_CHECK(accessible);
accessible->GrabHighlight();
Wait(application);
+ // Move second child (B) inside of parent area (both start and end position are inside of parent area) - no move outed event expected for B object
+ // B: (0,100) --> (0, 50)
+ buttonB.SetProperty( Dali::Actor::Property::POSITION, Dali::Vector2(0.0f, 50.0f) );
+ Wait(application);
+ // Need one more seding notificaiton to get correct updated position
+ application.SendNotification();
+ DALI_TEST_EQUALS( false, Dali::Accessibility::TestGetMoveOutedCalled(), TEST_LOCATION );
+
+ // Reset verdict data
+ Dali::Accessibility::TestResetMoveOutedCalled();
+
+ // Move second child (B) out of parent area through the parent's area right edge - single move outed event expected for B object and OUTGOING_BOTTOM_RIGHT direction
buttonB.SetProperty( Dali::Actor::Property::POSITION, Dali::Vector2(300.0f, 100.0f) );
Wait(application);
// Need one more seding notificaiton to get correct updated position
application.SendNotification();
DALI_TEST_EQUALS( true, Dali::Accessibility::TestGetMoveOutedCalled(), TEST_LOCATION );
+ // Reset verdict data
+ Dali::Accessibility::TestResetMoveOutedCalled();
+
+ // Move second child (B) back into parent area (start position is outside but end position is inside of parent area) - no move outed event expected for B object
+ // B: (300,100) --> (0, 100)
+ buttonB.SetProperty( Dali::Actor::Property::POSITION, Dali::Vector2(0.0f, 100.0f) );
+ Wait(application);
+ // Need one more seding notificaiton to get correct updated position
+ application.SendNotification();
+ DALI_TEST_EQUALS( false, Dali::Accessibility::TestGetMoveOutedCalled(), TEST_LOCATION );
+
+ // Reset verdict data
+ Dali::Accessibility::TestResetMoveOutedCalled();
+
+ // Disable movement tracking on B by giving highlight to A
+ accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonA));
+ DALI_TEST_CHECK(accessible);
+ accessible->GrabHighlight();
+ Wait(application);
+
+ // Move B (untracked) out of parent area through the parent's area right edge - no move outed event expected for B object
+ // B: (0,100) --> (300, 100)
+ buttonB.SetProperty( Dali::Actor::Property::POSITION, Dali::Vector2(300.0f, 100.0f) );
+ Wait(application);
+ // Need one more seding notificaiton to get correct updated position
+ application.SendNotification();
+ DALI_TEST_EQUALS( false, Dali::Accessibility::TestGetMoveOutedCalled(), TEST_LOCATION );
+
Dali::Accessibility::TestEnableSC( false );
END_TEST;
}
return rect;
}
+static bool IsShowingGeometryOnScreen(Dali::Rect<> rect)
+{
+ return rect.width > 0 && rect.height > 0;
+}
+
} // unnamed namespace
// clang-format off
return *internalControl.mImpl;
}
-void Control::Impl::CheckHighlightedObjectGeometry(PropertyNotification& propertyNotification)
+void Control::Impl::CheckHighlightedObjectGeometry()
{
auto accessibleImpl = dynamic_cast<Dali::Toolkit::DevelControl::AccessibleImpl*>(mAccessibilityObject.get());
if(!accessibleImpl)
auto lastPosition = accessibleImpl->GetLastPosition();
auto accessibleRect = accessibleImpl->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
-
- if(lastPosition.x == accessibleRect.x && lastPosition.y == accessibleRect.y)
- {
- return;
- }
-
auto rect = GetShowingGeometry(accessibleRect, accessibleImpl);
- // MoveOuted is sent already, no need to send it again
- if(mAccessibilityMovedOutOfScreenDirection != Dali::Accessibility::MovedOutOfScreenType::NONE)
+ switch(mAccessibilityLastScreenRelativeMoveType)
{
- if(rect.width > 0 && rect.height > 0)
+ case Dali::Accessibility::ScreenRelativeMoveType::OUTSIDE:
{
- // flick next does not use MoveOuted - ScrollToSelf makes object show, so reset for sending MoveOuted next
- mAccessibilityMovedOutOfScreenDirection = Dali::Accessibility::MovedOutOfScreenType::NONE;
+ if(IsShowingGeometryOnScreen(rect))
+ {
+ mAccessibilityLastScreenRelativeMoveType = Dali::Accessibility::ScreenRelativeMoveType::INSIDE;
+ }
+ break;
+ }
+ case Dali::Accessibility::ScreenRelativeMoveType::INSIDE:
+ {
+ if(rect.width < 0 && accessibleRect.x != lastPosition.x)
+ {
+ mAccessibilityLastScreenRelativeMoveType = (accessibleRect.x < lastPosition.x) ? Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_TOP_LEFT : Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_BOTTOM_RIGHT;
+ }
+ if(rect.height < 0 && accessibleRect.y != lastPosition.y)
+ {
+ mAccessibilityLastScreenRelativeMoveType = (accessibleRect.y < lastPosition.y) ? Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_TOP_LEFT : Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_BOTTOM_RIGHT;
+ }
+ // notify AT-clients on outgoing moves only
+ if(mAccessibilityLastScreenRelativeMoveType != Dali::Accessibility::ScreenRelativeMoveType::INSIDE)
+ {
+ mAccessibilityObject.get()->EmitMovedOutOfScreen(mAccessibilityLastScreenRelativeMoveType);
+ }
+ break;
+ }
+ case Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_TOP_LEFT:
+ case Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_BOTTOM_RIGHT:
+ {
+ if(IsShowingGeometryOnScreen(rect))
+ {
+ mAccessibilityLastScreenRelativeMoveType = Dali::Accessibility::ScreenRelativeMoveType::INSIDE;
+ }
+ else
+ {
+ mAccessibilityLastScreenRelativeMoveType = Dali::Accessibility::ScreenRelativeMoveType::OUTSIDE;
+ }
+ break;
+ }
+ default:
+ {
+ break;
}
- return;
- }
-
- if(rect.width < 0)
- {
- mAccessibilityMovedOutOfScreenDirection = (accessibleRect.x < lastPosition.x) ? Dali::Accessibility::MovedOutOfScreenType::TOP_LEFT : Dali::Accessibility::MovedOutOfScreenType::BOTTOM_RIGHT;
- }
-
- if(rect.height < 0)
- {
- mAccessibilityMovedOutOfScreenDirection = (accessibleRect.y < lastPosition.y) ? Dali::Accessibility::MovedOutOfScreenType::TOP_LEFT : Dali::Accessibility::MovedOutOfScreenType::BOTTOM_RIGHT;
- }
-
- if(mAccessibilityMovedOutOfScreenDirection != Dali::Accessibility::MovedOutOfScreenType::NONE)
- {
- mAccessibilityObject.get()->EmitMovedOutOfScreen(mAccessibilityMovedOutOfScreenDirection);
- accessibleImpl->SetLastPosition(Vector2(0.0f, 0.0f));
- return;
}
accessibleImpl->SetLastPosition(Vector2(accessibleRect.x, accessibleRect.y));
{
return;
}
-
- mAccessibilityMovedOutOfScreenDirection = Dali::Accessibility::MovedOutOfScreenType::NONE;
- mAccessibilityPositionNotification = mControlImpl.Self().AddPropertyNotification(Actor::Property::WORLD_POSITION, StepCondition(1.0f, 1.0f));
+ // set default value until first move of object is detected
+ mAccessibilityLastScreenRelativeMoveType = Dali::Accessibility::ScreenRelativeMoveType::OUTSIDE;
+ // recalculate mAccessibilityLastScreenRelativeMoveType accordingly to the initial position
+ CheckHighlightedObjectGeometry();
+ mAccessibilityPositionNotification = mControlImpl.Self().AddPropertyNotification(Actor::Property::WORLD_POSITION, StepCondition(1.0f, 1.0f));
mAccessibilityPositionNotification.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED);
- mAccessibilityPositionNotification.NotifySignal().Connect(this, &Control::Impl::CheckHighlightedObjectGeometry);
+ mAccessibilityPositionNotification.NotifySignal().Connect(this, [this](PropertyNotification&){ CheckHighlightedObjectGeometry(); });
mIsAccessibilityPositionPropertyNotificationSet = true;
}
/**
* @brief Checks highlighted object geometry if it is showing or not
- * @param[in] propertyNotification PropertyNotification
*/
- void CheckHighlightedObjectGeometry(Dali::PropertyNotification& propertyNotification);
+ void CheckHighlightedObjectGeometry();
/**
* @brief Register property notification to check highlighted object position
// Accessibility - notification for highlighted object to check if it is showing.
bool mIsAccessibilityPositionPropertyNotificationSet{false};
Dali::PropertyNotification mAccessibilityPositionNotification;
- Dali::Accessibility::MovedOutOfScreenType mAccessibilityMovedOutOfScreenDirection{Accessibility::MovedOutOfScreenType::NONE};
+ Dali::Accessibility::ScreenRelativeMoveType mAccessibilityLastScreenRelativeMoveType;
};
} // namespace Internal