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

[Carplay] Add support for Xcode 13 beta 5 and fix catalyst attrs. #12454

Merged
merged 2 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
67 changes: 52 additions & 15 deletions src/carplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ public enum CPTextButtonStyle : long
Confirm,
}

[NoWatch, NoTV, NoMac, iOS (15,0)]
[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum CPAssistantCellPosition : long
{
Top = 0,
Bottom,
}

[NoWatch, NoTV, NoMac, iOS (15,0)]
[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum CPAssistantCellVisibility : long
{
Expand All @@ -181,6 +181,15 @@ public enum CPAssistantCellVisibility : long
Always,
}

[iOS (15,0), MacCatalyst (15,0), NoMac, NoTV, NoWatch]
[Native]
public enum CPAssistantCellActionType : long
{
PlayMedia = 0,
StartCall,
}


[NoWatch, NoTV, NoMac, iOS (12,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -291,15 +300,15 @@ interface CPGridTemplate : CPBarButtonProviding{
[Export ("title")]
string Title { get; }

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Export ("updateGridButtons:")]
void UpdateGridButtons (CPGridButton[] gridButtons);

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Export ("updateTitle:")]
void UpdateTitle (string title);

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Field ("CPGridTemplateMaximumItems")]
nuint MaximumItems { get; }
}
Expand Down Expand Up @@ -533,7 +542,7 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding {
[Export ("handler", ArgumentSemantic.Copy)]
new CPSelectableListItemHandler Handler { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand All @@ -549,7 +558,7 @@ interface CPListSection : NSSecureCoding {
[Export ("initWithItems:")]
IntPtr Constructor (CPListItem [] items);

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Export ("initWithItems:header:headerSubtitle:headerImage:headerButton:sectionIndexTitle:")]
IntPtr Constructor (ICPListTemplateItem[] items, string header, [NullAllowed] string headerSubtitle, [NullAllowed] UIImage headerImage, [NullAllowed] CPButton headerButton, [NullAllowed] string sectionIndexTitle);

Expand All @@ -570,22 +579,22 @@ interface CPListSection : NSSecureCoding {
[Export ("itemAtIndex:")]
ICPListTemplateItem GetItem (nuint index);

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[NullAllowed]
[Export ("headerSubtitle")]
string HeaderSubtitle { get; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[NullAllowed]
[Export ("headerImage", ArgumentSemantic.Copy)]
UIImage HeaderImage { get; }
UIImage HeaderImage { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[NullAllowed]
[Export ("headerButton", ArgumentSemantic.Copy)]
CPButton HeaderButton { get; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Field ("CPMaximumListSectionImageSize")]
CGSize MaximumImageSize { get; }
}
Expand All @@ -598,6 +607,10 @@ interface CPListTemplate : CPBarButtonProviding {
[Export ("initWithTitle:sections:")]
IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections);

[iOS (15,0), MacCatalyst (15,0)]
[Export ("initWithTitle:sections:assistantCellConfiguration:")]
IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections, [NullAllowed] CPAssistantCellConfiguration assistantCellConfiguration);

[Deprecated (PlatformName.iOS, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[Wrap ("WeakDelegate")]
[NullAllowed]
Expand Down Expand Up @@ -646,6 +659,11 @@ interface CPListTemplate : CPBarButtonProviding {
[iOS (14, 0)]
[Export ("emptyViewSubtitleVariants", ArgumentSemantic.Copy)]
string[] EmptyViewSubtitleVariants { get; set; }

[NullAllowed]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("assistantCellConfiguration", ArgumentSemantic.Strong)]
CPAssistantCellConfiguration AssistantCellConfiguration { get; set; }
}

interface ICPListTemplateDelegate { }
Expand Down Expand Up @@ -1507,7 +1525,7 @@ interface CPListImageRowItem : CPSelectableListItem
[NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)]
new NSObject UserInfo { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand Down Expand Up @@ -1580,7 +1598,7 @@ interface CPMessageListItem : CPListTemplateItem
[NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)]
new NSObject UserInfo { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand Down Expand Up @@ -1874,7 +1892,7 @@ interface CPListTemplateItem
#if XAMCORE_4_0
[Abstract]
#endif
[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand Down Expand Up @@ -1907,4 +1925,23 @@ interface CPInformationRatingItem
[NullAllowed, Export ("maximumRating")]
NSNumber MaximumRating { get; }
}

[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof(NSObject))]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[DisableDefaultCtor]
interface CPAssistantCellConfiguration : NSSecureCoding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> [DisableDefaultCtor]
there's no way to change the default, empty/null, value if init is used - so it's unusable

{
[Export ("initWithPosition:visibility:assistantAction:")]
IntPtr Constructor (CPAssistantCellPosition position, CPAssistantCellVisibility visibility, CPAssistantCellActionType assistantAction);

[Export ("position")]
CPAssistantCellPosition Position { get; }

[Export ("visibility")]
CPAssistantCellVisibility Visibility { get; }

[Export ("assistantAction")]
CPAssistantCellActionType AssistantAction { get; }
}

}
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/iOS-CarPlay.todo

This file was deleted.