Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MediaAccessibility] Implement Xcode 16.0 beta 4 changes. #21144

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/MediaAccessibility/MediaAccessibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,33 @@ public static void DidDisplayCaptions (NSAttributedString [] strings)
MACaptionAppearanceDidDisplayCaptions (array.Handle);
}
}

#if NET
[SupportedOSPlatform ("tvos18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
#else
[TV (18, 0), iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0)]
#endif
[DllImport (Constants.MediaAccessibilityLibrary)]
static extern byte MACaptionAppearanceIsCustomized (nint /* MACaptionAppearanceDomain */ domain);

/// <summary>Checks whether the specified style has been customized by the user.</summary>
/// <param name="domain">The style to check</param>
/// <returns>True if the specified style has been customized by the user, false otherwise.</returns>
#if NET
[SupportedOSPlatform ("tvos18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
#else
[TV (18, 0), iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0)]
#endif
public static bool IsCustomized (MACaptionAppearanceDomain domain)
{
return MACaptionAppearanceIsCustomized ((nint) (long) domain) != 0;
}
}

#if NET
Expand Down
10 changes: 10 additions & 0 deletions tests/monotouch-test/MediaAccessibility/CaptionAppearanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ public void DidDisplayCaptions ()
a = null;
MACaptionAppearance.DidDisplayCaptions (a);
}

[Test]
public void IsCustomized ()
{
TestRuntime.AssertXcodeVersion (16, 0);

foreach (var value in Enum.GetValues<MACaptionAppearanceDomain> ()) {
Assert.That (MACaptionAppearance.IsCustomized (value), Is.EqualTo (true).Or.EqualTo (false), value.ToString ());
}
}
}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/iOS-MediaAccessibility.todo

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/macOS-MediaAccessibility.todo

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/tvOS-MediaAccessibility.todo

This file was deleted.

Loading