* 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 Tizen.System;
namespace Tizen.NUI.Components
{
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.
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
{
tapGestureDetector.Detected -= OnTapGestureDetected;
tapGestureDetector.Detach(this);
+
+ if (feedback != null)
+ {
+ feedback.Stop();
+ feedback = null;
+ }
}
base.Dispose(type);
/// <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.
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
{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