From a9ba99559f011f7d0b608f405aef42f4c718b4bc Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Fri, 5 Jul 2019 10:17:16 -0700 Subject: [PATCH] =?UTF-8?q?Add=20Support=20for=20=20=E2=8C=9AOS=20and=20?= =?UTF-8?q?=F0=9F=93=BAOS=20=20(#827)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Support for watchOS and tvOS * Fix up exception from shared netstandard code to figure out what to send. * Update Battery.ios.watchos.cs * Integrate Tizen into the netstandard not supported area. --- .../Resources/Resource.designer.cs | 105 --- Xamarin.Essentials.sln | 12 + ...er.ios.cs => Accelerometer.ios.watchos.cs} | 0 ...d.cs => Accelerometer.netstandard.tvos.cs} | 6 +- ...nfo.ios.cs => AppInfo.ios.tvos.watchos.cs} | 5 + .../AppInfo/AppInfo.netstandard.cs | 10 +- ...os.cs => AssemblyInfo.ios.tvos.watchos.cs} | 0 ...ometer.ios.cs => Barometer.ios.watchos.cs} | 0 ...ndard.cs => Barometer.netstandard.tvos.cs} | 6 +- ...{Battery.ios.cs => Battery.ios.watchos.cs} | 16 + .../Battery/Battery.netstandard.cs | 29 - .../Battery/Battery.netstandard.tvos.cs | 29 + ...cs => Browser.netstandard.tvos.watchos.cs} | 2 +- ...ipboard.netstandard.tvos.watchos.tizen.cs} | 6 +- .../Clipboard/Clipboard.tizen.cs | 17 - ...cs => Compass.netstandard.tvos.watchos.cs} | 6 +- ...tivity.ios.cs => Connectivity.ios.tvos.cs} | 0 ... => Connectivity.ios.tvos.reachability.cs} | 0 ...cs => Connectivity.netstandard.watchos.cs} | 8 +- .../DeviceDisplay.netstandard.cs | 17 - ...eDisplay.netstandard.tvos.watchos.tizen.cs | 17 + .../DeviceDisplay/DeviceDisplay.tizen.cs | 22 - ....ios.cs => DeviceInfo.ios.tvos.watchos.cs} | 21 +- .../DeviceInfo/DeviceInfo.netstandard.cs | 8 +- ...d.cs => Email.netstandard.tvos.watchos.cs} | 8 +- ....ios.cs => FileSystem.ios.tvos.watchos.cs} | 0 .../FileSystem/FileSystem.netstandard.cs | 10 +- ...=> Flashlight.netstandard.tvos.watchos.cs} | 4 +- ...g.ios.cs => Geocoding.ios.tvos.watchos.cs} | 0 .../Geocoding/Geocoding.netstandard.cs | 4 +- ...> Geolocation.netstandard.tvos.watchos.cs} | 4 +- .../GlobalSuppressions.shared.cs | 4 + ...oscope.ios.cs => Gyroscope.ios.watchos.cs} | 0 ...ndard.cs => Gyroscope.netstandard.tvos.cs} | 6 +- .../{Launcher.ios.cs => Launcher.ios.tvos.cs} | 5 + ...ard.cs => Launcher.netstandard.watchos.cs} | 6 +- ...ter.ios.cs => Magnetometer.ios.watchos.cs} | 0 ...rd.cs => Magnetometer.netstandard.tvos.cs} | 6 +- ....ios.cs => MainThread.ios.tvos.watchos.cs} | 0 .../MainThread/MainThread.netstandard.cs | 4 +- .../Map/{Map.ios.cs => Map.ios.watchos.cs} | 14 +- ...netstandard.cs => Map.netstandard.tvos.cs} | 4 +- ...os.cs => OrientationSensor.ios.watchos.cs} | 0 ... => OrientationSensor.netstandard.tvos.cs} | 6 +- ...> Permissions.netstandard.tvos.watchos.cs} | 6 +- ...> PhoneDialer.netstandard.tvos.watchos.cs} | 4 +- ...rm.ios.cs => Platform.ios.tvos.watchos.cs} | 16 +- ...ios.cs => Preferences.ios.tvos.watchos.cs} | 0 .../Preferences/Preferences.netstandard.cs | 10 +- ...s.cs => SecureStorage.ios.tvos.watchos.cs} | 0 .../SecureStorage.netstandard.cs | 8 +- ...d.cs => Share.netstandard.tvos.watchos.cs} | 4 +- ...ard.cs => Sms.netstandard.tvos.watchos.cs} | 4 +- ...os.cs => TextToSpeech.ios.tvos.watchos.cs} | 2 +- .../TextToSpeech/TextToSpeech.netstandard.cs | 4 +- .../Types/DevicePlatform.shared.cs | 4 + ...=> LocationExtensions.ios.tvos.watchos.cs} | 2 + ...> PlacemarkExtensions.ios.tvos.watchos.cs} | 0 ...cs => ColorExtensions.ios.tvos.watchos.cs} | 0 ...cs => PointExtensions.ios.tvos.watchos.cs} | 0 ...> RectangleExtensions.ios.tvos.watchos.cs} | 0 ...ios.cs => SensorSpeed.ios.tvos.watchos.cs} | 0 .../Types/Shared/Exceptions.shared.cs | 12 + ... => Vibration.netstandard.tvos.watchos.cs} | 6 +- Xamarin.Essentials/Xamarin.Essentials.csproj | 22 +- Xamarin.Essentials/mdoc.targets | 2 + .../xamarin-essentials-tvos.xml | 684 ++++++++++++++++++ .../xamarin-essentials-watchos.xml | 684 ++++++++++++++++++ .../en/FrameworksIndex/xamarin-essentials.xml | 2 + .../Xamarin.Essentials/AccelerometerData.xml | 2 +- docs/en/Xamarin.Essentials/BarometerData.xml | 2 +- docs/en/Xamarin.Essentials/CompassData.xml | 2 +- docs/en/Xamarin.Essentials/DeviceIdiom.xml | 2 +- docs/en/Xamarin.Essentials/DevicePlatform.xml | 38 +- docs/en/Xamarin.Essentials/DisplayInfo.xml | 2 +- .../DisplayInfoChangedEventArgs.xml | 2 +- .../en/Xamarin.Essentials/EmailAttachment.xml | 2 +- docs/en/Xamarin.Essentials/GyroscopeData.xml | 2 +- .../Xamarin.Essentials/MagnetometerData.xml | 2 +- .../OrientationSensorData.xml | 2 +- docs/en/index.xml | 14 +- docs/frameworks.xml | 2 + 82 files changed, 1684 insertions(+), 293 deletions(-) rename Xamarin.Essentials/Accelerometer/{Accelerometer.ios.cs => Accelerometer.ios.watchos.cs} (100%) rename Xamarin.Essentials/Accelerometer/{Accelerometer.netstandard.cs => Accelerometer.netstandard.tvos.cs} (53%) rename Xamarin.Essentials/AppInfo/{AppInfo.ios.cs => AppInfo.ios.tvos.watchos.cs} (84%) rename Xamarin.Essentials/AssemblyInfo/{AssemblyInfo.ios.cs => AssemblyInfo.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Barometer/{Barometer.ios.cs => Barometer.ios.watchos.cs} (100%) rename Xamarin.Essentials/Barometer/{Barometer.netstandard.cs => Barometer.netstandard.tvos.cs} (55%) rename Xamarin.Essentials/Battery/{Battery.ios.cs => Battery.ios.watchos.cs} (92%) delete mode 100644 Xamarin.Essentials/Battery/Battery.netstandard.cs create mode 100644 Xamarin.Essentials/Battery/Battery.netstandard.tvos.cs rename Xamarin.Essentials/Browser/{Browser.netstandard.cs => Browser.netstandard.tvos.watchos.cs} (76%) rename Xamarin.Essentials/Clipboard/{Clipboard.netstandard.cs => Clipboard.netstandard.tvos.watchos.tizen.cs} (55%) delete mode 100644 Xamarin.Essentials/Clipboard/Clipboard.tizen.cs rename Xamarin.Essentials/Compass/{Compass.netstandard.cs => Compass.netstandard.tvos.watchos.cs} (57%) rename Xamarin.Essentials/Connectivity/{Connectivity.ios.cs => Connectivity.ios.tvos.cs} (100%) rename Xamarin.Essentials/Connectivity/{Connectivity.ios.reachability.cs => Connectivity.ios.tvos.reachability.cs} (100%) rename Xamarin.Essentials/Connectivity/{Connectivity.netstandard.cs => Connectivity.netstandard.watchos.cs} (55%) delete mode 100644 Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.cs create mode 100644 Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.tvos.watchos.tizen.cs delete mode 100644 Xamarin.Essentials/DeviceDisplay/DeviceDisplay.tizen.cs rename Xamarin.Essentials/DeviceInfo/{DeviceInfo.ios.cs => DeviceInfo.ios.tvos.watchos.cs} (80%) rename Xamarin.Essentials/Email/{Email.netstandard.cs => Email.netstandard.tvos.watchos.cs} (58%) rename Xamarin.Essentials/FileSystem/{FileSystem.ios.cs => FileSystem.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Flashlight/{Flashlight.netstandard.cs => Flashlight.netstandard.tvos.watchos.cs} (60%) rename Xamarin.Essentials/Geocoding/{Geocoding.ios.cs => Geocoding.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Geolocation/{Geolocation.netstandard.cs => Geolocation.netstandard.tvos.watchos.cs} (72%) rename Xamarin.Essentials/Gyroscope/{Gyroscope.ios.cs => Gyroscope.ios.watchos.cs} (100%) rename Xamarin.Essentials/Gyroscope/{Gyroscope.netstandard.cs => Gyroscope.netstandard.tvos.cs} (55%) rename Xamarin.Essentials/Launcher/{Launcher.ios.cs => Launcher.ios.tvos.cs} (90%) rename Xamarin.Essentials/Launcher/{Launcher.netstandard.cs => Launcher.netstandard.watchos.cs} (60%) rename Xamarin.Essentials/Magnetometer/{Magnetometer.ios.cs => Magnetometer.ios.watchos.cs} (100%) rename Xamarin.Essentials/Magnetometer/{Magnetometer.netstandard.cs => Magnetometer.netstandard.tvos.cs} (55%) rename Xamarin.Essentials/MainThread/{MainThread.ios.cs => MainThread.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Map/{Map.ios.cs => Map.ios.watchos.cs} (82%) rename Xamarin.Essentials/Map/{Map.netstandard.cs => Map.netstandard.tvos.cs} (69%) rename Xamarin.Essentials/OrientationSensor/{OrientationSensor.ios.cs => OrientationSensor.ios.watchos.cs} (100%) rename Xamarin.Essentials/OrientationSensor/{OrientationSensor.netstandard.cs => OrientationSensor.netstandard.tvos.cs} (54%) rename Xamarin.Essentials/Permissions/{Permissions.netstandard.cs => Permissions.netstandard.tvos.watchos.cs} (66%) rename Xamarin.Essentials/PhoneDialer/{PhoneDialer.netstandard.cs => PhoneDialer.netstandard.tvos.watchos.cs} (57%) rename Xamarin.Essentials/Platform/{Platform.ios.cs => Platform.ios.tvos.watchos.cs} (91%) rename Xamarin.Essentials/Preferences/{Preferences.ios.cs => Preferences.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/SecureStorage/{SecureStorage.ios.cs => SecureStorage.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Share/{Share.netstandard.cs => Share.netstandard.tvos.watchos.cs} (65%) rename Xamarin.Essentials/Sms/{Sms.netstandard.cs => Sms.netstandard.tvos.watchos.cs} (60%) rename Xamarin.Essentials/TextToSpeech/{TextToSpeech.ios.cs => TextToSpeech.ios.tvos.watchos.cs} (96%) rename Xamarin.Essentials/Types/{LocationExtensions.ios.cs => LocationExtensions.ios.tvos.watchos.cs} (98%) rename Xamarin.Essentials/Types/{PlacemarkExtensions.ios.cs => PlacemarkExtensions.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Types/PlatformExtensions/{ColorExtensions.ios.cs => ColorExtensions.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Types/PlatformExtensions/{PointExtensions.ios.cs => PointExtensions.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Types/PlatformExtensions/{RectangleExtensions.ios.cs => RectangleExtensions.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Types/{SensorSpeed.ios.cs => SensorSpeed.ios.tvos.watchos.cs} (100%) rename Xamarin.Essentials/Vibration/{Vibration.netstandard.cs => Vibration.netstandard.tvos.watchos.cs} (52%) create mode 100644 docs/en/FrameworksIndex/xamarin-essentials-tvos.xml create mode 100644 docs/en/FrameworksIndex/xamarin-essentials-watchos.xml diff --git a/Samples/Samples.Android/Resources/Resource.designer.cs b/Samples/Samples.Android/Resources/Resource.designer.cs index 267875d34..fb2de48e0 100644 --- a/Samples/Samples.Android/Resources/Resource.designer.cs +++ b/Samples/Samples.Android/Resources/Resource.designer.cs @@ -45,108 +45,6 @@ public static void UpdateIdValues() global::Microsoft.AppCenter.Distribute.Resource.String.appcenter_distribute_update_failed_dialog_message = global::Samples.Droid.Resource.String.appcenter_distribute_update_failed_dialog_message; global::Microsoft.AppCenter.Distribute.Resource.String.appcenter_distribute_update_failed_dialog_reinstall = global::Samples.Droid.Resource.String.appcenter_distribute_update_failed_dialog_reinstall; global::Microsoft.AppCenter.Distribute.Resource.String.appcenter_distribute_update_failed_dialog_title = global::Samples.Droid.Resource.String.appcenter_distribute_update_failed_dialog_title; - global::Xamarin.Essentials.Resource.Attribute.font = global::Samples.Droid.Resource.Attribute.font; - global::Xamarin.Essentials.Resource.Attribute.fontProviderAuthority = global::Samples.Droid.Resource.Attribute.fontProviderAuthority; - global::Xamarin.Essentials.Resource.Attribute.fontProviderCerts = global::Samples.Droid.Resource.Attribute.fontProviderCerts; - global::Xamarin.Essentials.Resource.Attribute.fontProviderFetchStrategy = global::Samples.Droid.Resource.Attribute.fontProviderFetchStrategy; - global::Xamarin.Essentials.Resource.Attribute.fontProviderFetchTimeout = global::Samples.Droid.Resource.Attribute.fontProviderFetchTimeout; - global::Xamarin.Essentials.Resource.Attribute.fontProviderPackage = global::Samples.Droid.Resource.Attribute.fontProviderPackage; - global::Xamarin.Essentials.Resource.Attribute.fontProviderQuery = global::Samples.Droid.Resource.Attribute.fontProviderQuery; - global::Xamarin.Essentials.Resource.Attribute.fontStyle = global::Samples.Droid.Resource.Attribute.fontStyle; - global::Xamarin.Essentials.Resource.Attribute.fontWeight = global::Samples.Droid.Resource.Attribute.fontWeight; - global::Xamarin.Essentials.Resource.Boolean.abc_action_bar_embed_tabs = global::Samples.Droid.Resource.Boolean.abc_action_bar_embed_tabs; - global::Xamarin.Essentials.Resource.Color.notification_action_color_filter = global::Samples.Droid.Resource.Color.notification_action_color_filter; - global::Xamarin.Essentials.Resource.Color.notification_icon_bg_color = global::Samples.Droid.Resource.Color.notification_icon_bg_color; - global::Xamarin.Essentials.Resource.Color.ripple_material_light = global::Samples.Droid.Resource.Color.ripple_material_light; - global::Xamarin.Essentials.Resource.Color.secondary_text_default_material_light = global::Samples.Droid.Resource.Color.secondary_text_default_material_light; - global::Xamarin.Essentials.Resource.Dimension.compat_button_inset_horizontal_material = global::Samples.Droid.Resource.Dimension.compat_button_inset_horizontal_material; - global::Xamarin.Essentials.Resource.Dimension.compat_button_inset_vertical_material = global::Samples.Droid.Resource.Dimension.compat_button_inset_vertical_material; - global::Xamarin.Essentials.Resource.Dimension.compat_button_padding_horizontal_material = global::Samples.Droid.Resource.Dimension.compat_button_padding_horizontal_material; - global::Xamarin.Essentials.Resource.Dimension.compat_button_padding_vertical_material = global::Samples.Droid.Resource.Dimension.compat_button_padding_vertical_material; - global::Xamarin.Essentials.Resource.Dimension.compat_control_corner_material = global::Samples.Droid.Resource.Dimension.compat_control_corner_material; - global::Xamarin.Essentials.Resource.Dimension.notification_action_icon_size = global::Samples.Droid.Resource.Dimension.notification_action_icon_size; - global::Xamarin.Essentials.Resource.Dimension.notification_action_text_size = global::Samples.Droid.Resource.Dimension.notification_action_text_size; - global::Xamarin.Essentials.Resource.Dimension.notification_big_circle_margin = global::Samples.Droid.Resource.Dimension.notification_big_circle_margin; - global::Xamarin.Essentials.Resource.Dimension.notification_content_margin_start = global::Samples.Droid.Resource.Dimension.notification_content_margin_start; - global::Xamarin.Essentials.Resource.Dimension.notification_large_icon_height = global::Samples.Droid.Resource.Dimension.notification_large_icon_height; - global::Xamarin.Essentials.Resource.Dimension.notification_large_icon_width = global::Samples.Droid.Resource.Dimension.notification_large_icon_width; - global::Xamarin.Essentials.Resource.Dimension.notification_main_column_padding_top = global::Samples.Droid.Resource.Dimension.notification_main_column_padding_top; - global::Xamarin.Essentials.Resource.Dimension.notification_media_narrow_margin = global::Samples.Droid.Resource.Dimension.notification_media_narrow_margin; - global::Xamarin.Essentials.Resource.Dimension.notification_right_icon_size = global::Samples.Droid.Resource.Dimension.notification_right_icon_size; - global::Xamarin.Essentials.Resource.Dimension.notification_right_side_padding_top = global::Samples.Droid.Resource.Dimension.notification_right_side_padding_top; - global::Xamarin.Essentials.Resource.Dimension.notification_small_icon_background_padding = global::Samples.Droid.Resource.Dimension.notification_small_icon_background_padding; - global::Xamarin.Essentials.Resource.Dimension.notification_small_icon_size_as_large = global::Samples.Droid.Resource.Dimension.notification_small_icon_size_as_large; - global::Xamarin.Essentials.Resource.Dimension.notification_subtext_size = global::Samples.Droid.Resource.Dimension.notification_subtext_size; - global::Xamarin.Essentials.Resource.Dimension.notification_top_pad = global::Samples.Droid.Resource.Dimension.notification_top_pad; - global::Xamarin.Essentials.Resource.Dimension.notification_top_pad_large_text = global::Samples.Droid.Resource.Dimension.notification_top_pad_large_text; - global::Xamarin.Essentials.Resource.Drawable.notification_action_background = global::Samples.Droid.Resource.Drawable.notification_action_background; - global::Xamarin.Essentials.Resource.Drawable.notification_bg = global::Samples.Droid.Resource.Drawable.notification_bg; - global::Xamarin.Essentials.Resource.Drawable.notification_bg_low = global::Samples.Droid.Resource.Drawable.notification_bg_low; - global::Xamarin.Essentials.Resource.Drawable.notification_bg_low_normal = global::Samples.Droid.Resource.Drawable.notification_bg_low_normal; - global::Xamarin.Essentials.Resource.Drawable.notification_bg_low_pressed = global::Samples.Droid.Resource.Drawable.notification_bg_low_pressed; - global::Xamarin.Essentials.Resource.Drawable.notification_bg_normal = global::Samples.Droid.Resource.Drawable.notification_bg_normal; - global::Xamarin.Essentials.Resource.Drawable.notification_bg_normal_pressed = global::Samples.Droid.Resource.Drawable.notification_bg_normal_pressed; - global::Xamarin.Essentials.Resource.Drawable.notification_icon_background = global::Samples.Droid.Resource.Drawable.notification_icon_background; - global::Xamarin.Essentials.Resource.Drawable.notification_template_icon_bg = global::Samples.Droid.Resource.Drawable.notification_template_icon_bg; - global::Xamarin.Essentials.Resource.Drawable.notification_template_icon_low_bg = global::Samples.Droid.Resource.Drawable.notification_template_icon_low_bg; - global::Xamarin.Essentials.Resource.Drawable.notification_tile_bg = global::Samples.Droid.Resource.Drawable.notification_tile_bg; - global::Xamarin.Essentials.Resource.Drawable.notify_panel_notification_icon_bg = global::Samples.Droid.Resource.Drawable.notify_panel_notification_icon_bg; - global::Xamarin.Essentials.Resource.Id.action_container = global::Samples.Droid.Resource.Id.action_container; - global::Xamarin.Essentials.Resource.Id.action_divider = global::Samples.Droid.Resource.Id.action_divider; - global::Xamarin.Essentials.Resource.Id.action_image = global::Samples.Droid.Resource.Id.action_image; - global::Xamarin.Essentials.Resource.Id.action_text = global::Samples.Droid.Resource.Id.action_text; - global::Xamarin.Essentials.Resource.Id.actions = global::Samples.Droid.Resource.Id.actions; - global::Xamarin.Essentials.Resource.Id.async = global::Samples.Droid.Resource.Id.async; - global::Xamarin.Essentials.Resource.Id.blocking = global::Samples.Droid.Resource.Id.blocking; - global::Xamarin.Essentials.Resource.Id.chronometer = global::Samples.Droid.Resource.Id.chronometer; - global::Xamarin.Essentials.Resource.Id.forever = global::Samples.Droid.Resource.Id.forever; - global::Xamarin.Essentials.Resource.Id.icon = global::Samples.Droid.Resource.Id.icon; - global::Xamarin.Essentials.Resource.Id.icon_group = global::Samples.Droid.Resource.Id.icon_group; - global::Xamarin.Essentials.Resource.Id.info = global::Samples.Droid.Resource.Id.info; - global::Xamarin.Essentials.Resource.Id.italic = global::Samples.Droid.Resource.Id.italic; - global::Xamarin.Essentials.Resource.Id.line1 = global::Samples.Droid.Resource.Id.line1; - global::Xamarin.Essentials.Resource.Id.line3 = global::Samples.Droid.Resource.Id.line3; - global::Xamarin.Essentials.Resource.Id.normal = global::Samples.Droid.Resource.Id.normal; - global::Xamarin.Essentials.Resource.Id.notification_background = global::Samples.Droid.Resource.Id.notification_background; - global::Xamarin.Essentials.Resource.Id.notification_main_column = global::Samples.Droid.Resource.Id.notification_main_column; - global::Xamarin.Essentials.Resource.Id.notification_main_column_container = global::Samples.Droid.Resource.Id.notification_main_column_container; - global::Xamarin.Essentials.Resource.Id.right_icon = global::Samples.Droid.Resource.Id.right_icon; - global::Xamarin.Essentials.Resource.Id.right_side = global::Samples.Droid.Resource.Id.right_side; - global::Xamarin.Essentials.Resource.Id.tag_transition_group = global::Samples.Droid.Resource.Id.tag_transition_group; - global::Xamarin.Essentials.Resource.Id.text = global::Samples.Droid.Resource.Id.text; - global::Xamarin.Essentials.Resource.Id.text2 = global::Samples.Droid.Resource.Id.text2; - global::Xamarin.Essentials.Resource.Id.time = global::Samples.Droid.Resource.Id.time; - global::Xamarin.Essentials.Resource.Id.title = global::Samples.Droid.Resource.Id.title; - global::Xamarin.Essentials.Resource.Integer.status_bar_notification_info_maxnum = global::Samples.Droid.Resource.Integer.status_bar_notification_info_maxnum; - global::Xamarin.Essentials.Resource.Layout.notification_action = global::Samples.Droid.Resource.Layout.notification_action; - global::Xamarin.Essentials.Resource.Layout.notification_action_tombstone = global::Samples.Droid.Resource.Layout.notification_action_tombstone; - global::Xamarin.Essentials.Resource.Layout.notification_template_custom_big = global::Samples.Droid.Resource.Layout.notification_template_custom_big; - global::Xamarin.Essentials.Resource.Layout.notification_template_icon_group = global::Samples.Droid.Resource.Layout.notification_template_icon_group; - global::Xamarin.Essentials.Resource.Layout.notification_template_part_chronometer = global::Samples.Droid.Resource.Layout.notification_template_part_chronometer; - global::Xamarin.Essentials.Resource.Layout.notification_template_part_time = global::Samples.Droid.Resource.Layout.notification_template_part_time; - global::Xamarin.Essentials.Resource.String.status_bar_notification_info_overflow = global::Samples.Droid.Resource.String.status_bar_notification_info_overflow; - global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification = global::Samples.Droid.Resource.Style.TextAppearance_Compat_Notification; - global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Info = global::Samples.Droid.Resource.Style.TextAppearance_Compat_Notification_Info; - global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Line2 = global::Samples.Droid.Resource.Style.TextAppearance_Compat_Notification_Line2; - global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Time = global::Samples.Droid.Resource.Style.TextAppearance_Compat_Notification_Time; - global::Xamarin.Essentials.Resource.Style.TextAppearance_Compat_Notification_Title = global::Samples.Droid.Resource.Style.TextAppearance_Compat_Notification_Title; - global::Xamarin.Essentials.Resource.Style.Widget_Compat_NotificationActionContainer = global::Samples.Droid.Resource.Style.Widget_Compat_NotificationActionContainer; - global::Xamarin.Essentials.Resource.Style.Widget_Compat_NotificationActionText = global::Samples.Droid.Resource.Style.Widget_Compat_NotificationActionText; - global::Xamarin.Essentials.Resource.Xml.xamarin_essentials_fileprovider_file_paths = global::Samples.Droid.Resource.Xml.xamarin_essentials_fileprovider_file_paths; - global::Xamarin.Essentials.Resource.Styleable.FontFamily = global::Samples.Droid.Resource.Styleable.FontFamily; - global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderAuthority = global::Samples.Droid.Resource.Styleable.FontFamily_fontProviderAuthority; - global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderCerts = global::Samples.Droid.Resource.Styleable.FontFamily_fontProviderCerts; - global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderFetchStrategy = global::Samples.Droid.Resource.Styleable.FontFamily_fontProviderFetchStrategy; - global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderFetchTimeout = global::Samples.Droid.Resource.Styleable.FontFamily_fontProviderFetchTimeout; - global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderPackage = global::Samples.Droid.Resource.Styleable.FontFamily_fontProviderPackage; - global::Xamarin.Essentials.Resource.Styleable.FontFamily_fontProviderQuery = global::Samples.Droid.Resource.Styleable.FontFamily_fontProviderQuery; - global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont = global::Samples.Droid.Resource.Styleable.FontFamilyFont; - global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_font = global::Samples.Droid.Resource.Styleable.FontFamilyFont_android_font; - global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_fontStyle = global::Samples.Droid.Resource.Styleable.FontFamilyFont_android_fontStyle; - global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_android_fontWeight = global::Samples.Droid.Resource.Styleable.FontFamilyFont_android_fontWeight; - global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_font = global::Samples.Droid.Resource.Styleable.FontFamilyFont_font; - global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_fontStyle = global::Samples.Droid.Resource.Styleable.FontFamilyFont_fontStyle; - global::Xamarin.Essentials.Resource.Styleable.FontFamilyFont_fontWeight = global::Samples.Droid.Resource.Styleable.FontFamilyFont_fontWeight; global::Xamarin.Forms.Platform.Android.Resource.Animation.abc_fade_in = global::Samples.Droid.Resource.Animation.abc_fade_in; global::Xamarin.Forms.Platform.Android.Resource.Animation.abc_fade_out = global::Samples.Droid.Resource.Animation.abc_fade_out; global::Xamarin.Forms.Platform.Android.Resource.Animation.abc_grow_fade_in_from_bottom = global::Samples.Droid.Resource.Animation.abc_grow_fade_in_from_bottom; @@ -7600,9 +7498,6 @@ public partial class Xml // aapt resource value: 0x7f080000 public const int my_backup_rules = 2131230720; - // aapt resource value: 0x7f080001 - public const int xamarin_essentials_fileprovider_file_paths = 2131230721; - static Xml() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); diff --git a/Xamarin.Essentials.sln b/Xamarin.Essentials.sln index 087ed6e95..fb7d3b51f 100644 --- a/Xamarin.Essentials.sln +++ b/Xamarin.Essentials.sln @@ -628,6 +628,18 @@ Global {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x64.Build.0 = Debug|Any CPU {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x86.ActiveCfg = Debug|Any CPU {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x86.Build.0 = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|Any CPU.ActiveCfg = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|Any CPU.Build.0 = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|ARM.ActiveCfg = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|ARM.Build.0 = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhone.ActiveCfg = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhone.Build.0 = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhoneSimulator.Build.0 = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x64.ActiveCfg = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x64.Build.0 = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x86.ActiveCfg = Debug|Any CPU + {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x86.Build.0 = Debug|Any CPU {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|Any CPU.Build.0 = Release|Any CPU {4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|ARM.ActiveCfg = Release|Any CPU diff --git a/Xamarin.Essentials/Accelerometer/Accelerometer.ios.cs b/Xamarin.Essentials/Accelerometer/Accelerometer.ios.watchos.cs similarity index 100% rename from Xamarin.Essentials/Accelerometer/Accelerometer.ios.cs rename to Xamarin.Essentials/Accelerometer/Accelerometer.ios.watchos.cs diff --git a/Xamarin.Essentials/Accelerometer/Accelerometer.netstandard.cs b/Xamarin.Essentials/Accelerometer/Accelerometer.netstandard.tvos.cs similarity index 53% rename from Xamarin.Essentials/Accelerometer/Accelerometer.netstandard.cs rename to Xamarin.Essentials/Accelerometer/Accelerometer.netstandard.tvos.cs index 2cbbfd462..f81b3c481 100644 --- a/Xamarin.Essentials/Accelerometer/Accelerometer.netstandard.cs +++ b/Xamarin.Essentials/Accelerometer/Accelerometer.netstandard.tvos.cs @@ -3,12 +3,12 @@ public static partial class Accelerometer { internal static bool IsSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformStart(SensorSpeed sensorSpeed) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformStop() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/AppInfo/AppInfo.ios.cs b/Xamarin.Essentials/AppInfo/AppInfo.ios.tvos.watchos.cs similarity index 84% rename from Xamarin.Essentials/AppInfo/AppInfo.ios.cs rename to Xamarin.Essentials/AppInfo/AppInfo.ios.tvos.watchos.cs index 98edf50ff..255421602 100644 --- a/Xamarin.Essentials/AppInfo/AppInfo.ios.cs +++ b/Xamarin.Essentials/AppInfo/AppInfo.ios.tvos.watchos.cs @@ -16,7 +16,12 @@ public static partial class AppInfo static string GetBundleValue(string key) => NSBundle.MainBundle.ObjectForInfoDictionary(key)?.ToString(); +#if __IOS__ || __TVOS__ static void PlatformShowSettingsUI() => UIApplication.SharedApplication.OpenUrl(new NSUrl(UIApplication.OpenSettingsUrlString)); +#else + static void PlatformShowSettingsUI() => + throw new FeatureNotSupportedException(); +#endif } } diff --git a/Xamarin.Essentials/AppInfo/AppInfo.netstandard.cs b/Xamarin.Essentials/AppInfo/AppInfo.netstandard.cs index bce6a01a5..775d2db11 100644 --- a/Xamarin.Essentials/AppInfo/AppInfo.netstandard.cs +++ b/Xamarin.Essentials/AppInfo/AppInfo.netstandard.cs @@ -2,14 +2,14 @@ { public static partial class AppInfo { - static string PlatformGetPackageName() => throw new NotImplementedInReferenceAssemblyException(); + static string PlatformGetPackageName() => throw ExceptionUtils.NotSupportedOrImplementedException; - static string PlatformGetName() => throw new NotImplementedInReferenceAssemblyException(); + static string PlatformGetName() => throw ExceptionUtils.NotSupportedOrImplementedException; - static string PlatformGetVersionString() => throw new NotImplementedInReferenceAssemblyException(); + static string PlatformGetVersionString() => throw ExceptionUtils.NotSupportedOrImplementedException; - static string PlatformGetBuild() => throw new NotImplementedInReferenceAssemblyException(); + static string PlatformGetBuild() => throw ExceptionUtils.NotSupportedOrImplementedException; - static void PlatformShowSettingsUI() => throw new NotImplementedInReferenceAssemblyException(); + static void PlatformShowSettingsUI() => throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/AssemblyInfo/AssemblyInfo.ios.cs b/Xamarin.Essentials/AssemblyInfo/AssemblyInfo.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/AssemblyInfo/AssemblyInfo.ios.cs rename to Xamarin.Essentials/AssemblyInfo/AssemblyInfo.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Barometer/Barometer.ios.cs b/Xamarin.Essentials/Barometer/Barometer.ios.watchos.cs similarity index 100% rename from Xamarin.Essentials/Barometer/Barometer.ios.cs rename to Xamarin.Essentials/Barometer/Barometer.ios.watchos.cs diff --git a/Xamarin.Essentials/Barometer/Barometer.netstandard.cs b/Xamarin.Essentials/Barometer/Barometer.netstandard.tvos.cs similarity index 55% rename from Xamarin.Essentials/Barometer/Barometer.netstandard.cs rename to Xamarin.Essentials/Barometer/Barometer.netstandard.tvos.cs index 74c8c933c..172d33fc7 100644 --- a/Xamarin.Essentials/Barometer/Barometer.netstandard.cs +++ b/Xamarin.Essentials/Barometer/Barometer.netstandard.tvos.cs @@ -3,12 +3,12 @@ public static partial class Barometer { internal static bool IsSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStart(SensorSpeed sensorSpeed) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStop() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Battery/Battery.ios.cs b/Xamarin.Essentials/Battery/Battery.ios.watchos.cs similarity index 92% rename from Xamarin.Essentials/Battery/Battery.ios.cs rename to Xamarin.Essentials/Battery/Battery.ios.watchos.cs index 3d371ca9c..d12aab589 100644 --- a/Xamarin.Essentials/Battery/Battery.ios.cs +++ b/Xamarin.Essentials/Battery/Battery.ios.watchos.cs @@ -1,12 +1,20 @@ using Foundation; +#if __IOS__ using UIKit; +#elif __WATCHOS__ +using UIDevice = WatchKit.WKInterfaceDevice; +using UIDeviceBatteryState = WatchKit.WKInterfaceDeviceBatteryState; +#endif namespace Xamarin.Essentials { public static partial class Battery { +#if !__WATCHOS__ static NSObject levelObserver; static NSObject stateObserver; +#endif + static NSObject saverStatusObserver; static void StartEnergySaverListeners() @@ -28,18 +36,26 @@ static void PowerChangedNotification(NSNotification notification) static void StartBatteryListeners() { +#if __WATCHOS__ + throw new FeatureNotSupportedException(); +#else UIDevice.CurrentDevice.BatteryMonitoringEnabled = true; levelObserver = UIDevice.Notifications.ObserveBatteryLevelDidChange(BatteryInfoChangedNotification); stateObserver = UIDevice.Notifications.ObserveBatteryStateDidChange(BatteryInfoChangedNotification); +#endif } static void StopBatteryListeners() { +#if __WATCHOS__ + throw new FeatureNotSupportedException(); +#else UIDevice.CurrentDevice.BatteryMonitoringEnabled = false; levelObserver?.Dispose(); levelObserver = null; stateObserver?.Dispose(); stateObserver = null; +#endif } static void BatteryInfoChangedNotification(object sender, NSNotificationEventArgs args) diff --git a/Xamarin.Essentials/Battery/Battery.netstandard.cs b/Xamarin.Essentials/Battery/Battery.netstandard.cs deleted file mode 100644 index f4021e715..000000000 --- a/Xamarin.Essentials/Battery/Battery.netstandard.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Xamarin.Essentials -{ - public static partial class Battery - { - static void StartBatteryListeners() => - throw new NotImplementedInReferenceAssemblyException(); - - static void StopBatteryListeners() => - throw new NotImplementedInReferenceAssemblyException(); - - static double PlatformChargeLevel => - throw new NotImplementedInReferenceAssemblyException(); - - static BatteryState PlatformState => - throw new NotImplementedInReferenceAssemblyException(); - - static BatteryPowerSource PlatformPowerSource => - throw new NotImplementedInReferenceAssemblyException(); - - static void StartEnergySaverListeners() => - throw new NotImplementedInReferenceAssemblyException(); - - static void StopEnergySaverListeners() => - throw new NotImplementedInReferenceAssemblyException(); - - static EnergySaverStatus PlatformEnergySaverStatus => - throw new NotImplementedInReferenceAssemblyException(); - } -} diff --git a/Xamarin.Essentials/Battery/Battery.netstandard.tvos.cs b/Xamarin.Essentials/Battery/Battery.netstandard.tvos.cs new file mode 100644 index 000000000..f1ebc7058 --- /dev/null +++ b/Xamarin.Essentials/Battery/Battery.netstandard.tvos.cs @@ -0,0 +1,29 @@ +namespace Xamarin.Essentials +{ + public static partial class Battery + { + static void StartBatteryListeners() => + throw ExceptionUtils.NotSupportedOrImplementedException; + + static void StopBatteryListeners() => + throw ExceptionUtils.NotSupportedOrImplementedException; + + static double PlatformChargeLevel => + throw ExceptionUtils.NotSupportedOrImplementedException; + + static BatteryState PlatformState => + throw ExceptionUtils.NotSupportedOrImplementedException; + + static BatteryPowerSource PlatformPowerSource => + throw ExceptionUtils.NotSupportedOrImplementedException; + + static void StartEnergySaverListeners() => + throw ExceptionUtils.NotSupportedOrImplementedException; + + static void StopEnergySaverListeners() => + throw ExceptionUtils.NotSupportedOrImplementedException; + + static EnergySaverStatus PlatformEnergySaverStatus => + throw ExceptionUtils.NotSupportedOrImplementedException; + } +} diff --git a/Xamarin.Essentials/Browser/Browser.netstandard.cs b/Xamarin.Essentials/Browser/Browser.netstandard.tvos.watchos.cs similarity index 76% rename from Xamarin.Essentials/Browser/Browser.netstandard.cs rename to Xamarin.Essentials/Browser/Browser.netstandard.tvos.watchos.cs index e74377d6c..47f4e5f97 100644 --- a/Xamarin.Essentials/Browser/Browser.netstandard.cs +++ b/Xamarin.Essentials/Browser/Browser.netstandard.tvos.watchos.cs @@ -6,6 +6,6 @@ namespace Xamarin.Essentials public static partial class Browser { static Task PlatformOpenAsync(Uri uri, BrowserLaunchOptions options) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Clipboard/Clipboard.netstandard.cs b/Xamarin.Essentials/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs similarity index 55% rename from Xamarin.Essentials/Clipboard/Clipboard.netstandard.cs rename to Xamarin.Essentials/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs index 7c2d4cd6c..7f3b4d503 100644 --- a/Xamarin.Essentials/Clipboard/Clipboard.netstandard.cs +++ b/Xamarin.Essentials/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs @@ -5,12 +5,12 @@ namespace Xamarin.Essentials public static partial class Clipboard { static Task PlatformSetTextAsync(string text) - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; static bool PlatformHasText - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformGetTextAsync() - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Clipboard/Clipboard.tizen.cs b/Xamarin.Essentials/Clipboard/Clipboard.tizen.cs deleted file mode 100644 index d3e63cae4..000000000 --- a/Xamarin.Essentials/Clipboard/Clipboard.tizen.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace Xamarin.Essentials -{ - public static partial class Clipboard - { - static Task PlatformSetTextAsync(string text) - => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - - static bool PlatformHasText - => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - - static Task PlatformGetTextAsync() - => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - } -} diff --git a/Xamarin.Essentials/Compass/Compass.netstandard.cs b/Xamarin.Essentials/Compass/Compass.netstandard.tvos.watchos.cs similarity index 57% rename from Xamarin.Essentials/Compass/Compass.netstandard.cs rename to Xamarin.Essentials/Compass/Compass.netstandard.tvos.watchos.cs index 3d89496a9..a6a458113 100644 --- a/Xamarin.Essentials/Compass/Compass.netstandard.cs +++ b/Xamarin.Essentials/Compass/Compass.netstandard.tvos.watchos.cs @@ -3,12 +3,12 @@ public static partial class Compass { internal static bool IsSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStart(SensorSpeed sensorSpeed, bool applyLowPassFilter) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStop() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Connectivity/Connectivity.ios.cs b/Xamarin.Essentials/Connectivity/Connectivity.ios.tvos.cs similarity index 100% rename from Xamarin.Essentials/Connectivity/Connectivity.ios.cs rename to Xamarin.Essentials/Connectivity/Connectivity.ios.tvos.cs diff --git a/Xamarin.Essentials/Connectivity/Connectivity.ios.reachability.cs b/Xamarin.Essentials/Connectivity/Connectivity.ios.tvos.reachability.cs similarity index 100% rename from Xamarin.Essentials/Connectivity/Connectivity.ios.reachability.cs rename to Xamarin.Essentials/Connectivity/Connectivity.ios.tvos.reachability.cs diff --git a/Xamarin.Essentials/Connectivity/Connectivity.netstandard.cs b/Xamarin.Essentials/Connectivity/Connectivity.netstandard.watchos.cs similarity index 55% rename from Xamarin.Essentials/Connectivity/Connectivity.netstandard.cs rename to Xamarin.Essentials/Connectivity/Connectivity.netstandard.watchos.cs index b59f13942..f850fc658 100644 --- a/Xamarin.Essentials/Connectivity/Connectivity.netstandard.cs +++ b/Xamarin.Essentials/Connectivity/Connectivity.netstandard.watchos.cs @@ -5,15 +5,15 @@ namespace Xamarin.Essentials public static partial class Connectivity { static NetworkAccess PlatformNetworkAccess => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static IEnumerable PlatformConnectionProfiles => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void StartListeners() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void StopListeners() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.cs b/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.cs deleted file mode 100644 index 0b44c8c2d..000000000 --- a/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Xamarin.Essentials -{ - public static partial class DeviceDisplay - { - static bool PlatformKeepScreenOn - { - get => throw new NotImplementedInReferenceAssemblyException(); - set => throw new NotImplementedInReferenceAssemblyException(); - } - - static DisplayInfo GetMainDisplayInfo() => throw new NotImplementedInReferenceAssemblyException(); - - static void StartScreenMetricsListeners() => throw new NotImplementedInReferenceAssemblyException(); - - static void StopScreenMetricsListeners() => throw new NotImplementedInReferenceAssemblyException(); - } -} diff --git a/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.tvos.watchos.tizen.cs b/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.tvos.watchos.tizen.cs new file mode 100644 index 000000000..afd722ffc --- /dev/null +++ b/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.tvos.watchos.tizen.cs @@ -0,0 +1,17 @@ +namespace Xamarin.Essentials +{ + public static partial class DeviceDisplay + { + static bool PlatformKeepScreenOn + { + get => throw ExceptionUtils.NotSupportedOrImplementedException; + set => throw ExceptionUtils.NotSupportedOrImplementedException; + } + + static DisplayInfo GetMainDisplayInfo() => throw ExceptionUtils.NotSupportedOrImplementedException; + + static void StartScreenMetricsListeners() => throw ExceptionUtils.NotSupportedOrImplementedException; + + static void StopScreenMetricsListeners() => throw ExceptionUtils.NotSupportedOrImplementedException; + } +} diff --git a/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.tizen.cs b/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.tizen.cs deleted file mode 100644 index 4e65e2765..000000000 --- a/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.tizen.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace Xamarin.Essentials -{ - public static partial class DeviceDisplay - { - static bool PlatformKeepScreenOn - { - get => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - set => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - } - - static DisplayInfo GetMainDisplayInfo() - => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - - static void StartScreenMetricsListeners() - => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - - static void StopScreenMetricsListeners() - => throw new PlatformNotSupportedException("This API is not currently supported on Tizen."); - } -} diff --git a/Xamarin.Essentials/DeviceInfo/DeviceInfo.ios.cs b/Xamarin.Essentials/DeviceInfo/DeviceInfo.ios.tvos.watchos.cs similarity index 80% rename from Xamarin.Essentials/DeviceInfo/DeviceInfo.ios.cs rename to Xamarin.Essentials/DeviceInfo/DeviceInfo.ios.tvos.watchos.cs index d69098a0c..c6dc96045 100644 --- a/Xamarin.Essentials/DeviceInfo/DeviceInfo.ios.cs +++ b/Xamarin.Essentials/DeviceInfo/DeviceInfo.ios.tvos.watchos.cs @@ -1,7 +1,13 @@ using System; using System.Diagnostics; -using ObjCRuntime; +#if __WATCHOS__ +using WatchKit; +using UIDevice = WatchKit.WKInterfaceDevice; +#else using UIKit; +#endif + +using ObjCRuntime; namespace Xamarin.Essentials { @@ -26,10 +32,20 @@ static string GetModel() static string GetVersionString() => UIDevice.CurrentDevice.SystemVersion; - static DevicePlatform GetPlatform() => DevicePlatform.iOS; + static DevicePlatform GetPlatform() => +#if __IOS__ + DevicePlatform.iOS; +#elif __TVOS__ + DevicePlatform.tvOS; +#elif __WATCHOS__ + DevicePlatform.watchOS; +#endif static DeviceIdiom GetIdiom() { +#if __WATCHOS__ + return DeviceIdiom.Watch; +#else switch (UIDevice.CurrentDevice.UserInterfaceIdiom) { case UIUserInterfaceIdiom.Pad: @@ -43,6 +59,7 @@ static DeviceIdiom GetIdiom() default: return DeviceIdiom.Unknown; } +#endif } static DeviceType GetDeviceType() diff --git a/Xamarin.Essentials/DeviceInfo/DeviceInfo.netstandard.cs b/Xamarin.Essentials/DeviceInfo/DeviceInfo.netstandard.cs index 7c2e3cfb0..576bce8d4 100644 --- a/Xamarin.Essentials/DeviceInfo/DeviceInfo.netstandard.cs +++ b/Xamarin.Essentials/DeviceInfo/DeviceInfo.netstandard.cs @@ -2,13 +2,13 @@ { public static partial class DeviceInfo { - static string GetModel() => throw new NotImplementedInReferenceAssemblyException(); + static string GetModel() => throw ExceptionUtils.NotSupportedOrImplementedException; - static string GetManufacturer() => throw new NotImplementedInReferenceAssemblyException(); + static string GetManufacturer() => throw ExceptionUtils.NotSupportedOrImplementedException; - static string GetDeviceName() => throw new NotImplementedInReferenceAssemblyException(); + static string GetDeviceName() => throw ExceptionUtils.NotSupportedOrImplementedException; - static string GetVersionString() => throw new NotImplementedInReferenceAssemblyException(); + static string GetVersionString() => throw ExceptionUtils.NotSupportedOrImplementedException; static DevicePlatform GetPlatform() => DevicePlatform.Unknown; diff --git a/Xamarin.Essentials/Email/Email.netstandard.cs b/Xamarin.Essentials/Email/Email.netstandard.tvos.watchos.cs similarity index 58% rename from Xamarin.Essentials/Email/Email.netstandard.cs rename to Xamarin.Essentials/Email/Email.netstandard.tvos.watchos.cs index 2b74eadfe..a0fcb82a5 100644 --- a/Xamarin.Essentials/Email/Email.netstandard.cs +++ b/Xamarin.Essentials/Email/Email.netstandard.tvos.watchos.cs @@ -5,15 +5,17 @@ namespace Xamarin.Essentials public static partial class Email { internal static bool IsComposeSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformComposeAsync(EmailMessage message) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } +#if NETSTANDARD1_0 || NETSTANDARD2_0 public partial class EmailAttachment { string PlatformGetContentType(string extension) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } +#endif } diff --git a/Xamarin.Essentials/FileSystem/FileSystem.ios.cs b/Xamarin.Essentials/FileSystem/FileSystem.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/FileSystem/FileSystem.ios.cs rename to Xamarin.Essentials/FileSystem/FileSystem.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/FileSystem/FileSystem.netstandard.cs b/Xamarin.Essentials/FileSystem/FileSystem.netstandard.cs index e0bff9c2c..7e889a501 100644 --- a/Xamarin.Essentials/FileSystem/FileSystem.netstandard.cs +++ b/Xamarin.Essentials/FileSystem/FileSystem.netstandard.cs @@ -6,21 +6,21 @@ namespace Xamarin.Essentials public static partial class FileSystem { static string PlatformCacheDirectory - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; static string PlatformAppDataDirectory - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformOpenAppPackageFileAsync(string filename) - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; } public partial class FileBase { static string PlatformGetContentType(string extension) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal void PlatformInit(FileBase file) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Flashlight/Flashlight.netstandard.cs b/Xamarin.Essentials/Flashlight/Flashlight.netstandard.tvos.watchos.cs similarity index 60% rename from Xamarin.Essentials/Flashlight/Flashlight.netstandard.cs rename to Xamarin.Essentials/Flashlight/Flashlight.netstandard.tvos.watchos.cs index 2654c4f1e..d00f9a878 100644 --- a/Xamarin.Essentials/Flashlight/Flashlight.netstandard.cs +++ b/Xamarin.Essentials/Flashlight/Flashlight.netstandard.tvos.watchos.cs @@ -5,9 +5,9 @@ namespace Xamarin.Essentials public static partial class Flashlight { static Task PlatformTurnOnAsync() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformTurnOffAsync() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Geocoding/Geocoding.ios.cs b/Xamarin.Essentials/Geocoding/Geocoding.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/Geocoding/Geocoding.ios.cs rename to Xamarin.Essentials/Geocoding/Geocoding.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Geocoding/Geocoding.netstandard.cs b/Xamarin.Essentials/Geocoding/Geocoding.netstandard.cs index 3353bcc2d..8cec342af 100644 --- a/Xamarin.Essentials/Geocoding/Geocoding.netstandard.cs +++ b/Xamarin.Essentials/Geocoding/Geocoding.netstandard.cs @@ -6,9 +6,9 @@ namespace Xamarin.Essentials public static partial class Geocoding { static Task> PlatformGetPlacemarksAsync(double latitude, double longitude) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task> PlatformGetLocationsAsync(string address) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Geolocation/Geolocation.netstandard.cs b/Xamarin.Essentials/Geolocation/Geolocation.netstandard.tvos.watchos.cs similarity index 72% rename from Xamarin.Essentials/Geolocation/Geolocation.netstandard.cs rename to Xamarin.Essentials/Geolocation/Geolocation.netstandard.tvos.watchos.cs index 7554bed71..84953463f 100644 --- a/Xamarin.Essentials/Geolocation/Geolocation.netstandard.cs +++ b/Xamarin.Essentials/Geolocation/Geolocation.netstandard.tvos.watchos.cs @@ -7,9 +7,9 @@ namespace Xamarin.Essentials public static partial class Geolocation { static Task PlatformLastKnownLocationAsync() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformLocationAsync(GeolocationRequest request, CancellationToken cancellationToken) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/GlobalSuppressions.shared.cs b/Xamarin.Essentials/GlobalSuppressions.shared.cs index 648b717f5..2fea182d0 100644 --- a/Xamarin.Essentials/GlobalSuppressions.shared.cs +++ b/Xamarin.Essentials/GlobalSuppressions.shared.cs @@ -4,5 +4,9 @@ // a specific target and scoped to a namespace, type, member, etc. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "iOS is what we want.", Scope = "member", Target = "~P:Xamarin.Essentials.DevicePlatform.iOS")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "tvOS is what we want.", Scope = "member", Target = "~P:Xamarin.Essentials.DevicePlatform.tvOS")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "watchOS is what we want.", Scope = "member", Target = "~P:Xamarin.Essentials.DevicePlatform.watchOS")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "iOS is what we want.", Scope = "member", Target = "~P:Xamarin.Essentials.DevicePlatform.iOS")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "tvOS is what we want.", Scope = "member", Target = "~P:Xamarin.Essentials.DevicePlatform.tvOS")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "watchOS is what we want.", Scope = "member", Target = "~P:Xamarin.Essentials.DevicePlatform.watchOS")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1008:Opening parenthesis should be spaced correctly", Justification = "Clashed with rule 1003", Scope = "member", Target = "~M:Xamarin.Essentials.SmsMessage.#ctor(System.String,System.String)")] diff --git a/Xamarin.Essentials/Gyroscope/Gyroscope.ios.cs b/Xamarin.Essentials/Gyroscope/Gyroscope.ios.watchos.cs similarity index 100% rename from Xamarin.Essentials/Gyroscope/Gyroscope.ios.cs rename to Xamarin.Essentials/Gyroscope/Gyroscope.ios.watchos.cs diff --git a/Xamarin.Essentials/Gyroscope/Gyroscope.netstandard.cs b/Xamarin.Essentials/Gyroscope/Gyroscope.netstandard.tvos.cs similarity index 55% rename from Xamarin.Essentials/Gyroscope/Gyroscope.netstandard.cs rename to Xamarin.Essentials/Gyroscope/Gyroscope.netstandard.tvos.cs index fcc304a9a..c3ccfc53d 100644 --- a/Xamarin.Essentials/Gyroscope/Gyroscope.netstandard.cs +++ b/Xamarin.Essentials/Gyroscope/Gyroscope.netstandard.tvos.cs @@ -3,12 +3,12 @@ public static partial class Gyroscope { internal static bool IsSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStart(SensorSpeed sensorSpeed) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStop() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Launcher/Launcher.ios.cs b/Xamarin.Essentials/Launcher/Launcher.ios.tvos.cs similarity index 90% rename from Xamarin.Essentials/Launcher/Launcher.ios.cs rename to Xamarin.Essentials/Launcher/Launcher.ios.tvos.cs index bfbbb6907..ed84fc44b 100644 --- a/Xamarin.Essentials/Launcher/Launcher.ios.cs +++ b/Xamarin.Essentials/Launcher/Launcher.ios.tvos.cs @@ -27,6 +27,7 @@ internal static NSUrl GetNativeUrl(Uri uri) } } +#if __IOS__ static Task PlatformOpenAsync(OpenFileRequest request) { var fileUrl = NSUrl.FromFilename(request.File.FullPath); @@ -39,5 +40,9 @@ static Task PlatformOpenAsync(OpenFileRequest request) documentController.PresentOpenInMenu(vc.View.Frame, vc.View, true); return Task.CompletedTask; } +#else + static Task PlatformOpenAsync(OpenFileRequest request) => + throw new FeatureNotSupportedException(); +#endif } } diff --git a/Xamarin.Essentials/Launcher/Launcher.netstandard.cs b/Xamarin.Essentials/Launcher/Launcher.netstandard.watchos.cs similarity index 60% rename from Xamarin.Essentials/Launcher/Launcher.netstandard.cs rename to Xamarin.Essentials/Launcher/Launcher.netstandard.watchos.cs index a076be227..752baa735 100644 --- a/Xamarin.Essentials/Launcher/Launcher.netstandard.cs +++ b/Xamarin.Essentials/Launcher/Launcher.netstandard.watchos.cs @@ -6,12 +6,12 @@ namespace Xamarin.Essentials public static partial class Launcher { static Task PlatformCanOpenAsync(Uri uri) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformOpenAsync(Uri uri) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformOpenAsync(OpenFileRequest request) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Magnetometer/Magnetometer.ios.cs b/Xamarin.Essentials/Magnetometer/Magnetometer.ios.watchos.cs similarity index 100% rename from Xamarin.Essentials/Magnetometer/Magnetometer.ios.cs rename to Xamarin.Essentials/Magnetometer/Magnetometer.ios.watchos.cs diff --git a/Xamarin.Essentials/Magnetometer/Magnetometer.netstandard.cs b/Xamarin.Essentials/Magnetometer/Magnetometer.netstandard.tvos.cs similarity index 55% rename from Xamarin.Essentials/Magnetometer/Magnetometer.netstandard.cs rename to Xamarin.Essentials/Magnetometer/Magnetometer.netstandard.tvos.cs index 5b1c4f2c0..1627e2c7b 100644 --- a/Xamarin.Essentials/Magnetometer/Magnetometer.netstandard.cs +++ b/Xamarin.Essentials/Magnetometer/Magnetometer.netstandard.tvos.cs @@ -3,12 +3,12 @@ public static partial class Magnetometer { internal static bool IsSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStart(SensorSpeed sensorSpeed) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static void PlatformStop() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/MainThread/MainThread.ios.cs b/Xamarin.Essentials/MainThread/MainThread.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/MainThread/MainThread.ios.cs rename to Xamarin.Essentials/MainThread/MainThread.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/MainThread/MainThread.netstandard.cs b/Xamarin.Essentials/MainThread/MainThread.netstandard.cs index f41f2b2d1..19d2186d7 100644 --- a/Xamarin.Essentials/MainThread/MainThread.netstandard.cs +++ b/Xamarin.Essentials/MainThread/MainThread.netstandard.cs @@ -5,9 +5,9 @@ namespace Xamarin.Essentials public static partial class MainThread { static void PlatformBeginInvokeOnMainThread(Action action) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static bool PlatformIsMainThread => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Map/Map.ios.cs b/Xamarin.Essentials/Map/Map.ios.watchos.cs similarity index 82% rename from Xamarin.Essentials/Map/Map.ios.cs rename to Xamarin.Essentials/Map/Map.ios.watchos.cs index c7a319226..6b37cec45 100644 --- a/Xamarin.Essentials/Map/Map.ios.cs +++ b/Xamarin.Essentials/Map/Map.ios.watchos.cs @@ -21,6 +21,7 @@ internal static Task PlatformOpenMapsAsync(double latitude, double longitude, Ma internal static async Task PlatformOpenMapsAsync(Placemark placemark, MapLaunchOptions options) { +#if __IOS__ var address = new MKPlacemarkAddress { CountryCode = placemark.CountryCode, @@ -29,13 +30,24 @@ internal static async Task PlatformOpenMapsAsync(Placemark placemark, MapLaunchO Street = placemark.Thoroughfare, City = placemark.Locality, Zip = placemark.PostalCode + }.Dictionary; +#else + var address = new NSDictionary + { + [Contacts.CNPostalAddressKey.City] = new NSString(placemark.Locality), + [Contacts.CNPostalAddressKey.Country] = new NSString(placemark.CountryName), + [Contacts.CNPostalAddressKey.State] = new NSString(placemark.AdminArea), + [Contacts.CNPostalAddressKey.Street] = new NSString(placemark.Thoroughfare), + [Contacts.CNPostalAddressKey.PostalCode] = new NSString(placemark.PostalCode), + [Contacts.CNPostalAddressKey.IsoCountryCode] = new NSString(placemark.CountryCode) }; +#endif var coder = new CLGeocoder(); CLPlacemark[] placemarks = null; try { - placemarks = await coder.GeocodeAddressAsync(address.Dictionary); + placemarks = await coder.GeocodeAddressAsync(address); } catch { diff --git a/Xamarin.Essentials/Map/Map.netstandard.cs b/Xamarin.Essentials/Map/Map.netstandard.tvos.cs similarity index 69% rename from Xamarin.Essentials/Map/Map.netstandard.cs rename to Xamarin.Essentials/Map/Map.netstandard.tvos.cs index 8faef3e9a..b2becd1b1 100644 --- a/Xamarin.Essentials/Map/Map.netstandard.cs +++ b/Xamarin.Essentials/Map/Map.netstandard.tvos.cs @@ -5,9 +5,9 @@ namespace Xamarin.Essentials public static partial class Map { internal static Task PlatformOpenMapsAsync(double latitude, double longitude, MapLaunchOptions options) - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; internal static Task PlatformOpenMapsAsync(Placemark placemark, MapLaunchOptions options) - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/OrientationSensor/OrientationSensor.ios.cs b/Xamarin.Essentials/OrientationSensor/OrientationSensor.ios.watchos.cs similarity index 100% rename from Xamarin.Essentials/OrientationSensor/OrientationSensor.ios.cs rename to Xamarin.Essentials/OrientationSensor/OrientationSensor.ios.watchos.cs diff --git a/Xamarin.Essentials/OrientationSensor/OrientationSensor.netstandard.cs b/Xamarin.Essentials/OrientationSensor/OrientationSensor.netstandard.tvos.cs similarity index 54% rename from Xamarin.Essentials/OrientationSensor/OrientationSensor.netstandard.cs rename to Xamarin.Essentials/OrientationSensor/OrientationSensor.netstandard.tvos.cs index 7f6c4906b..80417c528 100644 --- a/Xamarin.Essentials/OrientationSensor/OrientationSensor.netstandard.cs +++ b/Xamarin.Essentials/OrientationSensor/OrientationSensor.netstandard.tvos.cs @@ -3,12 +3,12 @@ public static partial class OrientationSensor { internal static bool IsSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformStart(SensorSpeed sensorSpeed) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformStop() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Permissions/Permissions.netstandard.cs b/Xamarin.Essentials/Permissions/Permissions.netstandard.tvos.watchos.cs similarity index 66% rename from Xamarin.Essentials/Permissions/Permissions.netstandard.cs rename to Xamarin.Essentials/Permissions/Permissions.netstandard.tvos.watchos.cs index 2349cc00f..54a3fe3ea 100644 --- a/Xamarin.Essentials/Permissions/Permissions.netstandard.cs +++ b/Xamarin.Essentials/Permissions/Permissions.netstandard.tvos.watchos.cs @@ -5,12 +5,12 @@ namespace Xamarin.Essentials internal static partial class Permissions { static bool PlatformEnsureDeclared(PermissionType permission, bool throwIfMissing) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformCheckStatusAsync(PermissionType permission) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformRequestAsync(PermissionType permission) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/PhoneDialer/PhoneDialer.netstandard.cs b/Xamarin.Essentials/PhoneDialer/PhoneDialer.netstandard.tvos.watchos.cs similarity index 57% rename from Xamarin.Essentials/PhoneDialer/PhoneDialer.netstandard.cs rename to Xamarin.Essentials/PhoneDialer/PhoneDialer.netstandard.tvos.watchos.cs index c8e143130..feb012cdb 100644 --- a/Xamarin.Essentials/PhoneDialer/PhoneDialer.netstandard.cs +++ b/Xamarin.Essentials/PhoneDialer/PhoneDialer.netstandard.tvos.watchos.cs @@ -3,9 +3,9 @@ public static partial class PhoneDialer { internal static bool IsSupported => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformOpen(string number) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Platform/Platform.ios.cs b/Xamarin.Essentials/Platform/Platform.ios.tvos.watchos.cs similarity index 91% rename from Xamarin.Essentials/Platform/Platform.ios.cs rename to Xamarin.Essentials/Platform/Platform.ios.tvos.watchos.cs index 2f795fe35..3512c4ec4 100644 --- a/Xamarin.Essentials/Platform/Platform.ios.cs +++ b/Xamarin.Essentials/Platform/Platform.ios.tvos.watchos.cs @@ -1,16 +1,26 @@ using System; using System.Linq; using System.Runtime.InteropServices; -using CoreMotion; using Foundation; using ObjCRuntime; using UIKit; +#if __IOS__ +using CoreMotion; +#elif __WATCHOS__ +using CoreMotion; +using UIDevice = WatchKit.WKInterfaceDevice; +#endif + namespace Xamarin.Essentials { public static partial class Platform { +#if __IOS__ [DllImport(Constants.SystemLibrary, EntryPoint = "sysctlbyname")] +#else + [DllImport(Constants.libSystemLibrary, EntryPoint = "sysctlbyname")] +#endif internal static extern int SysctlByName([MarshalAs(UnmanagedType.LPStr)] string property, IntPtr output, IntPtr oldLen, IntPtr newp, uint newlen); internal static string GetSystemLibraryProperty(string property) @@ -40,6 +50,7 @@ internal static string GetSystemLibraryProperty(string property) internal static bool HasOSVersion(int major, int minor) => UIDevice.CurrentDevice.CheckSystemVersion(major, minor); +#if __IOS__ || __TVOS__ internal static UIViewController GetCurrentViewController(bool throwIfNull = true) { UIViewController viewController = null; @@ -70,11 +81,14 @@ internal static UIViewController GetCurrentViewController(bool throwIfNull = tru return viewController; } +#endif +#if __IOS__ || __WATCHOS__ static CMMotionManager motionManager; internal static CMMotionManager MotionManager => motionManager ?? (motionManager = new CMMotionManager()); +#endif internal static NSOperationQueue GetCurrentQueue() => NSOperationQueue.CurrentQueue ?? new NSOperationQueue(); diff --git a/Xamarin.Essentials/Preferences/Preferences.ios.cs b/Xamarin.Essentials/Preferences/Preferences.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/Preferences/Preferences.ios.cs rename to Xamarin.Essentials/Preferences/Preferences.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Preferences/Preferences.netstandard.cs b/Xamarin.Essentials/Preferences/Preferences.netstandard.cs index b4ffe19d8..5e3271293 100644 --- a/Xamarin.Essentials/Preferences/Preferences.netstandard.cs +++ b/Xamarin.Essentials/Preferences/Preferences.netstandard.cs @@ -3,18 +3,18 @@ public static partial class Preferences { static bool PlatformContainsKey(string key, string sharedName) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformRemove(string key, string sharedName) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformClear(string sharedName) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformSet(string key, T value, string sharedName) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static T PlatformGet(string key, T defaultValue, string sharedName) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs b/Xamarin.Essentials/SecureStorage/SecureStorage.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/SecureStorage/SecureStorage.ios.cs rename to Xamarin.Essentials/SecureStorage/SecureStorage.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/SecureStorage/SecureStorage.netstandard.cs b/Xamarin.Essentials/SecureStorage/SecureStorage.netstandard.cs index 68409e817..7ec8aed0f 100644 --- a/Xamarin.Essentials/SecureStorage/SecureStorage.netstandard.cs +++ b/Xamarin.Essentials/SecureStorage/SecureStorage.netstandard.cs @@ -5,15 +5,15 @@ namespace Xamarin.Essentials public partial class SecureStorage { static Task PlatformGetAsync(string key) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformSetAsync(string key, string data) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static bool PlatformRemove(string key) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformRemoveAll() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Share/Share.netstandard.cs b/Xamarin.Essentials/Share/Share.netstandard.tvos.watchos.cs similarity index 65% rename from Xamarin.Essentials/Share/Share.netstandard.cs rename to Xamarin.Essentials/Share/Share.netstandard.tvos.watchos.cs index 1a77eb1a2..177db3eab 100644 --- a/Xamarin.Essentials/Share/Share.netstandard.cs +++ b/Xamarin.Essentials/Share/Share.netstandard.tvos.watchos.cs @@ -5,9 +5,9 @@ namespace Xamarin.Essentials public static partial class Share { static Task PlatformRequestAsync(ShareTextRequest request) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformRequestAsync(ShareFileRequest request) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Sms/Sms.netstandard.cs b/Xamarin.Essentials/Sms/Sms.netstandard.tvos.watchos.cs similarity index 60% rename from Xamarin.Essentials/Sms/Sms.netstandard.cs rename to Xamarin.Essentials/Sms/Sms.netstandard.tvos.watchos.cs index 4c8ea1e28..6759b0802 100644 --- a/Xamarin.Essentials/Sms/Sms.netstandard.cs +++ b/Xamarin.Essentials/Sms/Sms.netstandard.tvos.watchos.cs @@ -5,9 +5,9 @@ namespace Xamarin.Essentials public static partial class Sms { internal static bool IsComposeSupported - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; static Task PlatformComposeAsync(SmsMessage message) - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/TextToSpeech/TextToSpeech.ios.cs b/Xamarin.Essentials/TextToSpeech/TextToSpeech.ios.tvos.watchos.cs similarity index 96% rename from Xamarin.Essentials/TextToSpeech/TextToSpeech.ios.cs rename to Xamarin.Essentials/TextToSpeech/TextToSpeech.ios.tvos.watchos.cs index fbe76b9ab..71c650014 100644 --- a/Xamarin.Essentials/TextToSpeech/TextToSpeech.ios.cs +++ b/Xamarin.Essentials/TextToSpeech/TextToSpeech.ios.tvos.watchos.cs @@ -18,7 +18,7 @@ internal static Task PlatformSpeakAsync(string text, SpeechOptions options, Canc return SpeakUtterance(speechUtterance, cancelToken); } - private static AVSpeechUtterance GetSpeechUtterance(string text, SpeechOptions options) + static AVSpeechUtterance GetSpeechUtterance(string text, SpeechOptions options) { var speechUtterance = new AVSpeechUtterance(text); diff --git a/Xamarin.Essentials/TextToSpeech/TextToSpeech.netstandard.cs b/Xamarin.Essentials/TextToSpeech/TextToSpeech.netstandard.cs index 36ccf9fb9..d9c570830 100644 --- a/Xamarin.Essentials/TextToSpeech/TextToSpeech.netstandard.cs +++ b/Xamarin.Essentials/TextToSpeech/TextToSpeech.netstandard.cs @@ -7,9 +7,9 @@ namespace Xamarin.Essentials public static partial class TextToSpeech { internal static Task PlatformSpeakAsync(string text, SpeechOptions options, CancellationToken cancelToken = default) => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; internal static Task> PlatformGetLocalesAsync() => - throw new NotImplementedInReferenceAssemblyException(); + throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Types/DevicePlatform.shared.cs b/Xamarin.Essentials/Types/DevicePlatform.shared.cs index d933fadd6..dad53ba9d 100644 --- a/Xamarin.Essentials/Types/DevicePlatform.shared.cs +++ b/Xamarin.Essentials/Types/DevicePlatform.shared.cs @@ -10,10 +10,14 @@ namespace Xamarin.Essentials public static DevicePlatform iOS { get; } = new DevicePlatform(nameof(iOS)); + public static DevicePlatform tvOS { get; } = new DevicePlatform(nameof(tvOS)); + public static DevicePlatform Tizen { get; } = new DevicePlatform(nameof(Tizen)); public static DevicePlatform UWP { get; } = new DevicePlatform(nameof(UWP)); + public static DevicePlatform watchOS { get; } = new DevicePlatform(nameof(watchOS)); + public static DevicePlatform Unknown { get; } = new DevicePlatform(nameof(Unknown)); DevicePlatform(string devicePlatform) diff --git a/Xamarin.Essentials/Types/LocationExtensions.ios.cs b/Xamarin.Essentials/Types/LocationExtensions.ios.tvos.watchos.cs similarity index 98% rename from Xamarin.Essentials/Types/LocationExtensions.ios.cs rename to Xamarin.Essentials/Types/LocationExtensions.ios.tvos.watchos.cs index 633927c25..4f0256849 100644 --- a/Xamarin.Essentials/Types/LocationExtensions.ios.cs +++ b/Xamarin.Essentials/Types/LocationExtensions.ios.tvos.watchos.cs @@ -28,8 +28,10 @@ internal static Location ToLocation(this CLLocation location) => Altitude = location.VerticalAccuracy < 0 ? default(double?) : location.Altitude, Accuracy = location.HorizontalAccuracy, Timestamp = location.Timestamp.ToDateTime(), +#if __iOS__ || __WATCHOS__ Course = location.Course < 0 ? default(double?) : location.Course, Speed = location.Speed < 0 ? default(double?) : location.Speed, +#endif IsFromMockProvider = DeviceInfo.DeviceType == DeviceType.Virtual }; diff --git a/Xamarin.Essentials/Types/PlacemarkExtensions.ios.cs b/Xamarin.Essentials/Types/PlacemarkExtensions.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/Types/PlacemarkExtensions.ios.cs rename to Xamarin.Essentials/Types/PlacemarkExtensions.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.ios.cs b/Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.ios.cs rename to Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.ios.cs b/Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.ios.cs rename to Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Types/PlatformExtensions/RectangleExtensions.ios.cs b/Xamarin.Essentials/Types/PlatformExtensions/RectangleExtensions.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/Types/PlatformExtensions/RectangleExtensions.ios.cs rename to Xamarin.Essentials/Types/PlatformExtensions/RectangleExtensions.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Types/SensorSpeed.ios.cs b/Xamarin.Essentials/Types/SensorSpeed.ios.tvos.watchos.cs similarity index 100% rename from Xamarin.Essentials/Types/SensorSpeed.ios.cs rename to Xamarin.Essentials/Types/SensorSpeed.ios.tvos.watchos.cs diff --git a/Xamarin.Essentials/Types/Shared/Exceptions.shared.cs b/Xamarin.Essentials/Types/Shared/Exceptions.shared.cs index 462e767d5..87f715213 100644 --- a/Xamarin.Essentials/Types/Shared/Exceptions.shared.cs +++ b/Xamarin.Essentials/Types/Shared/Exceptions.shared.cs @@ -2,6 +2,18 @@ namespace Xamarin.Essentials { + static class ExceptionUtils + { +#if NETSTANDARD1_0 || NETSTANDARD2_0 + internal static NotImplementedInReferenceAssemblyException NotSupportedOrImplementedException => + new NotImplementedInReferenceAssemblyException(); +#else + internal static FeatureNotSupportedException NotSupportedOrImplementedException => + new FeatureNotSupportedException($"This API is not supported on {DeviceInfo.Platform}"); +#endif + + } + public class NotImplementedInReferenceAssemblyException : NotImplementedException { public NotImplementedInReferenceAssemblyException() diff --git a/Xamarin.Essentials/Vibration/Vibration.netstandard.cs b/Xamarin.Essentials/Vibration/Vibration.netstandard.tvos.watchos.cs similarity index 52% rename from Xamarin.Essentials/Vibration/Vibration.netstandard.cs rename to Xamarin.Essentials/Vibration/Vibration.netstandard.tvos.watchos.cs index 4c8fe3b02..9d769e2a6 100644 --- a/Xamarin.Essentials/Vibration/Vibration.netstandard.cs +++ b/Xamarin.Essentials/Vibration/Vibration.netstandard.tvos.watchos.cs @@ -5,12 +5,12 @@ namespace Xamarin.Essentials public static partial class Vibration { internal static bool IsSupported - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformVibrate(TimeSpan duration) - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; static void PlatformCancel() - => throw new NotImplementedInReferenceAssemblyException(); + => throw ExceptionUtils.NotSupportedOrImplementedException; } } diff --git a/Xamarin.Essentials/Xamarin.Essentials.csproj b/Xamarin.Essentials/Xamarin.Essentials.csproj index a333a0087..835f3d7b6 100644 --- a/Xamarin.Essentials/Xamarin.Essentials.csproj +++ b/Xamarin.Essentials/Xamarin.Essentials.csproj @@ -1,14 +1,13 @@  - - netstandard1.0;netstandard2.0;Xamarin.iOS10;MonoAndroid60;MonoAndroid70;MonoAndroid71;MonoAndroid80;MonoAndroid81;MonoAndroid90;uap10.0.16299;tizen40; - netstandard1.0;netstandard2.0;Xamarin.iOS10;MonoAndroid60;MonoAndroid70;MonoAndroid71;MonoAndroid80;MonoAndroid81;MonoAndroid90;tizen40; + netstandard1.0;netstandard2.0;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.WatchOS10;MonoAndroid60;MonoAndroid70;MonoAndroid71;MonoAndroid80;MonoAndroid81;MonoAndroid90;uap10.0.16299;tizen40; + netstandard1.0;netstandard2.0;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.WatchOS10;MonoAndroid60;MonoAndroid70;MonoAndroid71;MonoAndroid80;MonoAndroid81;MonoAndroid90;tizen40; Xamarin.Essentials Xamarin.Essentials Xamarin.Essentials https://raw.githubusercontent.com/xamarin/Essentials/master/Assets/xamarin.essentials_128x128.png Xamarin.Essentials: a kit of essential API's for your apps - xamarin, windows, ios, android, xamarin.forms, toolkit, Xamarin.Essentials, kit + xamarin, windows, ios, android, xamarin.forms, watchos, tvos, toolkit, Xamarin.Essentials, kit Xamarin.Essentials Xamarin.Essentials: a kit of essential API's for your apps $(AssemblyName) ($(TargetFramework)) @@ -83,8 +82,18 @@ - - + + + + + + + + + + + + @@ -92,7 +101,6 @@ - diff --git a/Xamarin.Essentials/mdoc.targets b/Xamarin.Essentials/mdoc.targets index 91c6a4042..46f8e195f 100644 --- a/Xamarin.Essentials/mdoc.targets +++ b/Xamarin.Essentials/mdoc.targets @@ -97,6 +97,8 @@ + + <_FormatDocs DocsRoot="$(MDocDocumentationDirectory)" /> diff --git a/docs/en/FrameworksIndex/xamarin-essentials-tvos.xml b/docs/en/FrameworksIndex/xamarin-essentials-tvos.xml new file mode 100644 index 000000000..01f9ece3d --- /dev/null +++ b/docs/en/FrameworksIndex/xamarin-essentials-tvos.xml @@ -0,0 +1,684 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/en/FrameworksIndex/xamarin-essentials-watchos.xml b/docs/en/FrameworksIndex/xamarin-essentials-watchos.xml new file mode 100644 index 000000000..c93e6c268 --- /dev/null +++ b/docs/en/FrameworksIndex/xamarin-essentials-watchos.xml @@ -0,0 +1,684 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/en/FrameworksIndex/xamarin-essentials.xml b/docs/en/FrameworksIndex/xamarin-essentials.xml index 9b8dbd64c..befaea823 100644 --- a/docs/en/FrameworksIndex/xamarin-essentials.xml +++ b/docs/en/FrameworksIndex/xamarin-essentials.xml @@ -207,8 +207,10 @@ + + diff --git a/docs/en/Xamarin.Essentials/AccelerometerData.xml b/docs/en/Xamarin.Essentials/AccelerometerData.xml index ef6b59b01..4ad1cddc2 100644 --- a/docs/en/Xamarin.Essentials/AccelerometerData.xml +++ b/docs/en/Xamarin.Essentials/AccelerometerData.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/Xamarin.Essentials/BarometerData.xml b/docs/en/Xamarin.Essentials/BarometerData.xml index 8fba5a779..b586da9f7 100644 --- a/docs/en/Xamarin.Essentials/BarometerData.xml +++ b/docs/en/Xamarin.Essentials/BarometerData.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/Xamarin.Essentials/CompassData.xml b/docs/en/Xamarin.Essentials/CompassData.xml index 8b4ac0989..2f3270e87 100644 --- a/docs/en/Xamarin.Essentials/CompassData.xml +++ b/docs/en/Xamarin.Essentials/CompassData.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/Xamarin.Essentials/DeviceIdiom.xml b/docs/en/Xamarin.Essentials/DeviceIdiom.xml index 50e9113dc..210fbc706 100644 --- a/docs/en/Xamarin.Essentials/DeviceIdiom.xml +++ b/docs/en/Xamarin.Essentials/DeviceIdiom.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/Xamarin.Essentials/DevicePlatform.xml b/docs/en/Xamarin.Essentials/DevicePlatform.xml index 56431e8f5..f8500a310 100644 --- a/docs/en/Xamarin.Essentials/DevicePlatform.xml +++ b/docs/en/Xamarin.Essentials/DevicePlatform.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly @@ -217,6 +217,24 @@ To be added. + + + + + Property + + Xamarin.Essentials + 1.0.0.0 + + + Xamarin.Essentials.DevicePlatform + + + To be added. + To be added. + To be added. + + @@ -253,5 +271,23 @@ To be added. + + + + + Property + + Xamarin.Essentials + 1.0.0.0 + + + Xamarin.Essentials.DevicePlatform + + + To be added. + To be added. + To be added. + + diff --git a/docs/en/Xamarin.Essentials/DisplayInfo.xml b/docs/en/Xamarin.Essentials/DisplayInfo.xml index aa2d49a6d..171e8e134 100644 --- a/docs/en/Xamarin.Essentials/DisplayInfo.xml +++ b/docs/en/Xamarin.Essentials/DisplayInfo.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/Xamarin.Essentials/DisplayInfoChangedEventArgs.xml b/docs/en/Xamarin.Essentials/DisplayInfoChangedEventArgs.xml index 8f382b7f1..ffa760096 100644 --- a/docs/en/Xamarin.Essentials/DisplayInfoChangedEventArgs.xml +++ b/docs/en/Xamarin.Essentials/DisplayInfoChangedEventArgs.xml @@ -27,7 +27,7 @@ 1.0.0.0 - + To be added. diff --git a/docs/en/Xamarin.Essentials/EmailAttachment.xml b/docs/en/Xamarin.Essentials/EmailAttachment.xml index 289449fc0..a0750d773 100644 --- a/docs/en/Xamarin.Essentials/EmailAttachment.xml +++ b/docs/en/Xamarin.Essentials/EmailAttachment.xml @@ -26,7 +26,7 @@ 1.0.0.0 - + Full path and filename to file. diff --git a/docs/en/Xamarin.Essentials/GyroscopeData.xml b/docs/en/Xamarin.Essentials/GyroscopeData.xml index 9fc1f3061..f047672a1 100644 --- a/docs/en/Xamarin.Essentials/GyroscopeData.xml +++ b/docs/en/Xamarin.Essentials/GyroscopeData.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/Xamarin.Essentials/MagnetometerData.xml b/docs/en/Xamarin.Essentials/MagnetometerData.xml index bb84c5c82..57c6df97b 100644 --- a/docs/en/Xamarin.Essentials/MagnetometerData.xml +++ b/docs/en/Xamarin.Essentials/MagnetometerData.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/Xamarin.Essentials/OrientationSensorData.xml b/docs/en/Xamarin.Essentials/OrientationSensorData.xml index ad5cca0ac..6d767ffe2 100644 --- a/docs/en/Xamarin.Essentials/OrientationSensorData.xml +++ b/docs/en/Xamarin.Essentials/OrientationSensorData.xml @@ -15,7 +15,7 @@ - + System.Runtime.CompilerServices.IsReadOnly diff --git a/docs/en/index.xml b/docs/en/index.xml index 47fc3f97c..fe860fd6a 100644 --- a/docs/en/index.xml +++ b/docs/en/index.xml @@ -59,7 +59,7 @@ System.Runtime.Versioning.TargetFramework("MonoAndroid,Version=v8.1", FrameworkDisplayName="Xamarin.Android v8.1 Support") - + Foundation.LinkerSafe @@ -83,6 +83,18 @@ System.Reflection.AssemblyInformationalVersion("1.0.0+7ceee2ec3cc4caab1bb281521d7e9ecf471edc7a") + + System.Reflection.AssemblyProduct("Xamarin.Essentials (Xamarin.TVOS10)") + + + System.Runtime.Versioning.TargetFramework("Xamarin.TVOS,Version=v1.0", FrameworkDisplayName="Xamarin.TVOS") + + + System.Reflection.AssemblyProduct("Xamarin.Essentials (Xamarin.WatchOS10)") + + + System.Runtime.Versioning.TargetFramework("Xamarin.WatchOS,Version=v1.0", FrameworkDisplayName="Xamarin.WatchOS") + diff --git a/docs/frameworks.xml b/docs/frameworks.xml index bd9ae2e93..7b711b9d2 100644 --- a/docs/frameworks.xml +++ b/docs/frameworks.xml @@ -2,5 +2,7 @@ + +