Skip to content

Commit

Permalink
Automated dotnet-format update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 27, 2023
1 parent 7160815 commit 9177ee6
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella

audioEngine = new AVAudioEngine();
liveSpeechRequest = new SFSpeechAudioBufferRecognitionRequest();

InitializeAvAudioSession(out _);

var node = audioEngine.InputNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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)
Expand Down Expand Up @@ -52,7 +53,7 @@ Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancella
{
throw new Exception(error.LocalizedDescription);
}

cancellationToken.ThrowIfCancellationRequested();

var currentIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> InternalListenAsync(CultureInfo culture, IProgress<string>? recognitionResult, CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static ValueTask<Stream> GetImageStream(IList<PointF> points, Size imageS
{
throw new InvalidOperationException("Unable to generate image. No Lines Found");
}

return GetUIImage(points, (context, offset) =>
{
foreach (var line in lines)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public override void ViewDidDisappear(bool animated)
overlayView.RemoveFromSuperview();
overlayView.Dispose();
}

base.ViewDidDisappear(animated);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public MapHandlerWindows() : base(Mapper, CommandMapper)

/// <inheritdoc/>

[Obsolete]
protected override FrameworkElement CreatePlatformView()
{
if (string.IsNullOrEmpty(MapsKey))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ namespace CommunityToolkit.Maui.Core.Views;
/// </summary>
public class MauiMediaElement : CoordinatorLayout
{
[Obsolete]
readonly StyledPlayerView playerView;

/// <summary>
/// Initializes a new instance of the <see cref="MauiMediaElement"/> class.
/// </summary>
/// <param name="context">The application's <see cref="Context"/>.</param>
/// <param name="playerView">The <see cref="StyledPlayerView"/> that acts as the platform media player.</param>
[Obsolete]
public MauiMediaElement(Context context, StyledPlayerView playerView) : base(context)
{
this.playerView = playerView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void Dispose()
/// </summary>
protected virtual void Dispose(bool disposing)
{
if(isDisposed)
if (isDisposed)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -25,13 +26,15 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
/// <summary>
/// The platform native counterpart of <see cref="MediaElement"/>.
/// </summary>
[Obsolete]
protected StyledPlayerView? PlayerView { get; set; }

/// <summary>
/// Creates the corresponding platform view of <see cref="MediaElement"/> on Android.
/// </summary>
/// <returns>The platform native counterpart of <see cref="MediaElement"/>.</returns>
/// <exception cref="NullReferenceException">Thrown when <see cref="Android.Content.Context"/> is <see langword="null"/> or when the platform view could not be created.</exception>
[Obsolete]
public (PlatformMediaElement platformView, StyledPlayerView PlayerView) CreatePlatformView()
{
ArgumentNullException.ThrowIfNull(MauiContext.Context);
Expand All @@ -56,6 +59,7 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
/// While this method does not seem to have any references, it's invoked at runtime.
/// </remarks>
[Obsolete]
public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters)
{
if (playbackParameters is null)
Expand All @@ -78,6 +82,7 @@ public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters)
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
/// While this method does not seem to have any references, it's invoked at runtime.
/// </remarks>
[Obsolete]
public void OnPlayerStateChanged(bool playWhenReady, int playbackState)
{
if (Player is null || MediaElement.Source is null)
Expand Down Expand Up @@ -126,6 +131,7 @@ or PlaybackStateCompat.StateSkippingToQueueItem
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
/// While this method does not seem to have any references, it's invoked at runtime.
/// </remarks>
[Obsolete]
public void OnPlaybackStateChanged(int playbackState)
{
if (MediaElement.Source is null)
Expand Down Expand Up @@ -160,6 +166,7 @@ public void OnPlaybackStateChanged(int playbackState)
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
/// While this method does not seem to have any references, it's invoked at runtime.
/// </remarks>
[Obsolete]
public void OnPlayerError(PlaybackException? error)
{
var errorMessage = string.Empty;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -290,6 +298,7 @@ protected virtual partial void PlatformStop()
MediaElement.Position = TimeSpan.Zero;
}

[Obsolete]
protected virtual partial void PlatformUpdateSource()
{
var hasSetSource = false;
Expand Down Expand Up @@ -355,6 +364,7 @@ protected virtual partial void PlatformUpdateSource()
}
}

[Obsolete]
protected virtual partial void PlatformUpdateAspect()
{
if (PlayerView is null)
Expand Down Expand Up @@ -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)
Expand All @@ -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<Cue> 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) { }
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public MediaManager(IMauiContext context, IMediaElement mediaElement, IDispatche
/// <summary>
/// The platform-specific media player.
/// </summary>
[Obsolete]
protected PlatformMediaElement? Player { get; set; }
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public void ShouldNotDismissKeyboardWhenOptionSetToFalse()
Assert.True(entry.IsFocused);
}

[Obsolete]
static Entry CreateEntry(int? maxLength = 2,
bool shouldDismissKeyboardAutomatically = false,
ICommand? command = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void SetsFocusWhenCompleted()
Assert.True(entry2.IsFocused);
}

[Obsolete]
static Entry CreateEntry(VisualElement? nextElement = null)
{
var entry = new Entry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public async Task ShouldExecuteCommandImmediatelyWhenMinimumLengthThresholdHasNo
Assert.True(commandHasBeenExecuted);
}

[Obsolete]
static Entry CreateEntryWithBehavior(int stoppedTypingTimeThreshold = 500,
int minimumLengthThreshold = 0,
bool shouldDismissKeyboardAutomatically = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class AnimationBehavior : EventToCommandBehavior
/// Gets the Command that allows the triggering of the animation.
/// </summary>
/// <remarks>
/// <see cref="AnimateCommand"/> has a <see cref="Type"/> of Command&lt;CancellationToken&gt; which requires a <see cref="CancellationToken"/> as a CommandParameter. See <see cref="Command{CancellationToken}"/> and <see cref="System.Windows.Input.ICommand.Execute(object)"/> for more information on passing a <see cref="CancellationToken"/> into <see cref="Command{T}"/> as a CommandParameter"
/// </remarks>
/// <see cref="AnimateCommand"/> has a <see cref="Type"/> of Command&lt;CancellationToken&gt; which requires a <see cref="CancellationToken"/> as a CommandParameter. See <see cref="Command{CancellationToken}"/> and <see cref="System.Windows.Input.ICommand.Execute(object)"/> for more information on passing a <see cref="CancellationToken"/> into <see cref="Command{T}"/> as a CommandParameter"
/// </remarks>
public Command<CancellationToken> AnimateCommand => (Command<CancellationToken>)GetValue(AnimateCommandProperty);

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public IList<string> StyleClass

/// <inheritdoc/>
TaskCompletionSource IAsynchronousHandler.HandlerCompleteTCS => popupDismissedTaskCompletionSource;

/// <inheritdoc/>
bool IResourcesProvider.IsResourcesCreated => resources is not null;

Expand Down

0 comments on commit 9177ee6

Please sign in to comment.