using System;
|
using Foundation;
|
|
#if __IOS__
|
using CoreSpotlight;
|
using UIKit;
|
using System.Linq.Expressions;
|
using System.Xml;
|
#endif
|
|
namespace Other.Siri
|
{
|
public static class NSUserActivityHelper
|
{
|
public static class ActivityKeys
|
{
|
public const string MenuItems = "menuItems";
|
public const string SegueId = "segueID";
|
}
|
|
static string SearchableItemContentType = "Soup Menu";
|
|
public static string ViewMenuActivityType = "com.xamarin.SoupChef.viewMenu";
|
|
public static NSUserActivity ViewMenuActivity {
|
get
|
{
|
var userActivity = new NSUserActivity(ViewMenuActivityType)
|
{
|
Title = "测试title", //NSBundleHelper.SoupKitBundle.GetLocalizedString("ORDER_LUNCH_TITLE", "View menu activity title"),
|
EligibleForSearch = true,
|
EligibleForPrediction = true
|
};
|
|
var attributes = new CSSearchableItemAttributeSet(NSUserActivityHelper.SearchableItemContentType)
|
{
|
//ThumbnailData = UIImage.FromBundle("tomato").AsPNG(),
|
Keywords = ViewMenuSearchableKeywords,
|
DisplayName = "测试DisplayName",// NSBundleHelper.SoupKitBundle.GetLocalizedString("ORDER_LUNCH_TITLE", "View menu activity title"),
|
ContentDescription = "测试ContentDescription",//NSBundleHelper.SoupKitBundle.GetLocalizedString("VIEW_MENU_CONTENT_DESCRIPTION", "View menu content description")
|
};
|
userActivity.ContentAttributeSet = attributes;
|
|
//var phrase = NSBundleHelper.SoupKitBundle.GetLocalizedString("ORDER_LUNCH_SUGGESTED_PHRASE", "Voice shortcut suggested phrase");
|
userActivity.SuggestedInvocationPhrase = "测试phrase";
|
return userActivity;
|
}
|
}
|
|
static string[] ViewMenuSearchableKeywords = new string[] {
|
"Searchable Keyword",
|
"Searchable Keyword",
|
"Searchable Keyword"
|
};
|
}
|
}
|