- To get Accessibility Activated signal to Button components,
added and connected OnAccessibilityActivated in Button.
- To get Accessibility Pan signal to ScrollableBase,
added OnAccessibilityPan method to be overridden.
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
+ internal override bool OnAccessibilityActivated()
+ {
+ if (!IsEnabled)
+ {
+ return false;
+ }
+
+ // Touch Down
+ isPressed = true;
+ UpdateState();
+
+ // Touch Up
+ bool clicked = isPressed && IsEnabled;
+ isPressed = false;
+
+ if (IsSelectable)
+ {
+ IsSelected = !IsSelected;
+ }
+ else
+ {
+ UpdateState();
+ }
+
+ if (clicked)
+ {
+ ClickedEventArgs eventArgs = new ClickedEventArgs();
+ OnClickedInternal(eventArgs);
+ }
+ return true;
+ }
+
- /// The composition of a Scrollbar can vary depending on how you use ScrollableBase.
+ /// The composition of a Scrollbar can vary depending on how you use ScrollableBase.
/// Set the composition that will go into the ScrollableBase according to your ScrollableBase.
/// </summary>
/// <since_tizen> 8 </since_tizen>
/// Set the composition that will go into the ScrollableBase according to your ScrollableBase.
/// </summary>
/// <since_tizen> 8 </since_tizen>
private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
{
private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
{
+ OnPanGesture(e.PanGesture);
+ }
+
+ private void OnPanGesture(PanGesture panGesture)
+ {
if (SnapToPage && scrollAnimation != null && scrollAnimation.State == Animation.States.Playing)
{
return;
}
if (SnapToPage && scrollAnimation != null && scrollAnimation.State == Animation.States.Playing)
{
return;
}
- if (e.PanGesture.State == Gesture.StateType.Started)
+ if (panGesture.State == Gesture.StateType.Started)
{
readyToNotice = false;
base.Add(mInterruptTouchingChild);
{
readyToNotice = false;
base.Add(mInterruptTouchingChild);
totalDisplacementForPan = 0.0f;
OnScrollDragStarted();
}
totalDisplacementForPan = 0.0f;
OnScrollDragStarted();
}
- else if (e.PanGesture.State == Gesture.StateType.Continuing)
+ else if (panGesture.State == Gesture.StateType.Continuing)
{
if (ScrollingDirection == Direction.Horizontal)
{
{
if (ScrollingDirection == Direction.Horizontal)
{
- ScrollBy(e.PanGesture.Displacement.X, false);
- totalDisplacementForPan += e.PanGesture.Displacement.X;
+ ScrollBy(panGesture.Displacement.X, false);
+ totalDisplacementForPan += panGesture.Displacement.X;
- ScrollBy(e.PanGesture.Displacement.Y, false);
- totalDisplacementForPan += e.PanGesture.Displacement.Y;
+ ScrollBy(panGesture.Displacement.Y, false);
+ totalDisplacementForPan += panGesture.Displacement.Y;
}
Debug.WriteLineIf(LayoutDebugScrollableBase, "OnPanGestureDetected Continue totalDisplacementForPan:" + totalDisplacementForPan);
}
}
Debug.WriteLineIf(LayoutDebugScrollableBase, "OnPanGestureDetected Continue totalDisplacementForPan:" + totalDisplacementForPan);
}
- else if (e.PanGesture.State == Gesture.StateType.Finished)
+ else if (panGesture.State == Gesture.StateType.Finished)
{
OnScrollDragEnded();
StopScroll(); // Will replace previous animation so will stop existing one.
{
OnScrollDragEnded();
StopScroll(); // Will replace previous animation so will stop existing one.
scrollAnimation.Finished += ScrollAnimationFinished;
}
scrollAnimation.Finished += ScrollAnimationFinished;
}
- float panVelocity = (ScrollingDirection == Direction.Horizontal) ? e.PanGesture.Velocity.X : e.PanGesture.Velocity.Y;
+ float panVelocity = (ScrollingDirection == Direction.Horizontal) ? panGesture.Velocity.X : panGesture.Velocity.Y;
+ internal override bool OnAccessibilityPan(PanGesture gestures)
+ {
+ if (SnapToPage && scrollAnimation != null && scrollAnimation.State == Animation.States.Playing)
+ {
+ return false;
+ }
+
+ OnPanGesture(gestures);
+ return true;
+ }
+
private float CustomScrollAlphaFunction(float progress)
{
if (panAnimationDelta == 0)
private float CustomScrollAlphaFunction(float progress)
{
if (panAnimationDelta == 0)
// X(∞) = V0 * d / (1 - d); <-- Result using inifit T can be final position because T is tending to infinity.
//
// Because of final T is tending to inifity, we should use threshold value to finish.
// X(∞) = V0 * d / (1 - d); <-- Result using inifit T can be final position because T is tending to infinity.
//
// Because of final T is tending to inifity, we should use threshold value to finish.
- // Final T = log(-threshold * log d / |V0| ) / log d;
+ // Final T = log(-threshold * log d / |V0| ) / log d;
velocityOfLastPan = Math.Abs(velocity);
velocityOfLastPan = Math.Abs(velocity);