Skip to content

Commit

Permalink
[NUI] Remove the legacy code of AccessibilityManager
Browse files Browse the repository at this point in the history
- `AccessibilityManager` hasn't been used anymore after Tizen 7.0 version.
- Now, all the legacy codes of AccessibilityManager should be removed
 in order to prevent the confusion.
- All Accessibility APIs are not public ones because they have never done ACR before,
 and that's why we can remove the codes like this.

Signed-off-by: Seoyeon Kim <[email protected]>
  • Loading branch information
Seoyeon2Kim committed Nov 20, 2024
1 parent 297a127 commit 61b1e4f
Show file tree
Hide file tree
Showing 26 changed files with 1 addition and 4,544 deletions.
3 changes: 0 additions & 3 deletions src/Tizen.NUI.Components/Controls/Button.Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Diagnostics;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components.Extension;
using Tizen.NUI.Accessibility; // To use AccessibilityManager

namespace Tizen.NUI.Components
{
Expand Down Expand Up @@ -278,8 +277,6 @@ public override void OnInitialize()
AccessibilityHighlightable = true;
EnableControlStatePropagation = true;

AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "Button");

buttonText = CreateText();
buttonIcon = CreateIcon();
LayoutItems();
Expand Down
3 changes: 0 additions & 3 deletions src/Tizen.NUI.Components/Controls/Loading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Diagnostics;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding;
using Tizen.NUI.Accessibility;

namespace Tizen.NUI.Components
{
Expand Down Expand Up @@ -267,8 +266,6 @@ public override void OnInitialize()
AccessibilityRole = Role.ProgressBar;

EnsureLottieView(lottieResource);

AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "Loading");
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using System;
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Accessibility;

namespace Tizen.NUI.Components
{
Expand Down Expand Up @@ -127,7 +126,7 @@ public string IconUrl
// Tizen.Log.Error("IconUrl only can set Icon is ImageView");
return;
}
(Icon as ImageView).ResourceUrl = value;
(Icon as ImageView).ResourceUrl = value;
}
}
*/
Expand All @@ -154,7 +153,6 @@ public TextLabel Label
internal set
{
itemLabel = value;
AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Label, itemLabel.Text);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using System;
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Accessibility; // To use AccessibilityManager

namespace Tizen.NUI.Components
{
Expand Down Expand Up @@ -198,8 +197,6 @@ public override void OnInitialize()
Layout = new AbsoluteLayout();
UpdateState();

AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "ViewItem");

AccessibilityRole = Role.ListItem;
AccessibilityHighlightable = true;
}
Expand Down
14 changes: 0 additions & 14 deletions src/Tizen.NUI.Components/Controls/ScrollableBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Tizen.NUI.Accessibility;

namespace Tizen.NUI.Components
{
Expand Down Expand Up @@ -963,8 +962,6 @@ private void Initialize()

WheelEvent += OnWheelEvent;

AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "ScrollableBase");

SetKeyboardNavigationSupport(true);
}

Expand Down Expand Up @@ -1810,17 +1807,6 @@ internal void BaseRemove(View view)
base.Remove(view);
}

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)
Expand Down

This file was deleted.

This file was deleted.

42 changes: 0 additions & 42 deletions src/Tizen.NUI/src/internal/Common/ViewImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,27 +337,6 @@ public virtual bool OnAccessibilityActivated()
return ret;
}

public virtual bool OnAccessibilityPan(PanGesture gesture)
{
bool ret = (SwigDerivedClassHasMethod("OnAccessibilityPan", swigMethodTypes26) ? Interop.ViewImplSignal.OnAccessibilityPanSwigExplicitViewImpl(SwigCPtr, PanGesture.getCPtr(gesture)) : Interop.ViewImplSignal.OnAccessibilityPan(SwigCPtr, PanGesture.getCPtr(gesture)));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}

public virtual bool OnAccessibilityValueChange(bool isIncrease)
{
bool ret = (SwigDerivedClassHasMethod("OnAccessibilityValueChange", swigMethodTypes28) ? Interop.ViewImplSignal.OnAccessibilityValueChangeSwigExplicitViewImpl(SwigCPtr, isIncrease) : Interop.ViewImplSignal.OnAccessibilityValueChange(SwigCPtr, isIncrease));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}

public virtual bool OnAccessibilityZoom()
{
bool ret = (SwigDerivedClassHasMethod("OnAccessibilityZoom", swigMethodTypes29) ? Interop.ViewImplSignal.OnAccessibilityZoomSwigExplicitViewImpl(SwigCPtr) : Interop.ViewImplSignal.OnAccessibilityZoom(SwigCPtr));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}

public virtual void OnKeyInputFocusGained()
{
if (SwigDerivedClassHasMethod("OnKeyInputFocusGained", swigMethodTypes30)) Interop.ViewImplSignal.OnKeyInputFocusGainedSwigExplicitViewImpl(SwigCPtr); else Interop.ViewImplSignal.OnKeyInputFocusGained(SwigCPtr);
Expand Down Expand Up @@ -470,12 +449,6 @@ private void SwigDirectorConnect()
swigDelegate24 = new SwigDelegateViewImpl_24(SwigDirectorOnStyleChange);
if (SwigDerivedClassHasMethod("OnAccessibilityActivated", swigMethodTypes25))
swigDelegate25 = new SwigDelegateViewImpl_25(SwigDirectorOnAccessibilityActivated);
if (SwigDerivedClassHasMethod("OnAccessibilityPan", swigMethodTypes26))
swigDelegate26 = new SwigDelegateViewImpl_26(SwigDirectorOnAccessibilityPan);
if (SwigDerivedClassHasMethod("OnAccessibilityValueChange", swigMethodTypes28))
swigDelegate28 = new SwigDelegateViewImpl_28(SwigDirectorOnAccessibilityValueChange);
if (SwigDerivedClassHasMethod("OnAccessibilityZoom", swigMethodTypes29))
swigDelegate29 = new SwigDelegateViewImpl_29(SwigDirectorOnAccessibilityZoom);
if (SwigDerivedClassHasMethod("OnKeyInputFocusGained", swigMethodTypes30))
swigDelegate30 = new SwigDelegateViewImpl_30(SwigDirectorOnKeyInputFocusGained);
if (SwigDerivedClassHasMethod("OnKeyInputFocusLost", swigMethodTypes31))
Expand Down Expand Up @@ -675,21 +648,6 @@ private bool SwigDirectorOnAccessibilityActivated()
return OnAccessibilityActivated();
}

private bool SwigDirectorOnAccessibilityPan(global::System.IntPtr gesture)
{
return OnAccessibilityPan(new PanGesture(gesture, false));
}

private bool SwigDirectorOnAccessibilityValueChange(bool isIncrease)
{
return OnAccessibilityValueChange(isIncrease);
}

private bool SwigDirectorOnAccessibilityZoom()
{
return OnAccessibilityZoom();
}

private void SwigDirectorOnKeyInputFocusGained()
{
OnKeyInputFocusGained();
Expand Down
30 changes: 0 additions & 30 deletions src/Tizen.NUI/src/internal/Common/ViewWrapperImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ internal sealed class ViewWrapperImpl : ViewImpl
/// <since_tizen> 3 </since_tizen>
public delegate bool OnAccessibilityActivatedDelegate();
/// <since_tizen> 3 </since_tizen>
public delegate bool OnAccessibilityPanDelegate(PanGesture gestures);
/// <since_tizen> 3 </since_tizen>
public delegate bool OnAccessibilityValueChangeDelegate(bool isIncrease);
/// <since_tizen> 3 </since_tizen>
public delegate bool OnAccessibilityZoomDelegate();
/// <since_tizen> 3 </since_tizen>
public delegate void OnFocusGainedDelegate();
/// <since_tizen> 3 </since_tizen>
public delegate void OnFocusLostDelegate();
Expand Down Expand Up @@ -117,9 +111,6 @@ internal sealed class ViewWrapperImpl : ViewImpl
public new OnLayoutNegotiatedDelegate OnLayoutNegotiated;
public new OnStyleChangeDelegate OnStyleChange;
public new OnAccessibilityActivatedDelegate OnAccessibilityActivated;
public new OnAccessibilityPanDelegate OnAccessibilityPan;
public new OnAccessibilityValueChangeDelegate OnAccessibilityValueChange;
public new OnAccessibilityZoomDelegate OnAccessibilityZoom;
public OnFocusGainedDelegate OnFocusGained;
public OnFocusLostDelegate OnFocusLost;
public new GetNextFocusableViewDelegate GetNextFocusableView;
Expand Down Expand Up @@ -289,9 +280,6 @@ private void DirectorConnect()
Delegate21 = new DelegateViewWrapperImpl_21(DirectorOnInitialize);
Delegate24 = new DelegateViewWrapperImpl_24(DirectorOnStyleChange);
Delegate25 = new DelegateViewWrapperImpl_25(DirectorOnAccessibilityActivated);
Delegate26 = new DelegateViewWrapperImpl_26(DirectorOnAccessibilityPan);
Delegate28 = new DelegateViewWrapperImpl_28(DirectorOnAccessibilityValueChange);
Delegate29 = new DelegateViewWrapperImpl_29(DirectorOnAccessibilityZoom);
Delegate30 = new DelegateViewWrapperImpl_30(DirectorOnFocusGained);
Delegate31 = new DelegateViewWrapperImpl_31(DirectorOnFocusLost);
Delegate32 = new DelegateViewWrapperImpl_32(DirectorGetNextFocusableActor);
Expand Down Expand Up @@ -509,24 +497,6 @@ private bool DirectorOnAccessibilityActivated()
return OnAccessibilityActivated?.Invoke() ?? false;
}

private bool DirectorOnAccessibilityPan(global::System.IntPtr gesture)
{
var panGesture = new PanGesture(gesture, false);
var ret = OnAccessibilityPan?.Invoke(panGesture) ?? false;
panGesture.Dispose();
return ret;
}

private bool DirectorOnAccessibilityValueChange(bool isIncrease)
{
return OnAccessibilityValueChange?.Invoke(isIncrease) ?? false;
}

private bool DirectorOnAccessibilityZoom()
{
return OnAccessibilityZoom?.Invoke() ?? false;
}

private void DirectorOnFocusGained()
{
OnFocusGained?.Invoke();
Expand Down
Loading

0 comments on commit 61b1e4f

Please sign in to comment.