[NUI] Fix Switch selection bug. (#1798)
authorJiyun Yang <ji.yang@samsung.com>
Fri, 3 Jul 2020 10:33:37 +0000 (19:33 +0900)
committerGitHub <noreply@github.com>
Fri, 3 Jul 2020 10:33:37 +0000 (19:33 +0900)
commit3aef9c55da730ee0b73edbfa5f6f521a2870c0ba
tree270ffc7299f691614b8e251657d15ee75e3c1c40
parentd794959fd3366478ebecb5b5e57f36e1ec327cc8
[NUI] Fix Switch selection bug. (#1798)

Previously, when a Switch is selected by code, the thumb is not moved to left/right.
```
var switchButton = new Switch()
{
  IsSelected = true,
}
```
Thumb is moved only if the user touches the switch area or presses return key.

This patch fixes this problem and to do that, it needed to change belows,

* Switch does not listen Touch/Key event anymore to detect selection changed
  Instead it uses ControlState changed event which is clearer.
* Button produces more complicate combined state such as "SelectedPressed".
* Clean up the code that is redundant in Selector.GetValue().

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Components/Controls/Button.Internal.cs
src/Tizen.NUI.Components/Controls/Button.cs
src/Tizen.NUI.Components/Controls/Extension/SlidingSwitchExtension.cs
src/Tizen.NUI.Components/Controls/Extension/SwitchExtension.cs
src/Tizen.NUI.Components/Controls/Switch.cs
src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs