-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] The default click sound on button press is lost after updating xamarin forms nuget. #10035
Comments
Hey @jessiezh0320 thanks for the report! I can't seem to detect which platform you are talking about. Is this iOS, Android, UWP? As far as I can recall none of these have a "click" sound, so I'm curious to find out what this is about. Thanks! |
Hi @jfversluis this concerns Android platform. |
I have just tried this project on a recent device (Galaxy S10) and I don't hear a clicking sound out of the box. However, I can enable the sound by going into the settings of the phone and enabling it under touch interactions (might be named differently in other Android versions). When I then upgrade to 4.5 stable, even with the OS setting on, the touch feedback is no longer there. I think this is something that is dropped with the Material design, but I can't find any source to back that up. |
@jfversluis Yes, this problem does exist on the Android platform. I hope you can help solve this problem.Thanks. |
I was going through the ButtonRenderer on Android for a different reason, but found this: https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs#L310
@jessiezh0320 could you do me a favor and try to enable the legacy renderers (see the doc) and see if that brings back the sound? |
@jfversluis |
OK so, what I found is that on a VisualElement level the On a Button, but only for the fast renderer, this is repeated here: https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.Android/FastRenderers/ButtonRenderer.cs#L312 However! For the The main question is: why are we setting the I would say; let's just remove the hard setting |
Totally agree with @jfversluis here. The click sound is so important as user feedback sometimes that it should be free to the developer when to enable or disable it. Comparing a native and xamarin.forms app the first thing i always notice is that there is no click sound feedback on a button. If the user does not want any click sounds, he can just disable it in the system. |
I worked around it using this renderer public class ButtonFeedbackRenderer : ButtonRenderer
|
Description
The default click sound on button press is lost after updating xamarin forms nuget to the newer version(e.g. 4.3.0.908675).
But in older version, the default click sound on button press still exists.(e.g.Xamarin forms nuget 3.6.0.293080)
Steps to Reproduce
Create a new xamari forms demo and add a button in xaml;
<Button Text="test" VerticalOptions="Center" HorizontalOptions="Center" Clicked="Button_Clicked"/>
Then add event
Click
for the Button;private void Button_Clicked(object sender, EventArgs e) { }
Put on headphone and run the app , click the button, and pay attention to the sound when clicking the Button.
Expected Behavior
The default click sound on button press is not lost after updating xamarin forms nuget.
remains the same as the old version
Actual Behavior
The default click sound on button press is lost after updating xamarin forms nuget.
Basic Information
The text was updated successfully, but these errors were encountered: