diff --git a/CREDITS.md b/CREDITS.md index d6a8bd5..f7283b2 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,6 +1,9 @@ # Credits ## Contributions - Lukas Kurz (@ShortDevelopment) + +## Audio Design + - @Apates ## Translations - Guille (@Sappstal) (Spanish) & (Catalan (Valencian)) diff --git a/Nearby Sharing Windows/Resources/raw/ding.mp3 b/Nearby Sharing Windows/Resources/raw/ding.mp3 new file mode 100644 index 0000000..ec74645 Binary files /dev/null and b/Nearby Sharing Windows/Resources/raw/ding.mp3 differ diff --git a/Nearby Sharing Windows/Resources/raw/pop.mp3 b/Nearby Sharing Windows/Resources/raw/pop.mp3 new file mode 100644 index 0000000..a1cb0a5 Binary files /dev/null and b/Nearby Sharing Windows/Resources/raw/pop.mp3 differ diff --git a/Nearby Sharing Windows/SendActivity.cs b/Nearby Sharing Windows/SendActivity.cs index a9a6d1a..017c89c 100644 --- a/Nearby Sharing Windows/SendActivity.cs +++ b/Nearby Sharing Windows/SendActivity.cs @@ -158,6 +158,7 @@ private void Platform_DeviceDiscovered(ICdpTransport sender, CdpDevice device) RemoteSystems.Insert(newIndex, device); _dialog.FindViewById(Resource.Id.emptyDeviceListView)!.Visibility = ViewStates.Gone; + this.PlaySound(Resource.Raw.pop); } }); @@ -260,7 +261,7 @@ private async void SendData(CdpDevice remoteSystem) ]); StatusTextView.Text = this.Localize(Resource.String.status_done); - readyButton.Visibility = ViewStates.Visible; + this.PlaySound(Resource.Raw.ding); } catch (TaskCanceledException) { diff --git a/Nearby Sharing Windows/UIHelper.cs b/Nearby Sharing Windows/UIHelper.cs index 86d72f2..ed025db 100644 --- a/Nearby Sharing Windows/UIHelper.cs +++ b/Nearby Sharing Windows/UIHelper.cs @@ -1,6 +1,7 @@ using Android.Animation; using Android.Content; using Android.Content.PM; +using Android.Media; using Android.Text; using Android.Util; using Android.Views; @@ -195,4 +196,10 @@ public static int GetColorAttr(this Context context, int attr) errorDialogBuilder.SetNeutralButton("Ok", (s, e) => { }); return errorDialogBuilder.Show(); } + + public static void PlaySound(this Context context, int soundId) + { + MediaPlayer player = MediaPlayer.Create(context, soundId) ?? throw new NullReferenceException("Could not create MediaPlayer"); + player.Start(); + } } \ No newline at end of file