projects
/
platform
/
core
/
csapi
/
tizenfx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c4c18d4
)
[NUI] Add sound feedback for Control
author
zhouleonlei
<zhouleon.lei@samsung.com>
Fri, 11 Dec 2020 07:31:03 +0000
(15:31 +0800)
committer
dongsug-song
<35130733+dongsug-song@users.noreply.github.com>
Tue, 15 Dec 2020 06:33:59 +0000
(15:33 +0900)
src/Tizen.NUI.Components/Controls/Control.cs
patch
|
blob
|
history
src/Tizen.NUI.Components/Tizen.NUI.Components.csproj
patch
|
blob
|
history
src/Tizen.NUI.Components/Tizen.NUI.Components.sln
patch
|
blob
|
history
diff --git
a/src/Tizen.NUI.Components/Controls/Control.cs
b/src/Tizen.NUI.Components/Controls/Control.cs
index
8daafcf
..
959d58a
100755
(executable)
--- a/
src/Tizen.NUI.Components/Controls/Control.cs
+++ b/
src/Tizen.NUI.Components/Controls/Control.cs
@@
-14,12
+14,14
@@
* limitations under the License.
*
*/
* limitations under the License.
*
*/
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding;
using System.Windows.Input;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding;
using System.Windows.Input;
+using Tizen.System;
namespace Tizen.NUI.Components
{
namespace Tizen.NUI.Components
{
@@
-42,6
+44,8
@@
namespace Tizen.NUI.Components
private bool onThemeChangedEventOverrideChecker;
private bool onThemeChangedEventOverrideChecker;
+ private Feedback feedback = new Feedback();
+
private TapGestureDetector tapGestureDetector = new TapGestureDetector();
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
private TapGestureDetector tapGestureDetector = new TapGestureDetector();
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
@@
-90,6
+94,13
@@
namespace Tizen.NUI.Components
ThemeChangeSensitive = true;
}
ThemeChangeSensitive = true;
}
+ /// <summary>
+ /// The flag of sound feedback when tap gesture detected.
+ /// </summary>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool IsTapGestureFeedback { get; set; } = false;
+
/// Internal used.
[EditorBrowsable(EditorBrowsableState.Never)]
public ICommand Command
/// Internal used.
[EditorBrowsable(EditorBrowsableState.Never)]
public ICommand Command
@@
-148,6
+159,12
@@
namespace Tizen.NUI.Components
{
tapGestureDetector.Detected -= OnTapGestureDetected;
tapGestureDetector.Detach(this);
{
tapGestureDetector.Detected -= OnTapGestureDetected;
tapGestureDetector.Detach(this);
+
+ if (feedback != null)
+ {
+ feedback.Stop();
+ feedback = null;
+ }
}
base.Dispose(type);
}
base.Dispose(type);
@@
-213,7
+230,16
@@
namespace Tizen.NUI.Components
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected virtual void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e) { }
+ protected virtual void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e)
+ {
+ if (IsTapGestureFeedback && e?.TapGesture?.State == Gesture.StateType.Started)
+ {
+ if (feedback != null && feedback.IsSupportedPattern(FeedbackType.Sound, "Tap"))
+ {
+ feedback.Play(FeedbackType.Sound, "Tap");
+ }
+ }
+ }
/// <summary>
/// Update by style.
/// <summary>
/// Update by style.
diff --git
a/src/Tizen.NUI.Components/Tizen.NUI.Components.csproj
b/src/Tizen.NUI.Components/Tizen.NUI.Components.csproj
index
cfc5d93
..
f4bd4d6
100755
(executable)
--- a/
src/Tizen.NUI.Components/Tizen.NUI.Components.csproj
+++ b/
src/Tizen.NUI.Components/Tizen.NUI.Components.csproj
@@
-8,6
+8,7
@@
<ItemGroup>
<ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
<ProjectReference Include="..\Tizen.NUI\Tizen.NUI.csproj" />
<ItemGroup>
<ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
<ProjectReference Include="..\Tizen.NUI\Tizen.NUI.csproj" />
+ <ProjectReference Include="..\Tizen.System.Feedback\Tizen.System.Feedback.csproj" />
<ProjectReference Include="..\Tizen.System.Information\Tizen.System.Information.csproj" />
</ItemGroup>
<ProjectReference Include="..\Tizen.System.Information\Tizen.System.Information.csproj" />
</ItemGroup>
diff --git
a/src/Tizen.NUI.Components/Tizen.NUI.Components.sln
b/src/Tizen.NUI.Components/Tizen.NUI.Components.sln
index
f3d1317
..
12c4174
100755
(executable)
--- a/
src/Tizen.NUI.Components/Tizen.NUI.Components.sln
+++ b/
src/Tizen.NUI.Components/Tizen.NUI.Components.sln
@@
-19,6
+19,8
@@
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{11CACB07-AF47-480E-AB25-88E3C3297631}"
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{11CACB07-AF47-480E-AB25-88E3C3297631}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Feedback", "..\Tizen.System.Feedback\Tizen.System.Feedback.csproj", "{675DA71D-4314-4F10-8632-C804A9F720D4}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@
-57,6
+59,10
@@
Global
{11CACB07-AF47-480E-AB25-88E3C3297631}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11CACB07-AF47-480E-AB25-88E3C3297631}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11CACB07-AF47-480E-AB25-88E3C3297631}.Release|Any CPU.Build.0 = Release|Any CPU
{11CACB07-AF47-480E-AB25-88E3C3297631}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11CACB07-AF47-480E-AB25-88E3C3297631}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11CACB07-AF47-480E-AB25-88E3C3297631}.Release|Any CPU.Build.0 = Release|Any CPU
+ {675DA71D-4314-4F10-8632-C804A9F720D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {675DA71D-4314-4F10-8632-C804A9F720D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {675DA71D-4314-4F10-8632-C804A9F720D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {675DA71D-4314-4F10-8632-C804A9F720D4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE