diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs index d20471ddd..fa1b4a373 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs @@ -22,7 +22,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella audioEngine = new AVAudioEngine(); liveSpeechRequest = new SFSpeechAudioBufferRecognitionRequest(); - + InitializeAvAudioSession(out _); var node = audioEngine.InputNode; diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs index 92e838f84..fe982d06a 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs @@ -9,6 +9,7 @@ namespace CommunityToolkit.Maui.Media; public sealed partial class SpeechToTextImplementation { [MemberNotNull(nameof(audioEngine), nameof(recognitionTask), nameof(liveSpeechRequest), nameof(getRecognitionTaskCompletionSource))] + [Obsolete] Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancellationToken) { speechRecognizer = new SFSpeechRecognizer(NSLocale.FromLocaleIdentifier(culture.Name)); @@ -22,7 +23,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella audioEngine = new AVAudioEngine(); liveSpeechRequest = new SFSpeechAudioBufferRecognitionRequest(); - + InitializeAvAudioSession(out var audioSession); var mode = audioSession.AvailableModes.Contains(AVAudioSession.ModeMeasurement) @@ -52,7 +53,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella { throw new Exception(error.LocalizedDescription); } - + cancellationToken.ThrowIfCancellationRequested(); var currentIndex = 0; diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs index 6a0c6639b..49154997f 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs @@ -77,7 +77,7 @@ void ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuous OnRecognitionResultUpdated(args.Result.Text); } - Task InternalStopListeningAsync(CancellationToken cancellationToken) => StopRecording(cancellationToken); + Task InternalStopListeningAsync(CancellationToken cancellationToken) => StopRecording(cancellationToken); async Task InternalListenAsync(CultureInfo culture, IProgress? recognitionResult, CancellationToken cancellationToken) { diff --git a/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.macios.cs b/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.macios.cs index f90e0eec4..c59c9f741 100644 --- a/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.macios.cs +++ b/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.macios.cs @@ -83,7 +83,7 @@ public static ValueTask GetImageStream(IList points, Size imageS { throw new InvalidOperationException("Unable to generate image. No Lines Found"); } - + return GetUIImage(points, (context, offset) => { foreach (var line in lines) diff --git a/src/CommunityToolkit.Maui.Core/Views/Popup/MauiPopup.macios.cs b/src/CommunityToolkit.Maui.Core/Views/Popup/MauiPopup.macios.cs index 6816775f1..df4682586 100644 --- a/src/CommunityToolkit.Maui.Core/Views/Popup/MauiPopup.macios.cs +++ b/src/CommunityToolkit.Maui.Core/Views/Popup/MauiPopup.macios.cs @@ -63,7 +63,7 @@ public override void ViewDidDisappear(bool animated) overlayView.RemoveFromSuperview(); overlayView.Dispose(); } - + base.ViewDidDisappear(animated); } diff --git a/src/CommunityToolkit.Maui.Maps/Handler/Map/MapHandler.Windows.cs b/src/CommunityToolkit.Maui.Maps/Handler/Map/MapHandler.Windows.cs index e398a2037..e20f3f4bd 100644 --- a/src/CommunityToolkit.Maui.Maps/Handler/Map/MapHandler.Windows.cs +++ b/src/CommunityToolkit.Maui.Maps/Handler/Map/MapHandler.Windows.cs @@ -40,6 +40,7 @@ public MapHandlerWindows() : base(Mapper, CommandMapper) /// + [Obsolete] protected override FrameworkElement CreatePlatformView() { if (string.IsNullOrEmpty(MapsKey)) diff --git a/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.android.cs b/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.android.cs index 2fffd701e..cbfedf253 100644 --- a/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.android.cs +++ b/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.android.cs @@ -12,6 +12,7 @@ namespace CommunityToolkit.Maui.Core.Views; /// public class MauiMediaElement : CoordinatorLayout { + [Obsolete] readonly StyledPlayerView playerView; /// @@ -19,6 +20,7 @@ public class MauiMediaElement : CoordinatorLayout /// /// The application's . /// The that acts as the platform media player. + [Obsolete] public MauiMediaElement(Context context, StyledPlayerView playerView) : base(context) { this.playerView = playerView; diff --git a/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs b/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs index f2b1fce00..78a959d2a 100644 --- a/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs +++ b/src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs @@ -42,7 +42,7 @@ public void Dispose() /// protected virtual void Dispose(bool disposing) { - if(isDisposed) + if (isDisposed) { return; } diff --git a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.android.cs b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.android.cs index 6a80f2715..c12cce03e 100644 --- a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.android.cs +++ b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.android.cs @@ -13,6 +13,7 @@ namespace CommunityToolkit.Maui.Core.Views; +[Obsolete] public partial class MediaManager : Java.Lang.Object, IPlayer.IListener { readonly SemaphoreSlim seekToSemaphoreSlim = new(1, 1); @@ -25,6 +26,7 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener /// /// The platform native counterpart of . /// + [Obsolete] protected StyledPlayerView? PlayerView { get; set; } /// @@ -32,6 +34,7 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener /// /// The platform native counterpart of . /// Thrown when is or when the platform view could not be created. + [Obsolete] public (PlatformMediaElement platformView, StyledPlayerView PlayerView) CreatePlatformView() { ArgumentNullException.ThrowIfNull(MauiContext.Context); @@ -56,6 +59,7 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener /// This is part of the implementation. /// While this method does not seem to have any references, it's invoked at runtime. /// + [Obsolete] public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters) { if (playbackParameters is null) @@ -78,6 +82,7 @@ public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters) /// This is part of the implementation. /// While this method does not seem to have any references, it's invoked at runtime. /// + [Obsolete] public void OnPlayerStateChanged(bool playWhenReady, int playbackState) { if (Player is null || MediaElement.Source is null) @@ -126,6 +131,7 @@ or PlaybackStateCompat.StateSkippingToQueueItem /// This is part of the implementation. /// While this method does not seem to have any references, it's invoked at runtime. /// + [Obsolete] public void OnPlaybackStateChanged(int playbackState) { if (MediaElement.Source is null) @@ -160,6 +166,7 @@ public void OnPlaybackStateChanged(int playbackState) /// This is part of the implementation. /// While this method does not seem to have any references, it's invoked at runtime. /// + [Obsolete] public void OnPlayerError(PlaybackException? error) { var errorMessage = string.Empty; @@ -251,6 +258,7 @@ protected virtual partial void PlatformPause() Player.Pause(); } + [Obsolete] protected virtual async partial Task PlatformSeek(TimeSpan position, CancellationToken token) { if (Player is null) @@ -290,6 +298,7 @@ protected virtual partial void PlatformStop() MediaElement.Position = TimeSpan.Zero; } + [Obsolete] protected virtual partial void PlatformUpdateSource() { var hasSetSource = false; @@ -355,6 +364,7 @@ protected virtual partial void PlatformUpdateSource() } } + [Obsolete] protected virtual partial void PlatformUpdateAspect() { if (PlayerView is null) @@ -471,6 +481,7 @@ protected virtual partial void PlatformUpdateShouldMute() Player.Volume = MediaElement.ShouldMute ? 0 : volumeBeforeMute; } + [Obsolete] protected virtual partial void PlatformUpdateShouldLoopPlayback() { if (Player is null) @@ -483,26 +494,49 @@ protected virtual partial void PlatformUpdateShouldLoopPlayback() #region IPlayer.IListener implementation method stubs + [Obsolete] public void OnAudioAttributesChanged(AudioAttributes? audioAttributes) { } public void OnAudioSessionIdChanged(int audioSessionId) { } + + [Obsolete] public void OnAvailableCommandsChanged(IPlayer.Commands? availableCommands) { } + + [Obsolete] public void OnCues(CueGroup? cueGroup) { } + + [Obsolete] public void OnCues(List cues) { } + + [Obsolete] public void OnDeviceInfoChanged(Com.Google.Android.Exoplayer2.DeviceInfo? deviceInfo) { } public void OnDeviceVolumeChanged(int volume, bool muted) { } + + [Obsolete] public void OnEvents(IPlayer? player, IPlayer.Events? events) { } public void OnIsLoadingChanged(bool isLoading) { } public void OnIsPlayingChanged(bool isPlaying) { } public void OnLoadingChanged(bool isLoading) { } public void OnMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs) { } + + [Obsolete] public void OnMediaItemTransition(MediaItem? mediaItem, int transition) { } + + [Obsolete] public void OnMediaMetadataChanged(MediaMetadata? mediaMetadata) { } + + [Obsolete] public void OnMetadata(Metadata? metadata) { } public void OnPlaybackSuppressionReasonChanged(int playbackSuppressionReason) { } + + [Obsolete] public void OnPlayerErrorChanged(PlaybackException? error) { } + + [Obsolete] public void OnPlaylistMetadataChanged(MediaMetadata? mediaMetadata) { } public void OnPlayWhenReadyChanged(bool playWhenReady, int reason) { } public void OnPositionDiscontinuity(int reason) { } + + [Obsolete] public void OnPositionDiscontinuity(IPlayer.PositionInfo oldPosition, IPlayer.PositionInfo newPosition, int reason) { } public void OnRenderedFirstFrame() { } public void OnRepeatModeChanged(int repeatMode) { } @@ -511,9 +545,17 @@ public void OnSeekForwardIncrementChanged(long seekForwardIncrementMs) { } public void OnShuffleModeEnabledChanged(bool shuffleModeEnabled) { } public void OnSkipSilenceEnabledChanged(bool skipSilenceEnabled) { } public void OnSurfaceSizeChanged(int width, int height) { } + + [Obsolete] public void OnTimelineChanged(Timeline? timeline, int reason) { } + + [Obsolete] public void OnTracksChanged(Tracks? tracks) { } + + [Obsolete] public void OnTrackSelectionParametersChanged(TrackSelectionParameters? trackSelectionParameters) { } + + [Obsolete] public void OnVideoSizeChanged(VideoSize? videoSize) { } #endregion diff --git a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs index 253f5beaa..f60e95621 100644 --- a/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs +++ b/src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs @@ -63,6 +63,7 @@ public MediaManager(IMauiContext context, IMediaElement mediaElement, IDispatche /// /// The platform-specific media player. /// + [Obsolete] protected PlatformMediaElement? Player { get; set; } #endif diff --git a/src/CommunityToolkit.Maui.UnitTests/Behaviors/MaxLengthReachedBehaviorTests.cs b/src/CommunityToolkit.Maui.UnitTests/Behaviors/MaxLengthReachedBehaviorTests.cs index 4581919c7..a78964e79 100644 --- a/src/CommunityToolkit.Maui.UnitTests/Behaviors/MaxLengthReachedBehaviorTests.cs +++ b/src/CommunityToolkit.Maui.UnitTests/Behaviors/MaxLengthReachedBehaviorTests.cs @@ -140,6 +140,7 @@ public void ShouldNotDismissKeyboardWhenOptionSetToFalse() Assert.True(entry.IsFocused); } + [Obsolete] static Entry CreateEntry(int? maxLength = 2, bool shouldDismissKeyboardAutomatically = false, ICommand? command = null, diff --git a/src/CommunityToolkit.Maui.UnitTests/Behaviors/SetFocusOnEntryCompletedTests.cs b/src/CommunityToolkit.Maui.UnitTests/Behaviors/SetFocusOnEntryCompletedTests.cs index 209afa79b..3bb4bd220 100644 --- a/src/CommunityToolkit.Maui.UnitTests/Behaviors/SetFocusOnEntryCompletedTests.cs +++ b/src/CommunityToolkit.Maui.UnitTests/Behaviors/SetFocusOnEntryCompletedTests.cs @@ -35,6 +35,7 @@ public void SetsFocusWhenCompleted() Assert.True(entry2.IsFocused); } + [Obsolete] static Entry CreateEntry(VisualElement? nextElement = null) { var entry = new Entry(); diff --git a/src/CommunityToolkit.Maui.UnitTests/Behaviors/UserStoppedTypingBehaviorTests.cs b/src/CommunityToolkit.Maui.UnitTests/Behaviors/UserStoppedTypingBehaviorTests.cs index 4ae9fbe3d..1a8e833a2 100644 --- a/src/CommunityToolkit.Maui.UnitTests/Behaviors/UserStoppedTypingBehaviorTests.cs +++ b/src/CommunityToolkit.Maui.UnitTests/Behaviors/UserStoppedTypingBehaviorTests.cs @@ -239,6 +239,7 @@ public async Task ShouldExecuteCommandImmediatelyWhenMinimumLengthThresholdHasNo Assert.True(commandHasBeenExecuted); } + [Obsolete] static Entry CreateEntryWithBehavior(int stoppedTypingTimeThreshold = 500, int minimumLengthThreshold = 0, bool shouldDismissKeyboardAutomatically = false, diff --git a/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs b/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs index 6e45205fa..fb50a1cdc 100644 --- a/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs +++ b/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs @@ -26,8 +26,8 @@ public class AnimationBehavior : EventToCommandBehavior /// Gets the Command that allows the triggering of the animation. /// /// - /// has a of Command<CancellationToken> which requires a as a CommandParameter. See and for more information on passing a into as a CommandParameter" - /// + /// has a of Command<CancellationToken> which requires a as a CommandParameter. See and for more information on passing a into as a CommandParameter" + /// public Command AnimateCommand => (Command)GetValue(AnimateCommandProperty); /// diff --git a/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs b/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs index 70bb22935..bbc6fca46 100644 --- a/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs +++ b/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs @@ -250,7 +250,7 @@ public IList StyleClass /// TaskCompletionSource IAsynchronousHandler.HandlerCompleteTCS => popupDismissedTaskCompletionSource; - + /// bool IResourcesProvider.IsResourcesCreated => resources is not null;