[NUI] Add a new Tizen.NUI.ICustomAwareDeviceFocusAlgorithm.
authorjoogab.yun <joogab.yun@samsung.com>
Fri, 4 Mar 2022 09:28:29 +0000 (18:28 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 29 Mar 2022 03:10:12 +0000 (12:10 +0900)
commit2c4dae8e2e5d3a6bb84f217def164bc0f2b1ff45
treee6a0b76145cf3942e6153391684e3261145a928d
parentd049d023e72d320fda805e25f621ee50f10e2af7
[NUI] Add a new Tizen.NUI.ICustomAwareDeviceFocusAlgorithm.

This interface takes an additional deviceName argument to GetNextFocusableView().
The deviceName is the name of the device where the key event occurred.

A new deviceName added to GetNextFocusableView() should not affect the current app.

Current apps are using the FocusManager.ICustomFocusAlgorithm interface.
So I created a new Tizen.NUI.ICustomAwareDeviceFocusAlgorithm interface.

for example)
Currently

``` c#
class CustomInterface : FocusManager.ICustomFocusAlgorithm
{
 public View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
 {
   return proposed;
 }
}
```

If you wnat to do GetNextFocusableView() with deviceName, you can inherit ICustomAwareDeviceFocusAlgorithm.

``` c#
class CustomInterface : Tizen.NUI.ICustomAwareDeviceFocusAlgorithm
{
 // This method is called when a direction key is pressed.
 public View GetNextFocusableView(View current, View proposed, View.FocusDirection direction, string deviceName)
 {
  return proposed;
 }

 // This method is never called.
 public View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
 {
  return proposed;
 }
}
```

dependency
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/271983/
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-csharp-binder/+/271984/
src/Tizen.NUI/src/internal/Common/CustomAlgorithmInterface.cs
src/Tizen.NUI/src/internal/Interop/Interop.CustomAlgorithmInterface.cs
src/Tizen.NUI/src/public/Input/FocusManager.cs
src/Tizen.NUI/src/public/Input/ICustomAwareDeviceFocusAlgorithm.cs [new file with mode: 0755]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/GetNextFocusSample.cs [new file with mode: 0644]