├── .editorconfig
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── bug-report.md
│ ├── customer-feedback.yml
│ ├── feature-request.md
│ └── new-api-spec.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .openpublishing.build.ps1
├── .openpublishing.publish.config.json
├── Assets
├── xamarin.essentials.icon.sketch
└── xamarin.essentials_128x128.png
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── DeviceTests
├── DeviceTests.Android
│ ├── Assets
│ │ ├── AppBundleFile.txt
│ │ ├── AppBundleFile_NoExtension
│ │ └── Folder
│ │ │ └── AppBundleFile_Nested.txt
│ ├── DeviceTests.Android.csproj
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── drawable-hdpi
│ │ │ └── icon.png
│ │ ├── drawable-xhdpi
│ │ │ └── icon.png
│ │ ├── drawable-xxhdpi
│ │ │ └── icon.png
│ │ ├── drawable
│ │ │ └── icon.png
│ │ ├── layout
│ │ │ ├── Main.axml
│ │ │ ├── Tabbar.axml
│ │ │ └── Toolbar.axml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ └── values
│ │ │ ├── Strings.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ └── styles.xml
│ ├── TestInstrumentation.cs
│ └── Tests
│ │ └── FileProvider_Tests.cs
├── DeviceTests.Shared
│ ├── Accelerometer_Tests.cs
│ ├── AppActions_Tests.cs
│ ├── AssemblyInfo.cs
│ ├── Barometer_Shared.cs
│ ├── Battery_Tests.cs
│ ├── Clipboard_Tests.cs
│ ├── Color_Tests.cs
│ ├── Compass_Tests.cs
│ ├── Connectivity_Tests.cs
│ ├── Contacts_Tests.cs
│ ├── DeviceInfo_Tests.cs
│ ├── DeviceTests.Shared.csproj
│ ├── Email_Tests.cs
│ ├── FileSystem_Tests.cs
│ ├── Flashlight_Tests.cs
│ ├── Geocoding_Tests.cs
│ ├── Geolocation_Tests.cs
│ ├── Gyroscope_Tests.cs
│ ├── HapticFeedback_Tests.cs
│ ├── HardwareSupport.cs
│ ├── Launcher_Tests.cs
│ ├── Magnetometer_Tests.cs
│ ├── MainThread_Tests.cs
│ ├── Maps_Tests.cs
│ ├── Permissions_Tests.cs
│ ├── PhoneDialer_Tests.cs
│ ├── Point_Tests.cs
│ ├── Preferences_Tests.cs
│ ├── Rectangle_Tests.cs
│ ├── SecureStorage_Tests.cs
│ ├── Share_Tests.cs
│ ├── Size_Tests.cs
│ ├── Traits.cs
│ ├── Utils.cs
│ ├── VersionTracking_Tests.cs
│ ├── Vibration_Tests.cs
│ └── WebAuthenticator_Tests.cs
├── DeviceTests.UWP
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppBundleFile.txt
│ ├── AppBundleFile_NoExtension
│ ├── Assets
│ │ ├── LockScreenLogo.scale-100.png
│ │ ├── LockScreenLogo.scale-125.png
│ │ ├── LockScreenLogo.scale-150.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── LockScreenLogo.scale-400.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-125.png
│ │ ├── SplashScreen.scale-150.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── SplashScreen.scale-400.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-125.png
│ │ ├── Square150x150Logo.scale-150.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-400.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-125.png
│ │ ├── Square44x44Logo.scale-150.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── Square44x44Logo.targetsize-16_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-256_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-32_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-48_altform-unplated.png
│ │ ├── StoreLogo.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ ├── Wide310x150Logo.scale-125.png
│ │ ├── Wide310x150Logo.scale-150.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ └── Wide310x150Logo.scale-400.png
│ ├── DeviceTests.UWP.csproj
│ ├── Folder
│ │ └── AppBundleFile_Nested.txt
│ ├── Package.appxmanifest
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
├── DeviceTests.iOS
│ ├── AppDelegate.cs
│ ├── DeviceTests.iOS.csproj
│ ├── Entitlements.plist
│ ├── GlobalSuppressions.cs
│ ├── Info.plist
│ ├── Main.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── AppBundleFile.txt
│ │ ├── AppBundleFile_NoExtension
│ │ ├── Folder
│ │ │ └── AppBundleFile_Nested.txt
│ │ ├── Icon-60.png
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-76.png
│ │ ├── Icon-76@2x.png
│ │ ├── Icon-76@3x.png
│ │ ├── Icon-Small-40.png
│ │ ├── Icon-Small-40@2x.png
│ │ ├── Icon-Small-40@3x.png
│ │ ├── Icon-Small.png
│ │ ├── Icon-Small@2x.png
│ │ ├── Icon-Small@3x.png
│ │ └── LaunchScreen.storyboard
│ └── TestApplicationDelegate.cs
└── build.cake
├── Directory.Build.props
├── LICENSE
├── LICENSE-CODE
├── NuGet.config
├── PRODUCT-FEEDBACK.md
├── README.md
├── SUBMITTING-ISSUES.md
├── Samples
├── Sample.Server.WebAuthenticator
│ ├── Controllers
│ │ └── MobileAuthController.cs
│ ├── Program.cs
│ ├── Sample.Server.WebAuthenticator.csproj
│ ├── Startup.cs
│ └── appsettings.json
├── Samples.Android
│ ├── Assets
│ │ └── FileSystemTemplate.txt
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── drawable-hdpi
│ │ │ ├── app_info_action_icon.png
│ │ │ ├── battery_action_icon.png
│ │ │ └── icon.png
│ │ ├── drawable-xhdpi
│ │ │ ├── app_info_action_icon.png
│ │ │ ├── battery_action_icon.png
│ │ │ └── icon.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── app_info_action_icon.png
│ │ │ ├── battery_action_icon.png
│ │ │ └── icon.png
│ │ ├── drawable
│ │ │ ├── app_info_action_icon.png
│ │ │ ├── battery_action_icon.png
│ │ │ └── icon.png
│ │ ├── layout
│ │ │ ├── Main.axml
│ │ │ ├── Tabbar.axml
│ │ │ └── Toolbar.axml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── values
│ │ │ ├── Strings.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ └── styles.xml
│ │ └── xml
│ │ │ └── my_backup_rules.xml
│ ├── Samples.Android.csproj
│ ├── appcenter-post-clone.sh
│ └── proguard.cfg
├── Samples.Mac
│ ├── AppDelegate.cs
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── AppIcon-128.png
│ │ │ ├── AppIcon-128@2x.png
│ │ │ ├── AppIcon-16.png
│ │ │ ├── AppIcon-16@2x.png
│ │ │ ├── AppIcon-256.png
│ │ │ ├── AppIcon-256@2x.png
│ │ │ ├── AppIcon-32.png
│ │ │ ├── AppIcon-32@2x.png
│ │ │ ├── AppIcon-512.png
│ │ │ ├── AppIcon-512@2x.png
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.cs
│ ├── Main.storyboard
│ ├── Resources
│ │ └── FileSystemTemplate.txt
│ └── Samples.Mac.csproj
├── Samples.Tizen
│ ├── CustomViewCellRenderer.cs
│ ├── Program.cs
│ ├── Samples.Tizen.csproj
│ ├── res
│ │ └── FileSystemTemplate.txt
│ ├── shared
│ │ └── res
│ │ │ └── Samples.Tizen.png
│ └── tizen-manifest.xml
├── Samples.UWP
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── LockScreenLogo.scale-100.png
│ │ ├── LockScreenLogo.scale-125.png
│ │ ├── LockScreenLogo.scale-150.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── LockScreenLogo.scale-400.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-125.png
│ │ ├── SplashScreen.scale-150.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── SplashScreen.scale-400.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-125.png
│ │ ├── Square150x150Logo.scale-150.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-400.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-125.png
│ │ ├── Square44x44Logo.scale-150.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── Square44x44Logo.targetsize-16_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-256_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-32_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-48_altform-unplated.png
│ │ ├── StoreLogo.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ ├── Wide310x150Logo.scale-125.png
│ │ ├── Wide310x150Logo.scale-150.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-400.png
│ │ ├── app_info_action_icon.png
│ │ └── battery_action_icon.png
│ ├── FileSystemTemplate.txt
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ └── Samples.UWP.csproj
├── Samples.iOS
│ ├── AppDelegate.cs
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-1024.png
│ │ │ ├── Icon-167.png
│ │ │ ├── Icon-60.png
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ └── Icon-Small@3x.png
│ │ ├── app_info_action_icon.imageset
│ │ │ ├── Contents.json
│ │ │ ├── app_info_action_icon.png
│ │ │ ├── app_info_action_icon@2x.png
│ │ │ └── app_info_action_icon@3x.png
│ │ └── battery_action_icon.imageset
│ │ │ ├── Contents.json
│ │ │ ├── battery_action_icon.png
│ │ │ ├── battery_action_icon@2x.png
│ │ │ └── battery_action_icon@3x.png
│ ├── Entitlements.plist
│ ├── GlobalSuppressions.cs
│ ├── Info.plist
│ ├── Main.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── FileSystemTemplate.txt
│ │ ├── LaunchScreen.storyboard
│ │ ├── app_info_action_icon@2x.png
│ │ └── battery_action_icon@2x.png
│ └── Samples.iOS.csproj
└── Samples
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Converters
│ └── NegativeConverter.cs
│ ├── Helpers
│ ├── CommonConstants.cs
│ └── ViewHelpers.cs
│ ├── Model
│ ├── PermissionItem.cs
│ └── SampleItem.cs
│ ├── Samples.csproj
│ ├── View
│ ├── AccelerometerPage.xaml
│ ├── AccelerometerPage.xaml.cs
│ ├── AllSensorsPage.xaml
│ ├── AllSensorsPage.xaml.cs
│ ├── AppInfoPage.xaml
│ ├── AppInfoPage.xaml.cs
│ ├── BarometerPage.xaml
│ ├── BarometerPage.xaml.cs
│ ├── BasePage.cs
│ ├── BatteryPage.xaml
│ ├── BatteryPage.xaml.cs
│ ├── BrowserPage.xaml
│ ├── BrowserPage.xaml.cs
│ ├── ClipboardPage.xaml
│ ├── ClipboardPage.xaml.cs
│ ├── ColorConvertersPage.xaml
│ ├── ColorConvertersPage.xaml.cs
│ ├── CompassPage.xaml
│ ├── CompassPage.xaml.cs
│ ├── ConnectivityPage.xaml
│ ├── ConnectivityPage.xaml.cs
│ ├── ContactDetailsPage.xaml
│ ├── ContactDetailsPage.xaml.cs
│ ├── ContactsPage.xaml
│ ├── ContactsPage.xaml.cs
│ ├── DeviceInfoPage.xaml
│ ├── DeviceInfoPage.xaml.cs
│ ├── EmailPage.xaml
│ ├── EmailPage.xaml.cs
│ ├── FilePickerPage.xaml
│ ├── FilePickerPage.xaml.cs
│ ├── FileSystemPage.xaml
│ ├── FileSystemPage.xaml.cs
│ ├── FlashlightPage.xaml
│ ├── FlashlightPage.xaml.cs
│ ├── GeocodingPage.xaml
│ ├── GeocodingPage.xaml.cs
│ ├── GeolocationPage.xaml
│ ├── GeolocationPage.xaml.cs
│ ├── GyroscopePage.xaml
│ ├── GyroscopePage.xaml.cs
│ ├── HapticFeedbackPage.xaml
│ ├── HapticFeedbackPage.xaml.cs
│ ├── HomePage.xaml
│ ├── HomePage.xaml.cs
│ ├── KeepScreenOnPage.xaml
│ ├── KeepScreenOnPage.xaml.cs
│ ├── LauncherPage.xaml
│ ├── LauncherPage.xaml.cs
│ ├── MagnetometerPage.xaml
│ ├── MagnetometerPage.xaml.cs
│ ├── MapsPage.xaml
│ ├── MapsPage.xaml.cs
│ ├── MediaPickerPage.xaml
│ ├── MediaPickerPage.xaml.cs
│ ├── OrientationSensorPage.xaml
│ ├── OrientationSensorPage.xaml.cs
│ ├── PermissionsPage.xaml
│ ├── PermissionsPage.xaml.cs
│ ├── PhoneDialerPage.xaml
│ ├── PhoneDialerPage.xaml.cs
│ ├── PreferencesPage.xaml
│ ├── PreferencesPage.xaml.cs
│ ├── SMSPage.xaml
│ ├── SMSPage.xaml.cs
│ ├── ScreenshotPage.xaml
│ ├── ScreenshotPage.xaml.cs
│ ├── SecureStoragePage.xaml
│ ├── SecureStoragePage.xaml.cs
│ ├── SharePage.xaml
│ ├── SharePage.xaml.cs
│ ├── TextToSpeechPage.xaml
│ ├── TextToSpeechPage.xaml.cs
│ ├── UnitConvertersPage.xaml
│ ├── UnitConvertersPage.xaml.cs
│ ├── VibrationPage.xaml
│ ├── VibrationPage.xaml.cs
│ ├── WebAuthenticatorPage.xaml
│ └── WebAuthenticatorPage.xaml.cs
│ └── ViewModel
│ ├── AccelerometerViewModel.cs
│ ├── AppInfoViewModel.cs
│ ├── BarometerViewModel.cs
│ ├── BaseViewModel.cs
│ ├── BatteryViewModel.cs
│ ├── BrowserViewModel.cs
│ ├── ClipboardViewModel.cs
│ ├── ColorConvertersViewModel.cs
│ ├── CompassViewModel.cs
│ ├── ConnectivityViewModel.cs
│ ├── ContactDetailsViewModel.cs
│ ├── ContactsViewModel.cs
│ ├── DeviceInfoViewModel.cs
│ ├── EmailViewModel.cs
│ ├── FilePickerViewModel.cs
│ ├── FileSystemViewModel.cs
│ ├── FlashlightViewModel.cs
│ ├── GeocodingViewModel.cs
│ ├── GeolocationViewModel.cs
│ ├── GyroscopeViewModel.cs
│ ├── HapticFeedbackViewModel.cs
│ ├── HomeViewModel.cs
│ ├── KeepScreenOnViewModel.cs
│ ├── LauncherViewModel.cs
│ ├── MagnetometerViewModel.cs
│ ├── MapsViewModel.cs
│ ├── MediaPickerViewModel.cs
│ ├── ObservableObject.cs
│ ├── OrientationSensorViewModel.cs
│ ├── PermissionsViewModel.cs
│ ├── PhoneDialerViewModel.cs
│ ├── PreferencesViewModel.cs
│ ├── ScreenshotViewModel.cs
│ ├── SecureStorageViewModel.cs
│ ├── ShareViewModel.cs
│ ├── SmsViewModel.cs
│ ├── TextToSpeechViewModel.cs
│ ├── UnitConvertersViewModel.cs
│ ├── VibrationViewModel.cs
│ └── WebAuthenticatorViewModel.cs
├── SignList.xml
├── Tests
├── Accelerometer_Tests.cs
├── AppActions_Tests.cs
├── Barometer_Tests.cs
├── Battery_Tests.cs
├── Browser_Tests.cs
├── Clipboard_Tests.cs
├── Color_Tests.cs
├── Compass_Tests.cs
├── Connectivity_Tests.cs
├── Contacts_Tests.cs
├── DeviceDisplay_Tests.cs
├── Email_Tests.cs
├── FilePicker_Tests.cs
├── FileSystem_Tests.cs
├── Geocoding_Tests.cs
├── Gyroscope_Tests.cs
├── Launcher_Tests.cs
├── Magnetometer_Tests.cs
├── Maps_Tests.cs
├── OrientationSensor_Tests.cs
├── PhoneDialer_Tests.cs
├── Preferences_Tests.cs
├── SecureStorage_Tests.cs
├── Share_Tests.cs
├── Sms_Tests.cs
├── Tests.csproj
├── TextToSpeech_Tests.cs
├── UnitConverters_Tests.cs
├── Utils.cs
└── Utils_Tests.cs
├── ThirdPartyNotices
├── Xamarin.Essentials.ruleset
├── Xamarin.Essentials.sln
├── Xamarin.Essentials
├── Accelerometer
│ ├── Accelerometer.android.cs
│ ├── Accelerometer.ios.watchos.cs
│ ├── Accelerometer.netstandard.tvos.macos.cs
│ ├── Accelerometer.shared.cs
│ ├── Accelerometer.tizen.cs
│ ├── Accelerometer.uwp.cs
│ └── AccelerometerQueue.shared.cs
├── AppActions
│ ├── AppActions.android.cs
│ ├── AppActions.ios.cs
│ ├── AppActions.netstandard.tvos.watchos.macos.tizen.cs
│ ├── AppActions.shared.cs
│ └── AppActions.uwp.cs
├── AppInfo
│ ├── AppInfo.android.cs
│ ├── AppInfo.ios.tvos.watchos.macos.cs
│ ├── AppInfo.netstandard.cs
│ ├── AppInfo.shared.cs
│ ├── AppInfo.tizen.cs
│ ├── AppInfo.uwp.cs
│ └── AppTheme.shared.cs
├── AssemblyInfo
│ ├── AssemblyInfo.android.cs
│ ├── AssemblyInfo.ios.tvos.watchos.macos.cs
│ └── AssemblyInfo.shared.cs
├── Barometer
│ ├── Barometer.android.cs
│ ├── Barometer.ios.watchos.cs
│ ├── Barometer.netstandard.tvos.macos.cs
│ ├── Barometer.shared.cs
│ ├── Barometer.tizen.cs
│ └── Barometer.uwp.cs
├── Battery
│ ├── Battery.android.cs
│ ├── Battery.ios.watchos.cs
│ ├── Battery.macos.cs
│ ├── Battery.netstandard.tvos.cs
│ ├── Battery.shared.cs
│ ├── Battery.tizen.cs
│ └── Battery.uwp.cs
├── Browser
│ ├── Browser.android.cs
│ ├── Browser.ios.cs
│ ├── Browser.macos.cs
│ ├── Browser.netstandard.tvos.watchos.cs
│ ├── Browser.shared.cs
│ ├── Browser.tizen.cs
│ ├── Browser.uwp.cs
│ ├── BrowserLaunchMode.shared.cs
│ ├── BrowserLaunchOptions.shared.cs
│ └── BrowserTitleMode.shared.cs
├── Clipboard
│ ├── Clipboard.android.cs
│ ├── Clipboard.ios.cs
│ ├── Clipboard.macos.cs
│ ├── Clipboard.netstandard.tvos.watchos.tizen.cs
│ ├── Clipboard.shared.cs
│ └── Clipboard.uwp.cs
├── Compass
│ ├── Compass.android.cs
│ ├── Compass.ios.cs
│ ├── Compass.netstandard.tvos.watchos.macos.cs
│ ├── Compass.shared.cs
│ ├── Compass.tizen.cs
│ ├── Compass.uwp.cs
│ └── LowPassFilter.shared.cs
├── Connectivity
│ ├── Connectivity.android.cs
│ ├── Connectivity.ios.tvos.macos.cs
│ ├── Connectivity.ios.tvos.macos.reachability.cs
│ ├── Connectivity.netstandard.watchos.cs
│ ├── Connectivity.shared.cs
│ ├── Connectivity.shared.enums.cs
│ ├── Connectivity.tizen.cs
│ └── Connectivity.uwp.cs
├── Contacts
│ ├── Contacts.android.cs
│ ├── Contacts.ios.macos.cs
│ ├── Contacts.netstandard.tvos.watchos.cs
│ ├── Contacts.shared.cs
│ ├── Contacts.tizen.cs
│ └── Contacts.uwp.cs
├── DeviceDisplay
│ ├── DeviceDisplay.android.cs
│ ├── DeviceDisplay.ios.cs
│ ├── DeviceDisplay.macos.cs
│ ├── DeviceDisplay.netstandard.tvos.watchos.cs
│ ├── DeviceDisplay.shared.cs
│ ├── DeviceDisplay.tizen.cs
│ └── DeviceDisplay.uwp.cs
├── DeviceInfo
│ ├── DeviceInfo.android.cs
│ ├── DeviceInfo.ios.tvos.watchos.cs
│ ├── DeviceInfo.macos.cs
│ ├── DeviceInfo.netstandard.cs
│ ├── DeviceInfo.shared.cs
│ ├── DeviceInfo.tizen.cs
│ └── DeviceInfo.uwp.cs
├── Email
│ ├── Email.android.cs
│ ├── Email.ios.cs
│ ├── Email.macos.cs
│ ├── Email.netstandard.tvos.watchos.cs
│ ├── Email.shared.cs
│ ├── Email.tizen.cs
│ └── Email.uwp.cs
├── FilePicker
│ ├── FilePicker.android.cs
│ ├── FilePicker.ios.cs
│ ├── FilePicker.macos.cs
│ ├── FilePicker.netstandard.watchos.tvos.cs
│ ├── FilePicker.shared.cs
│ ├── FilePicker.tizen.cs
│ └── FilePicker.uwp.cs
├── FileSystem
│ ├── FileSystem.android.cs
│ ├── FileSystem.ios.cs
│ ├── FileSystem.ios.tvos.watchos.macos.cs
│ ├── FileSystem.netstandard.cs
│ ├── FileSystem.shared.cs
│ ├── FileSystem.tizen.cs
│ └── FileSystem.uwp.cs
├── Flashlight
│ ├── Flashlight.android.cs
│ ├── Flashlight.ios.cs
│ ├── Flashlight.netstandard.tvos.watchos.macos.cs
│ ├── Flashlight.shared.cs
│ ├── Flashlight.tizen.cs
│ └── Flashlight.uwp.cs
├── Geocoding
│ ├── Geocoding.android.cs
│ ├── Geocoding.ios.tvos.watchos.macos.cs
│ ├── Geocoding.netstandard.cs
│ ├── Geocoding.shared.cs
│ ├── Geocoding.tizen.cs
│ └── Geocoding.uwp.cs
├── Geolocation
│ ├── Geolocation.android.cs
│ ├── Geolocation.ios.macos.cs
│ ├── Geolocation.netstandard.tvos.watchos.cs
│ ├── Geolocation.shared.cs
│ ├── Geolocation.tizen.cs
│ ├── Geolocation.uwp.cs
│ ├── GeolocationRequest.ios.macos.cs
│ ├── GeolocationRequest.shared.cs
│ └── GeolocationRequest.uwp.cs
├── GlobalSuppressions.shared.cs
├── Gyroscope
│ ├── Gyroscope.android.cs
│ ├── Gyroscope.ios.watchos.cs
│ ├── Gyroscope.netstandard.tvos.macos.cs
│ ├── Gyroscope.shared.cs
│ ├── Gyroscope.tizen.cs
│ └── Gyroscope.uwp.cs
├── HapticFeedback
│ ├── HapticFeedback.android.cs
│ ├── HapticFeedback.ios.cs
│ ├── HapticFeedback.macos.cs
│ ├── HapticFeedback.netstandard.tvos.watchos.cs
│ ├── HapticFeedback.shared.cs
│ ├── HapticFeedback.tizen.cs
│ ├── HapticFeedback.uwp.cs
│ └── HapticFeedbackType.shared.cs
├── Launcher
│ ├── Launcher.android.cs
│ ├── Launcher.ios.tvos.cs
│ ├── Launcher.macos.cs
│ ├── Launcher.netstandard.watchos.cs
│ ├── Launcher.shared.cs
│ ├── Launcher.tizen.cs
│ └── Launcher.uwp.cs
├── Magnetometer
│ ├── Magnetometer.android.cs
│ ├── Magnetometer.ios.watchos.cs
│ ├── Magnetometer.netstandard.tvos.macos.cs
│ ├── Magnetometer.shared.cs
│ ├── Magnetometer.tizen.cs
│ └── Magnetometer.uwp.cs
├── MainThread
│ ├── MainThread.android.cs
│ ├── MainThread.ios.tvos.watchos.macos.cs
│ ├── MainThread.netstandard.cs
│ ├── MainThread.shared.cs
│ ├── MainThread.tizen.cs
│ ├── MainThread.uwp.cs
│ └── MainThreadExtensions.uwp.cs
├── Map
│ ├── Map.android.cs
│ ├── Map.ios.watchos.macos.cs
│ ├── Map.netstandard.tvos.cs
│ ├── Map.shared.cs
│ ├── Map.tizen.cs
│ ├── Map.uwp.cs
│ ├── MapLaunchOptions.shared.cs
│ └── NavigationMode.shared.cs
├── MediaPicker
│ ├── MediaPicker.android.cs
│ ├── MediaPicker.ios.cs
│ ├── MediaPicker.macos.cs
│ ├── MediaPicker.netstandard.watchos.tvos.cs
│ ├── MediaPicker.shared.cs
│ ├── MediaPicker.tizen.cs
│ └── MediaPicker.uwp.cs
├── OrientationSensor
│ ├── OrientationSensor.android.cs
│ ├── OrientationSensor.ios.watchos.cs
│ ├── OrientationSensor.netstandard.tvos.macos.cs
│ ├── OrientationSensor.shared.cs
│ ├── OrientationSensor.tizen.cs
│ └── OrientationSensor.uwp.cs
├── Permissions
│ ├── Permissions.android.cs
│ ├── Permissions.ios.cs
│ ├── Permissions.ios.tvos.cs
│ ├── Permissions.ios.tvos.watchos.cs
│ ├── Permissions.ios.watchos.cs
│ ├── Permissions.macos.cs
│ ├── Permissions.netstandard.cs
│ ├── Permissions.shared.cs
│ ├── Permissions.shared.enums.cs
│ ├── Permissions.tizen.cs
│ └── Permissions.uwp.cs
├── PhoneDialer
│ ├── PhoneDialer.android.cs
│ ├── PhoneDialer.ios.cs
│ ├── PhoneDialer.macos.cs
│ ├── PhoneDialer.netstandard.tvos.watchos.cs
│ ├── PhoneDialer.shared.cs
│ ├── PhoneDialer.tizen.cs
│ └── PhoneDialer.uwp.cs
├── Platform
│ ├── Platform.android.cs
│ ├── Platform.ios.tvos.watchos.cs
│ ├── Platform.macos.cs
│ ├── Platform.shared.cs
│ ├── Platform.tizen.cs
│ └── Platform.uwp.cs
├── Preferences
│ ├── Preferences.android.cs
│ ├── Preferences.ios.tvos.watchos.macos.cs
│ ├── Preferences.netstandard.cs
│ ├── Preferences.shared.cs
│ ├── Preferences.tizen.cs
│ └── Preferences.uwp.cs
├── Resources
│ └── xml
│ │ └── xamarin_essentials_fileprovider_file_paths.xml
├── Screenshot
│ ├── Screenshot.android.cs
│ ├── Screenshot.ios.tvos.cs
│ ├── Screenshot.netstandard.tizen.watchos.macos.cs
│ ├── Screenshot.shared.cs
│ └── Screenshot.uwp.cs
├── SecureStorage
│ ├── SecureStorage.android.cs
│ ├── SecureStorage.ios.tvos.watchos.macos.cs
│ ├── SecureStorage.netstandard.cs
│ ├── SecureStorage.shared.cs
│ ├── SecureStorage.tizen.cs
│ └── SecureStorage.uwp.cs
├── Share
│ ├── Share.android.cs
│ ├── Share.ios.cs
│ ├── Share.macos.cs
│ ├── Share.netstandard.tvos.watchos.cs
│ ├── Share.shared.cs
│ ├── Share.tizen.cs
│ └── Share.uwp.cs
├── Sms
│ ├── Sms.android.cs
│ ├── Sms.ios.cs
│ ├── Sms.macos.cs
│ ├── Sms.netstandard.tvos.watchos.cs
│ ├── Sms.shared.cs
│ ├── Sms.tizen.cs
│ └── Sms.uwp.cs
├── TextToSpeech
│ ├── TextToSpeech.android.cs
│ ├── TextToSpeech.ios.tvos.watchos.cs
│ ├── TextToSpeech.macos.cs
│ ├── TextToSpeech.netstandard.cs
│ ├── TextToSpeech.shared.cs
│ ├── TextToSpeech.tizen.cs
│ ├── TextToSpeech.uwp.cs
│ └── TextToSpeechExtensions.shared.cs
├── Types
│ ├── ColorConverters.shared.cs
│ ├── Contact.shared.cs
│ ├── DeviceIdiom.shared.cs
│ ├── DevicePlatform.shared.cs
│ ├── DisplayInfo.shared.cs
│ ├── DisplayOrientation.shared.cs
│ ├── DisplayRotation.shared.cs
│ ├── ExperimentalFeatures.shared.cs
│ ├── FileProvider.android.cs
│ ├── Location.shared.cs
│ ├── LocationExtensions.android.cs
│ ├── LocationExtensions.ios.tvos.watchos.macos.cs
│ ├── LocationExtensions.shared.cs
│ ├── LocationExtensions.uwp.cs
│ ├── Placemark.shared.cs
│ ├── PlacemarkExtensions.android.cs
│ ├── PlacemarkExtensions.ios.tvos.watchos.macos.cs
│ ├── PlacemarkExtensions.shared.cs
│ ├── PlacemarkExtensions.uwp.cs
│ ├── PlatformExtensions
│ │ ├── ColorExtensions.android.cs
│ │ ├── ColorExtensions.ios.tvos.watchos.cs
│ │ ├── ColorExtensions.macos.cs
│ │ ├── ColorExtensions.shared.cs
│ │ ├── ColorExtensions.tizen.cs
│ │ ├── ColorExtensions.uwp.cs
│ │ ├── PointExtensions.android.cs
│ │ ├── PointExtensions.ios.tvos.watchos.macos.cs
│ │ ├── PointExtensions.tizen.cs
│ │ ├── PointExtensions.uwp.cs
│ │ ├── RectangleExtensions.android.cs
│ │ ├── RectangleExtensions.ios.tvos.watchos.macos.cs
│ │ ├── RectangleExtensions.tizen.cs
│ │ ├── RectangleExtensions.uwp.cs
│ │ ├── SizeExtensions.android.cs
│ │ ├── SizeExtensions.ios.macos.cs
│ │ ├── SizeExtensions.tizen.cs
│ │ └── SizeExtensions.uwp.cs
│ ├── SensorSpeed.android.cs
│ ├── SensorSpeed.ios.tvos.watchos.cs
│ ├── SensorSpeed.shared.cs
│ ├── SensorSpeed.tizen.cs
│ ├── SensorSpeed.uwp.cs
│ ├── Shared
│ │ ├── Exceptions.shared.cs
│ │ ├── PreserveAttribute.shared.cs
│ │ ├── Utils.shared.cs
│ │ └── WebUtils.shared.cs
│ └── UnitConverters.shared.cs
├── VersionTracking
│ └── VersionTracking.shared.cs
├── Vibration
│ ├── Vibration.android.cs
│ ├── Vibration.ios.cs
│ ├── Vibration.netstandard.tvos.watchos.macos.cs
│ ├── Vibration.shared.cs
│ ├── Vibration.tizen.cs
│ └── Vibration.uwp.cs
├── WebAuthenticator
│ ├── AppleSignInAuthenticator.ios.cs
│ ├── AppleSignInAuthenticator.netstandard.android.tvos.watchos.uwp.tizen.macos.cs
│ ├── AppleSignInAuthenticator.shared.cs
│ ├── WebAuthenticator.android.cs
│ ├── WebAuthenticator.ios.tvos.cs
│ ├── WebAuthenticator.macos.cs
│ ├── WebAuthenticator.netstandard.watchos.tizen.cs
│ ├── WebAuthenticator.shared.cs
│ ├── WebAuthenticator.uwp.cs
│ ├── WebAuthenticatorCallbackActivity.android.cs
│ ├── WebAuthenticatorIntermediateActivity.android.cs
│ └── WebAuthenticatorResult.shared.cs
├── Xamarin.Essentials.csproj
└── mdoc.targets
├── android-setup.ps1
├── appcenter-post-clone.sh
├── azure-pipelines.yml
├── build-tools
└── automation
│ └── guardian
│ ├── CredScanSuppressions.json
│ ├── source.gdnsuppress
│ └── tsaoptions-v2.json
├── build.cake
├── docs
├── .gitattributes
├── en
│ ├── FrameworksIndex
│ │ ├── xamarin-essentials-android.xml
│ │ ├── xamarin-essentials-ios.xml
│ │ ├── xamarin-essentials-macos.xml
│ │ ├── xamarin-essentials-tvos.xml
│ │ ├── xamarin-essentials-uwp.xml
│ │ ├── xamarin-essentials-watchos.xml
│ │ └── xamarin-essentials.xml
│ ├── Xamarin.Essentials
│ │ ├── Accelerometer.xml
│ │ ├── AccelerometerChangedEventArgs.xml
│ │ ├── AccelerometerData.xml
│ │ ├── ActivityState.xml
│ │ ├── ActivityStateChangedEventArgs.xml
│ │ ├── AltitudeReferenceSystem.xml
│ │ ├── AppAction.xml
│ │ ├── AppActionEventArgs.xml
│ │ ├── AppActions.xml
│ │ ├── AppInfo.xml
│ │ ├── AppTheme.xml
│ │ ├── AppleSignInAuthenticator+Options.xml
│ │ ├── AppleSignInAuthenticator.xml
│ │ ├── Barometer.xml
│ │ ├── BarometerChangedEventArgs.xml
│ │ ├── BarometerData.xml
│ │ ├── Battery.xml
│ │ ├── BatteryInfoChangedEventArgs.xml
│ │ ├── BatteryPowerSource.xml
│ │ ├── BatteryState.xml
│ │ ├── Browser.xml
│ │ ├── BrowserLaunchFlags.xml
│ │ ├── BrowserLaunchMode.xml
│ │ ├── BrowserLaunchOptions.xml
│ │ ├── BrowserTitleMode.xml
│ │ ├── Clipboard.xml
│ │ ├── ColorConverters.xml
│ │ ├── ColorExtensions.xml
│ │ ├── Compass.xml
│ │ ├── CompassChangedEventArgs.xml
│ │ ├── CompassData.xml
│ │ ├── ConnectionProfile.xml
│ │ ├── Connectivity.xml
│ │ ├── ConnectivityChangedEventArgs.xml
│ │ ├── Contact.xml
│ │ ├── ContactEmail.xml
│ │ ├── ContactPhone.xml
│ │ ├── Contacts.xml
│ │ ├── DeviceDisplay.xml
│ │ ├── DeviceIdiom.xml
│ │ ├── DeviceInfo.xml
│ │ ├── DevicePlatform.xml
│ │ ├── DeviceType.xml
│ │ ├── DisplayInfo.xml
│ │ ├── DisplayInfoChangedEventArgs.xml
│ │ ├── DisplayOrientation.xml
│ │ ├── DisplayRotation.xml
│ │ ├── DistanceUnits.xml
│ │ ├── Email.xml
│ │ ├── EmailAttachment.xml
│ │ ├── EmailBodyFormat.xml
│ │ ├── EmailMessage.xml
│ │ ├── EnergySaverStatus.xml
│ │ ├── EnergySaverStatusChangedEventArgs.xml
│ │ ├── ExperimentalFeatures.xml
│ │ ├── FeatureNotEnabledException.xml
│ │ ├── FeatureNotSupportedException.xml
│ │ ├── FileBase.xml
│ │ ├── FilePicker.xml
│ │ ├── FilePickerFileType.xml
│ │ ├── FileProvider.xml
│ │ ├── FileProviderLocation.xml
│ │ ├── FileResult.xml
│ │ ├── FileSystem.xml
│ │ ├── Flashlight.xml
│ │ ├── Geocoding.xml
│ │ ├── Geolocation.xml
│ │ ├── GeolocationAccuracy.xml
│ │ ├── GeolocationRequest.xml
│ │ ├── Gyroscope.xml
│ │ ├── GyroscopeChangedEventArgs.xml
│ │ ├── GyroscopeData.xml
│ │ ├── HapticFeedback.xml
│ │ ├── HapticFeedbackType.xml
│ │ ├── Launcher.xml
│ │ ├── Locale.xml
│ │ ├── Location.xml
│ │ ├── LocationExtensions.xml
│ │ ├── Magnetometer.xml
│ │ ├── MagnetometerChangedEventArgs.xml
│ │ ├── MagnetometerData.xml
│ │ ├── MainThread.xml
│ │ ├── Map.xml
│ │ ├── MapLaunchOptions.xml
│ │ ├── MediaPicker.xml
│ │ ├── MediaPickerOptions.xml
│ │ ├── NavigationMode.xml
│ │ ├── NetworkAccess.xml
│ │ ├── NotImplementedInReferenceAssemblyException.xml
│ │ ├── OpenFileRequest.xml
│ │ ├── OrientationSensor.xml
│ │ ├── OrientationSensorChangedEventArgs.xml
│ │ ├── OrientationSensorData.xml
│ │ ├── PermissionException.xml
│ │ ├── PermissionStatus.xml
│ │ ├── Permissions+BasePermission.xml
│ │ ├── Permissions+BasePlatformPermission.xml
│ │ ├── Permissions+Battery.xml
│ │ ├── Permissions+CalendarRead.xml
│ │ ├── Permissions+CalendarWrite.xml
│ │ ├── Permissions+Camera.xml
│ │ ├── Permissions+ContactsRead.xml
│ │ ├── Permissions+ContactsWrite.xml
│ │ ├── Permissions+EventPermissions.xml
│ │ ├── Permissions+Flashlight.xml
│ │ ├── Permissions+LaunchApp.xml
│ │ ├── Permissions+LocationAlways.xml
│ │ ├── Permissions+LocationWhenInUse.xml
│ │ ├── Permissions+Maps.xml
│ │ ├── Permissions+Media.xml
│ │ ├── Permissions+Microphone.xml
│ │ ├── Permissions+NetworkState.xml
│ │ ├── Permissions+Phone.xml
│ │ ├── Permissions+Photos.xml
│ │ ├── Permissions+Reminders.xml
│ │ ├── Permissions+Sensors.xml
│ │ ├── Permissions+Sms.xml
│ │ ├── Permissions+Speech.xml
│ │ ├── Permissions+StorageRead.xml
│ │ ├── Permissions+StorageWrite.xml
│ │ ├── Permissions+Vibrate.xml
│ │ ├── Permissions.xml
│ │ ├── PhoneDialer.xml
│ │ ├── PickOptions.xml
│ │ ├── Placemark.xml
│ │ ├── PlacemarkExtensions.xml
│ │ ├── Platform+Intent.xml
│ │ ├── Platform.xml
│ │ ├── PointExtensions.xml
│ │ ├── Preferences.xml
│ │ ├── ReadOnlyFile.xml
│ │ ├── RectangleExtensions.xml
│ │ ├── Screenshot.xml
│ │ ├── ScreenshotFormat.xml
│ │ ├── ScreenshotResult.xml
│ │ ├── SecureStorage.xml
│ │ ├── SensorSpeed.xml
│ │ ├── Share.xml
│ │ ├── ShareFile.xml
│ │ ├── ShareFileRequest.xml
│ │ ├── ShareMultipleFilesRequest.xml
│ │ ├── ShareRequestBase.xml
│ │ ├── ShareTextRequest.xml
│ │ ├── SizeExtensions.xml
│ │ ├── Sms.xml
│ │ ├── SmsMessage.xml
│ │ ├── SpeechOptions.xml
│ │ ├── TextToSpeech.xml
│ │ ├── UnitConverters.xml
│ │ ├── VersionTracking.xml
│ │ ├── Vibration.xml
│ │ ├── WebAuthenticator.xml
│ │ ├── WebAuthenticatorCallbackActivity.xml
│ │ └── WebAuthenticatorResult.xml
│ ├── breadcrumb
│ │ └── toc.yml
│ ├── docfx.json
│ ├── index.xml
│ ├── ns-Xamarin.Essentials.xml
│ └── xml
│ │ └── _filter.xml
└── frameworks.xml
├── nugetreadme.txt
└── stylecop.json
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Bug report best practices: [Submitting Issues](https://github.com/xamarin/Essentials/blob/main/SUBMITTING-ISSUES.md)
2 |
3 | ### Description
4 |
5 | ### Steps to Reproduce
6 |
7 | 1.
8 | 2.
9 | 3.
10 |
11 | ### Expected Behavior
12 |
13 | ### Actual Behavior
14 |
15 | ### Basic Information
16 |
17 | - Version with issue:
18 | - Last known good version:
19 | - IDE:
20 | - Platform Target Frameworks:
21 | - iOS:
22 | - Android:
23 | - UWP:
24 | - Android Support Library Version:
25 | - Nuget Packages:
26 | - Affected Devices:
27 |
28 | ### Screenshots
29 |
30 |
31 |
32 | ### Reproduction Link
33 |
34 |
35 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for Essentials
4 | title: "[Enhancement] YOUR IDEA!"
5 | labels: feature-request
6 | assignees: ''
7 |
8 | ---
9 | We are no longer accepting new feature request for Xamarin.Essentials. Please make your new feature requests in the .NET MAUI repo which contains .NET MAUI Essentials at https://github.com/dotnet/maui.
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/new-api-spec.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: New API Spec
3 | about: An official specification for new APIS
4 | title: "[Spec] "
5 | labels: "feature-request"
6 | assignees: ''
7 |
8 | ---
9 |
10 | # [The feature]
11 |
12 | Provide a concise description of the feature and the motivation for adding it to Xamarin.Essentials
13 |
14 | # API
15 |
16 | ## [ class ]
17 |
18 | ### Properties
19 |
20 | | API | Description |
21 | | ------------- | ------------- |
22 | | [name] | Gets or sets [description]. |
23 |
24 | ### Events
25 |
26 | | API | Description |
27 | | ------------- | ------------- |
28 | | [name] | [API documentation/description] |
29 |
30 | # Scenarios
31 |
32 | # Platform Compatibility
33 | - Target Frameworks:
34 | - iOS:
35 | - Android:
36 | - UWP:
37 | # Backward Compatibility
38 |
39 | # Difficulty : [low/medium/high]
--------------------------------------------------------------------------------
/.openpublishing.build.ps1:
--------------------------------------------------------------------------------
1 | param(
2 | [string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
3 | [string]$parameters
4 | )
5 | # Main
6 | $errorActionPreference = 'Stop'
7 |
8 | # Step-1: Download buildcore script to local
9 | echo "download build core script to local with source url: $buildCorePowershellUrl"
10 | $repositoryRoot = Split-Path -Parent $MyInvocation.MyCommand.Definition
11 | $buildCorePowershellDestination = "$repositoryRoot\.openpublishing.buildcore.ps1"
12 | Invoke-WebRequest $buildCorePowershellUrl -OutFile "$buildCorePowershellDestination"
13 |
14 | # Step-2: Run build core
15 | echo "run build core script with parameters: $parameters"
16 | & "$buildCorePowershellDestination" "$parameters"
17 | exit $LASTEXITCODE
18 |
--------------------------------------------------------------------------------
/Assets/xamarin.essentials.icon.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Assets/xamarin.essentials.icon.sketch
--------------------------------------------------------------------------------
/Assets/xamarin.essentials_128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Assets/xamarin.essentials_128x128.png
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
4 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Assets/AppBundleFile.txt:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Assets/AppBundleFile_NoExtension:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Assets/Folder/AppBundleFile_Nested.txt:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tests
4 |
5 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Android/Resources/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3498DB
4 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Shared/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsAndroid")]
4 | [assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsUWP")]
5 | [assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsiOS")]
6 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Shared/Connectivity_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace DeviceTests
6 | {
7 | public class Connectivity_Tests
8 | {
9 | [Fact]
10 | public void Network_Access() =>
11 | Assert.Equal(NetworkAccess.Internet, Connectivity.NetworkAccess);
12 |
13 | [Fact]
14 | public void Connection_Profiles() =>
15 | Assert.True(Connectivity.ConnectionProfiles.Count() > 0);
16 |
17 | [Fact]
18 | public void Distict_Connection_Profiles()
19 | {
20 | var profiles = Connectivity.ConnectionProfiles;
21 | Assert.Equal(profiles.Count(), profiles.Distinct().Count());
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Shared/Contacts_Tests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 | using Xamarin.Essentials;
5 | using Xunit;
6 |
7 | namespace DeviceTests.Shared
8 | {
9 | public class Contacts_Tests
10 | {
11 | [Fact]
12 | [Trait(Traits.InteractionType, Traits.InteractionTypes.Human)]
13 | public async Task GetAll()
14 | {
15 | await MainThread.InvokeOnMainThreadAsync(async () =>
16 | {
17 | await Permissions.RequestAsync();
18 | });
19 |
20 | var list = new List();
21 | var contacts = await Xamarin.Essentials.Contacts.GetAllAsync();
22 |
23 | foreach (var contact in contacts)
24 | list?.Add(contact);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Shared/HapticFeedback_Tests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace DeviceTests
6 | {
7 | public class HapticFeedback_Tests
8 | {
9 | [Fact]
10 | public void Click() => HapticFeedback.Perform(HapticFeedbackType.Click);
11 |
12 | [Fact]
13 | public void LongPress() => HapticFeedback.Perform(HapticFeedbackType.LongPress);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Shared/MainThread_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace DeviceTests
6 | {
7 | public class MainThread_Tests
8 | {
9 | [Fact]
10 | public Task IsOnMainThread()
11 | {
12 | return Utils.OnMainThread(() =>
13 | {
14 | Assert.True(MainThread.IsMainThread);
15 | });
16 | }
17 |
18 | [Fact]
19 | public Task IsNotOnMainThread()
20 | {
21 | return Task.Run(() =>
22 | {
23 | Assert.False(MainThread.IsMainThread);
24 | });
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.Shared/PhoneDialer_Tests.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 | using Xunit;
3 |
4 | namespace DeviceTests
5 | {
6 | public class PhoneDialer_Tests
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/AppBundleFile.txt:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/AppBundleFile_NoExtension:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-100.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-125.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-150.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/LockScreenLogo.scale-400.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.UWP/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.UWP/Folder/AppBundleFile_Nested.txt:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using Foundation;
3 | using UIKit;
4 |
5 | namespace DeviceTests.iOS
6 | {
7 | [Register(nameof(AppDelegate))]
8 | public partial class AppDelegate : Xunit.Runner.RunnerAppDelegate
9 | {
10 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
11 | {
12 | // We need this to ensure the execution assembly is part of the app bundle
13 | AddExecutionAssembly(typeof(Battery_Tests).Assembly);
14 |
15 | // tests can be inside the main assembly
16 | AddTestAssembly(Assembly.GetExecutingAssembly());
17 |
18 | AddTestAssembly(typeof(Battery_Tests).Assembly);
19 |
20 | return base.FinishedLaunching(app, options);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | keychain-access-groups
6 |
7 | $(AppIdentifierPrefix)$(CFBundleIdentifier)
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "iOS is what we want.", Scope = "namespace", Target = "~N:DeviceTests.iOS")]
7 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UIKit;
3 |
4 | namespace DeviceTests.iOS
5 | {
6 | public class Application
7 | {
8 | static void Main(string[] args)
9 | {
10 | if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ci-run")))
11 | UIApplication.Main(args, null, typeof(TestApplicationDelegate));
12 | else
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/AppBundleFile.txt:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/AppBundleFile_NoExtension:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Folder/AppBundleFile_Nested.txt:
--------------------------------------------------------------------------------
1 | This file was in the app bundle.
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-60.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-60@2x.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-60@3x.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-76.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-76@2x.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-76@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-76@3x.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-Small-40.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/DeviceTests/DeviceTests.iOS/Resources/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/DeviceTests/DeviceTests.iOS/Resources/Icon-Small@3x.png
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 8.0
6 |
7 |
8 |
9 | $(MSBuildThisFileDirectory)Xamarin.Essentials.ruleset
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PRODUCT-FEEDBACK.md:
--------------------------------------------------------------------------------
1 | # Xamarin.Essentials Feedback
2 |
3 | We'd love to hear your thoughts on Xamarin.Essentials. Here are a few links to help get you to the right place:
4 |
5 | ### Setup and Common Questions
6 | * Read through our full [Getting Started with Xamarin.Essetials Guide](https://learn.microsoft.com/xamarin/essentials/get-started)
7 | * [Frequently Asked Questions on our Wiki](https://github.com/xamarin/Essentials/wiki/FAQ-%7C-Essentials)
8 |
9 | ### Propose a Feature
10 | * Read our [short guide](https://github.com/xamarin/Essentials/wiki/Proposing-New-Features) and then [file an issue](https://github.com/xamarin/Essentials/issues/new)
11 |
12 | ### Report an Issue
13 | * Browse through [current open and closed issues first](https://github.com/xamarin/Essentials/issues?utf8=%E2%9C%93&q=is%3Aissue)
14 | * [File an issue](https://github.com/xamarin/Essentials/issues/new) if it hasn't been reported
15 |
--------------------------------------------------------------------------------
/Samples/Sample.Server.WebAuthenticator/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.Hosting;
8 | using Microsoft.Extensions.Logging;
9 |
10 | namespace Sample.Server.WebAuthenticator
11 | {
12 | public class Program
13 | {
14 | public static void Main(string[] args)
15 | {
16 | CreateHostBuilder(args).Build().Run();
17 | }
18 |
19 | public static IHostBuilder CreateHostBuilder(string[] args) =>
20 | Host.CreateDefaultBuilder(args)
21 | .ConfigureWebHostDefaults(webBuilder =>
22 | {
23 | webBuilder.UseStartup();
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Samples/Sample.Server.WebAuthenticator/Sample.Server.WebAuthenticator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Samples/Sample.Server.WebAuthenticator/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Assets/FileSystemTemplate.txt:
--------------------------------------------------------------------------------
1 | This file was loaded from the app package.
2 |
3 | You can use this as a starting point for your comments...
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-hdpi/app_info_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-hdpi/app_info_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-hdpi/battery_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-hdpi/battery_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-xhdpi/app_info_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-xhdpi/app_info_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-xhdpi/battery_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-xhdpi/battery_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-xxhdpi/app_info_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-xxhdpi/app_info_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-xxhdpi/battery_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-xxhdpi/battery_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable/app_info_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable/app_info_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable/battery_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable/battery_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Xamarin.Essentials
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3498DB
4 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/Resources/xml/my_backup_rules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Android/appcenter-post-clone.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | echo "Variables:"
4 |
5 | # Updating manifest
6 | sed -i '' "s/AC_ANDROID/$AC_ANDROID/g" $BUILD_REPOSITORY_LOCALPATH/Samples/Samples/Helpers/CommonConstants.cs
7 |
8 | echo "Manifest updated!"
--------------------------------------------------------------------------------
/Samples/Samples.Android/proguard.cfg:
--------------------------------------------------------------------------------
1 | # This is Xamarin-specific (and enhanced) configuration.
2 |
3 | -ignorewarnings
4 |
5 | -dontwarn android.support.**
6 |
7 | -keep public class android.support.v7.widget.** { *; }
8 |
9 | -keep public class androidx.appcompat.widget.FitWindowsFrameLayout
10 |
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Mac/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Main.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 |
3 | namespace Samples.Mac
4 | {
5 | static class MainClass
6 | {
7 | static void Main(string[] args)
8 | {
9 | NSApplication.Init();
10 | NSApplication.SharedApplication.Delegate = new AppDelegate();
11 | NSApplication.Main(args);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Samples/Samples.Mac/Resources/FileSystemTemplate.txt:
--------------------------------------------------------------------------------
1 | This file was loaded from the app package.
2 |
3 | You can use this as a starting point for your comments...
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Tizen/CustomViewCellRenderer.cs:
--------------------------------------------------------------------------------
1 | using ElmSharp;
2 | using Samples.Tizen;
3 | using Xamarin.Forms;
4 | using Xamarin.Forms.Platform.Tizen;
5 |
6 | [assembly: ExportCell(typeof(ViewCell), typeof(CustomViewCellRenderer))]
7 |
8 | namespace Samples.Tizen
9 | {
10 | public sealed class CustomViewCellRenderer : ViewCellRenderer
11 | {
12 | protected override EvasObject OnGetContent(Cell cell, string part)
13 | {
14 | var view = base.OnGetContent(cell, part);
15 | view.PropagateEvents = true;
16 | return view;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Samples/Samples.Tizen/Program.cs:
--------------------------------------------------------------------------------
1 | using Tizen.NET.MaterialComponents;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Platform.Tizen;
4 |
5 | namespace Samples.Tizen
6 | {
7 | class Program : FormsApplication
8 | {
9 | static App formsApp;
10 |
11 | protected override void OnCreate()
12 | {
13 | base.OnCreate();
14 |
15 | MaterialComponents.Init(DirectoryInfo.Resource);
16 | Xamarin.Essentials.Platform.Init(MainWindow);
17 | LoadApplication(formsApp ??= new App());
18 | }
19 |
20 | static void Main(string[] args)
21 | {
22 | var app = new Program();
23 | Forms.Init(app);
24 | FormsMaterial.Init();
25 | Xamarin.Essentials.Platform.MapServiceToken = "MAP_SERVICE_KEY";
26 | app.Run(args);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Samples/Samples.Tizen/Samples.Tizen.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | tizen40
6 | 4.0.0
7 | portable
8 |
9 |
10 |
11 | true
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Samples/Samples.Tizen/res/FileSystemTemplate.txt:
--------------------------------------------------------------------------------
1 | This file was loaded from the app package.
2 |
3 | You can use this as a starting point for your comments...
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.Tizen/shared/res/Samples.Tizen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.Tizen/shared/res/Samples.Tizen.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/LockScreenLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/LockScreenLogo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/LockScreenLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/LockScreenLogo.scale-125.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/LockScreenLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/LockScreenLogo.scale-150.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/LockScreenLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/LockScreenLogo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/app_info_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/app_info_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/Assets/battery_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.UWP/Assets/battery_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.UWP/FileSystemTemplate.txt:
--------------------------------------------------------------------------------
1 | This file was loaded from the app package.
2 |
3 | You can use this as a starting point for your comments...
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
--------------------------------------------------------------------------------
/Samples/Samples.UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 |
3 | namespace Samples.UWP
4 | {
5 | public sealed partial class MainPage : Xamarin.Forms.Platform.UWP.WindowsPage
6 | {
7 | static Samples.App formsApp;
8 |
9 | public MainPage()
10 | {
11 | InitializeComponent();
12 |
13 | Platform.MapServiceToken = "RJHqIE53Onrqons5CNOx~FrDr3XhjDTyEXEjng-CRoA~Aj69MhNManYUKxo6QcwZ0wmXBtyva0zwuHB04rFYAPf7qqGJ5cHb03RCDw1jIW8l";
14 |
15 | LoadApplication(formsApp ??= new Samples.App());
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-1024.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-167.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-60.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-76.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/app_info_action_icon.imageset/app_info_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/app_info_action_icon.imageset/app_info_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/app_info_action_icon.imageset/app_info_action_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/app_info_action_icon.imageset/app_info_action_icon@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/app_info_action_icon.imageset/app_info_action_icon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/app_info_action_icon.imageset/app_info_action_icon@3x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/battery_action_icon.imageset/battery_action_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/battery_action_icon.imageset/battery_action_icon.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/battery_action_icon.imageset/battery_action_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/battery_action_icon.imageset/battery_action_icon@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Assets.xcassets/battery_action_icon.imageset/battery_action_icon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Assets.xcassets/battery_action_icon.imageset/battery_action_icon@3x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | keychain-access-groups
6 |
7 | $(AppIdentifierPrefix)$(CFBundleIdentifier)
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Samples.iOS/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "iOS is what we want.", Scope = "namespace", Target = "~N:Samples.iOS")]
7 |
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Samples.iOS
4 | {
5 | public class Application
6 | {
7 | static void Main(string[] args)
8 | {
9 | UIApplication.Main(args, null, typeof(AppDelegate));
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Resources/FileSystemTemplate.txt:
--------------------------------------------------------------------------------
1 | This file was loaded from the app package.
2 |
3 | You can use this as a starting point for your comments...
4 |
5 |
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Resources/app_info_action_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Resources/app_info_action_icon@2x.png
--------------------------------------------------------------------------------
/Samples/Samples.iOS/Resources/battery_action_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/Essentials/40d4041b083687fb52337c61fea86b30bd351a55/Samples/Samples.iOS/Resources/battery_action_icon@2x.png
--------------------------------------------------------------------------------
/Samples/Samples/Converters/NegativeConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using Xamarin.Forms;
4 |
5 | namespace Samples.Converters
6 | {
7 | public class NegativeConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10 | {
11 | if (value is bool v)
12 | return !v;
13 | else
14 | return false;
15 | }
16 |
17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | if (value is bool v)
20 | return !v;
21 | else
22 | return true;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Samples/Samples/Helpers/CommonConstants.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Samples.Helpers
6 | {
7 | public static class CommonConstants
8 | {
9 | internal const string AppCenterAndroid = "AC_ANDROID";
10 | internal const string AppCenteriOS = "AC_IOS";
11 | internal const string AppCenterUWP = "AC_UWP";
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Samples/Samples/Model/SampleItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Samples.Model
4 | {
5 | public class SampleItem
6 | {
7 | public SampleItem(string icon, string name, Type pageType, string description, params string[] tags)
8 | {
9 | Icon = icon;
10 | Name = name;
11 | Description = description;
12 | PageType = pageType;
13 | Tags = tags ?? new string[0];
14 | }
15 |
16 | public string Icon { get; }
17 |
18 | public string Name { get; }
19 |
20 | public string Description { get; }
21 |
22 | public Type PageType { get; }
23 |
24 | public string[] Tags { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Samples/Samples/View/AccelerometerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class AccelerometerPage : BasePage
4 | {
5 | public AccelerometerPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/AppInfoPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class AppInfoPage : BasePage
4 | {
5 | public AppInfoPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/BarometerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms;
2 | using Xamarin.Forms.Xaml;
3 |
4 | namespace Samples.View
5 | {
6 | public partial class BarometerPage : BasePage
7 | {
8 | public BarometerPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Samples/Samples/View/BatteryPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class BatteryPage : BasePage
4 | {
5 | public BatteryPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/BrowserPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class BrowserPage : BasePage
4 | {
5 | public BrowserPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/ClipboardPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class ClipboardPage : BasePage
4 | {
5 | public ClipboardPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/ColorConvertersPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class ColorConvertersPage : BasePage
4 | {
5 | public ColorConvertersPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/CompassPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class CompassPage : BasePage
4 | {
5 | public CompassPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/ConnectivityPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class ConnectivityPage : BasePage
4 | {
5 | public ConnectivityPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/ContactDetailsPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class ContactDetailsPage
4 | {
5 | public ContactDetailsPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/ContactsPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class ContactsPage
4 | {
5 | public ContactsPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/DeviceInfoPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class DeviceInfoPage : BasePage
4 | {
5 | public DeviceInfoPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/EmailPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class EmailPage : BasePage
4 | {
5 | public EmailPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/FilePickerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class FilePickerPage : BasePage
4 | {
5 | public FilePickerPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/FileSystemPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class FileSystemPage : BasePage
4 | {
5 | public FileSystemPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/FlashlightPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class FlashlightPage : BasePage
4 | {
5 | public FlashlightPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/GeocodingPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class GeocodingPage : BasePage
4 | {
5 | public GeocodingPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/GeolocationPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class GeolocationPage : BasePage
4 | {
5 | public GeolocationPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/GyroscopePage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class GyroscopePage : BasePage
4 | {
5 | public GyroscopePage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/HapticFeedbackPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class HapticFeedbackPage : BasePage
4 | {
5 | public HapticFeedbackPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/HomePage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Samples.Model;
3 | using Xamarin.Forms;
4 |
5 | namespace Samples.View
6 | {
7 | public partial class HomePage : BasePage
8 | {
9 | public HomePage()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | async void OnSampleTapped(object sender, ItemTappedEventArgs e)
15 | {
16 | var item = e.Item as SampleItem;
17 | if (item == null)
18 | return;
19 |
20 | await Navigation.PushAsync((Page)Activator.CreateInstance(item.PageType));
21 |
22 | // deselect Item
23 | ((ListView)sender).SelectedItem = null;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Samples/Samples/View/KeepScreenOnPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class KeepScreenOnPage : BasePage
4 | {
5 | public KeepScreenOnPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/LauncherPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Xamarin.Forms;
7 | using Xamarin.Forms.Xaml;
8 |
9 | namespace Samples.View
10 | {
11 | public partial class LauncherPage : BasePage
12 | {
13 | public LauncherPage()
14 | {
15 | InitializeComponent();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Samples/Samples/View/MagnetometerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class MagnetometerPage : BasePage
4 | {
5 | public MagnetometerPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/MapsPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms.Xaml;
2 |
3 | namespace Samples.View
4 | {
5 | public partial class MapsPage : BasePage
6 | {
7 | public MapsPage()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Samples/Samples/View/MediaPickerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms.Xaml;
2 |
3 | namespace Samples.View
4 | {
5 | public partial class MediaPickerPage : BasePage
6 | {
7 | public MediaPickerPage()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Samples/Samples/View/OrientationSensorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class OrientationSensorPage : BasePage
4 | {
5 | public OrientationSensorPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/PhoneDialerPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Samples/Samples/View/PhoneDialerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class PhoneDialerPage : BasePage
4 | {
5 | public PhoneDialerPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/PreferencesPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Samples/Samples/View/PreferencesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class PreferencesPage : BasePage
4 | {
5 | public PreferencesPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/SMSPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class SMSPage : BasePage
4 | {
5 | public SMSPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/ScreenshotPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class ScreenshotPage : BasePage
4 | {
5 | public ScreenshotPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/SecureStoragePage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class SecureStoragePage : BasePage
4 | {
5 | public SecureStoragePage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/SharePage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class SharePage : BasePage
4 | {
5 | public SharePage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/TextToSpeechPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 | using Xamarin.Forms;
4 |
5 | namespace Samples.View
6 | {
7 | public partial class TextToSpeechPage : BasePage
8 | {
9 | public TextToSpeechPage()
10 | {
11 | InitializeComponent();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Samples/Samples/View/UnitConvertersPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class UnitConvertersPage : BasePage
4 | {
5 | public UnitConvertersPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/VibrationPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Samples.View
2 | {
3 | public partial class VibrationPage : BasePage
4 | {
5 | public VibrationPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Samples/View/WebAuthenticatorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Xamarin.Forms;
8 | using Xamarin.Forms.Xaml;
9 |
10 | namespace Samples.View
11 | {
12 | public partial class WebAuthenticatorPage : BasePage
13 | {
14 | public WebAuthenticatorPage()
15 | {
16 | InitializeComponent();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Samples/Samples/ViewModel/AppInfoViewModel.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 | using Xamarin.Forms;
3 |
4 | namespace Samples.ViewModel
5 | {
6 | public class AppInfoViewModel : BaseViewModel
7 | {
8 | public string AppPackageName => AppInfo.PackageName;
9 |
10 | public string AppName => AppInfo.Name;
11 |
12 | public string AppVersion => AppInfo.VersionString;
13 |
14 | public string AppBuild => AppInfo.BuildString;
15 |
16 | public string AppTheme => AppInfo.RequestedTheme.ToString();
17 |
18 | public Command ShowSettingsUICommand { get; }
19 |
20 | public AppInfoViewModel()
21 | {
22 | ShowSettingsUICommand = new Command(() => AppInfo.ShowSettingsUI());
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Samples/Samples/ViewModel/ContactDetailsViewModel.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 |
3 | namespace Samples.ViewModel
4 | {
5 | class ContactDetailsViewModel : BaseViewModel
6 | {
7 | public ContactDetailsViewModel(Contact contact)
8 | {
9 | Contact = contact;
10 | }
11 |
12 | public Contact Contact { get; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Samples/Samples/ViewModel/KeepScreenOnViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Input;
2 | using Xamarin.Essentials;
3 | using Xamarin.Forms;
4 |
5 | namespace Samples.ViewModel
6 | {
7 | public class KeepScreenOnViewModel : BaseViewModel
8 | {
9 | public KeepScreenOnViewModel()
10 | {
11 | RequestActiveCommand = new Command(OnRequestActive);
12 | RequestReleaseCommand = new Command(OnRequestRelease);
13 | }
14 |
15 | public bool IsActive => DeviceDisplay.KeepScreenOn;
16 |
17 | public ICommand RequestActiveCommand { get; }
18 |
19 | public ICommand RequestReleaseCommand { get; }
20 |
21 | void OnRequestActive()
22 | {
23 | DeviceDisplay.KeepScreenOn = true;
24 |
25 | OnPropertyChanged(nameof(IsActive));
26 | }
27 |
28 | void OnRequestRelease()
29 | {
30 | DeviceDisplay.KeepScreenOn = false;
31 |
32 | OnPropertyChanged(nameof(IsActive));
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Samples/Samples/ViewModel/PhoneDialerViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 | using Xamarin.Essentials;
4 | using Xamarin.Forms;
5 |
6 | namespace Samples.ViewModel
7 | {
8 | public class PhoneDialerViewModel : BaseViewModel
9 | {
10 | string phoneNumber;
11 |
12 | public PhoneDialerViewModel()
13 | {
14 | OpenPhoneDialerCommand = new Command(OnOpenPhoneDialer);
15 | }
16 |
17 | public ICommand OpenPhoneDialerCommand { get; }
18 |
19 | public string PhoneNumber
20 | {
21 | get => phoneNumber;
22 | set => SetProperty(ref phoneNumber, value);
23 | }
24 |
25 | async void OnOpenPhoneDialer()
26 | {
27 | try
28 | {
29 | PhoneDialer.Open(PhoneNumber);
30 | }
31 | catch (Exception ex)
32 | {
33 | await DisplayAlertAsync($"Dialer is not supported: {ex.Message}");
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Samples/Samples/ViewModel/PreferencesViewModel.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 |
3 | namespace Samples.ViewModel
4 | {
5 | public class PreferencesViewModel : BaseViewModel
6 | {
7 | const string preferenceKey = "PreferenceKey";
8 |
9 | string preferenceValue;
10 |
11 | public PreferencesViewModel()
12 | {
13 | preferenceValue = Preferences.Get(preferenceKey, string.Empty);
14 | }
15 |
16 | public string PreferenceValue
17 | {
18 | get => preferenceValue;
19 | set
20 | {
21 | preferenceValue = value;
22 | Preferences.Set(preferenceKey, value);
23 |
24 | OnPropertyChanged();
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SignList.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Tests/AppActions_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace Tests
6 | {
7 | public class AppActions_Tests
8 | {
9 | [Fact]
10 | public void AppActions_SetActions() =>
11 | Assert.ThrowsAsync(() => AppActions.SetAsync(new List()));
12 |
13 | [Fact]
14 | public void AppActions_GetActions() =>
15 | Assert.ThrowsAsync(() => AppActions.GetAsync());
16 |
17 | [Fact]
18 | public void AppActions_IsSupported() =>
19 | Assert.Throws(() => AppActions.IsSupported);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/Battery_Tests.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 | using Xunit;
3 |
4 | namespace Tests
5 | {
6 | public class Battery_Tests
7 | {
8 | [Fact]
9 | public void Charge_Level_On_NetStandard() =>
10 | Assert.Throws(() => Battery.ChargeLevel);
11 |
12 | [Fact]
13 | public void Charge_State_On_NetStandard() =>
14 | Assert.Throws(() => Battery.State);
15 |
16 | [Fact]
17 | public void Charge_Power_Source_On_NetStandard() =>
18 | Assert.Throws(() => Battery.PowerSource);
19 |
20 | [Fact]
21 | public void Battery_Changed_Event_On_NetStandard() =>
22 | Assert.Throws(() => Battery.BatteryInfoChanged += Battery_BatteryInfoChanged);
23 |
24 | void Battery_BatteryInfoChanged(object sender, BatteryInfoChangedEventArgs e)
25 | {
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Tests/Clipboard_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace Tests
6 | {
7 | public class Clipboard_Tests
8 | {
9 | [Fact]
10 | public async Task Clipboard_SetText_Fail_On_NetStandard() =>
11 | await Assert.ThrowsAsync(() => Clipboard.SetTextAsync("Text"));
12 |
13 | [Fact]
14 | public void Clipboard_HasText_Fail_On_NetStandard() =>
15 | Assert.Throws(() => Clipboard.HasText);
16 |
17 | [Fact]
18 | public async Task Clipboard_GetText_Fail_On_NetStandard() =>
19 | await Assert.ThrowsAsync(() => Clipboard.GetTextAsync());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/Connectivity_Tests.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 | using Xunit;
3 |
4 | namespace Tests
5 | {
6 | public class Connectivity_Tests
7 | {
8 | [Fact]
9 | public void Network_Access_On_NetStandard() =>
10 | Assert.Throws(() => Connectivity.NetworkAccess);
11 |
12 | [Fact]
13 | public void ConnectionProfiles_On_NetStandard() =>
14 | Assert.Throws(() => Connectivity.ConnectionProfiles);
15 |
16 | [Fact]
17 | public void Connectivity_Changed_Event_On_NetStandard() =>
18 | Assert.Throws(() => Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged);
19 |
20 | void Connectivity_ConnectivityChanged(object sender, ConnectivityChangedEventArgs e)
21 | {
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Tests/Contacts_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace Tests
6 | {
7 | public class Contacts_Tests
8 | {
9 | [Fact]
10 | public async Task Contacts_GetAll() =>
11 | await Assert.ThrowsAsync(() => Contacts.GetAllAsync());
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/Email_Tests.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 | using Xunit;
3 |
4 | namespace Tests
5 | {
6 | public class Email_Tests
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Tests/FilePicker_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace Tests
6 | {
7 | public class FilePicker_Tests
8 | {
9 | [Fact]
10 | public async Task PickAsync_Fail_On_NetStandard()
11 | {
12 | await Assert.ThrowsAsync(() => FilePicker.PickAsync());
13 | }
14 |
15 | [Fact]
16 | public async Task PickMultipleAsync_Fail_On_NetStandard()
17 | {
18 | await Assert.ThrowsAsync(() => FilePicker.PickMultipleAsync());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/Geocoding_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace Tests
6 | {
7 | public class Geocoding_Tests
8 | {
9 | [Fact]
10 | public async Task Geocoding_Placemarks_Fail_On_NetStandard()
11 | {
12 | await Assert.ThrowsAsync(() => Geocoding.GetPlacemarksAsync(1, 1));
13 | }
14 |
15 | [Fact]
16 | public async Task Geocoding_Placemarks_Location_Fail_On_NetStandard()
17 | {
18 | await Assert.ThrowsAsync(() => Geocoding.GetPlacemarksAsync(new Location(1, 1)));
19 | }
20 |
21 | [Fact]
22 | public async Task Geocoding_Locations_On_NetStandard()
23 | {
24 | await Assert.ThrowsAsync(() => Geocoding.GetLocationsAsync("Microsoft Building 25"));
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/PhoneDialer_Tests.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 | using Xunit;
3 |
4 | namespace Tests
5 | {
6 | public class PhoneDialer_Tests
7 | {
8 | [Fact]
9 | public void Dialer_Open_Fail_On_NetStandard() =>
10 | Assert.Throws(() => PhoneDialer.Open("1234567890"));
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Tests/SecureStorage_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace Tests
6 | {
7 | public class SecureStorage_Tests
8 | {
9 | [Fact]
10 | public async Task SecureStorage_LoadAsync_Fail_On_NetStandard()
11 | {
12 | await Assert.ThrowsAsync(() => SecureStorage.GetAsync("key"));
13 | }
14 |
15 | [Fact]
16 | public async Task SecureStorage_SaveAsync_Fail_On_NetStandard()
17 | {
18 | await Assert.ThrowsAsync(() => SecureStorage.SetAsync("key", "data"));
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/Sms_Tests.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Xamarin.Essentials;
3 | using Xunit;
4 |
5 | namespace Tests
6 | {
7 | public class Sms_Tests
8 | {
9 | [Fact]
10 | public Task Sms_Fail_On_NetStandard() =>
11 | Assert.ThrowsAsync(() => Sms.ComposeAsync());
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Tests/Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 | false
6 | XamarinEssentialsTests
7 | portable
8 | Debug;Release
9 |
10 |
11 |
12 | true
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Tests/Utils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using Xamarin.Essentials;
5 |
6 | namespace Tests
7 | {
8 | public static class TestUtils
9 | {
10 | public static void EnableExperimentalFeatures()
11 | {
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Tests/Utils_Tests.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Essentials;
2 | using Xunit;
3 |
4 | namespace Tests
5 | {
6 | public class Utils_Tests
7 | {
8 | [Theory]
9 | [InlineData("9", "9.0", 9, 0)]
10 | [InlineData("9.0", "9.0", 9, 0)]
11 | public void ParseVersion(string input, string expected, int major, int minor)
12 | {
13 | var version = Utils.ParseVersion(input);
14 | Assert.Equal(expected, version.ToString());
15 | Assert.Equal(major, version.Major);
16 | Assert.Equal(minor, version.Minor);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Accelerometer/Accelerometer.netstandard.tvos.macos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class Accelerometer
4 | {
5 | internal static bool IsSupported =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | static void PlatformStart(SensorSpeed sensorSpeed) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static void PlatformStop() =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Accelerometer/Accelerometer.tizen.cs:
--------------------------------------------------------------------------------
1 | using Tizen.Sensor;
2 | using TizenAccelerometer = Tizen.Sensor.Accelerometer;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Accelerometer
7 | {
8 | internal static TizenAccelerometer DefaultSensor =>
9 | (TizenAccelerometer)Platform.GetDefaultSensor(SensorType.Accelerometer);
10 |
11 | internal static bool IsSupported =>
12 | TizenAccelerometer.IsSupported;
13 |
14 | static void PlatformStart(SensorSpeed sensorSpeed)
15 | {
16 | DefaultSensor.Interval = sensorSpeed.ToPlatform();
17 | DefaultSensor.DataUpdated += DataUpdated;
18 | DefaultSensor.Start();
19 | }
20 |
21 | static void PlatformStop()
22 | {
23 | DefaultSensor.DataUpdated -= DataUpdated;
24 | DefaultSensor.Stop();
25 | }
26 |
27 | static void DataUpdated(object sender, AccelerometerDataUpdatedEventArgs e)
28 | {
29 | OnChanged(new AccelerometerData(e.X, e.Y, e.Z));
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AppActions/AppActions.netstandard.tvos.watchos.macos.tizen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class AppActions
8 | {
9 | internal static bool PlatformIsSupported
10 | => throw ExceptionUtils.NotSupportedOrImplementedException;
11 |
12 | static Task> PlatformGetAsync() =>
13 | throw ExceptionUtils.NotSupportedOrImplementedException;
14 |
15 | static Task PlatformSetAsync(IEnumerable actions) =>
16 | throw ExceptionUtils.NotSupportedOrImplementedException;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AppInfo/AppInfo.netstandard.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class AppInfo
4 | {
5 | static string PlatformGetPackageName() => throw ExceptionUtils.NotSupportedOrImplementedException;
6 |
7 | static string PlatformGetName() => throw ExceptionUtils.NotSupportedOrImplementedException;
8 |
9 | static string PlatformGetVersionString() => throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static string PlatformGetBuild() => throw ExceptionUtils.NotSupportedOrImplementedException;
12 |
13 | static void PlatformShowSettingsUI() => throw ExceptionUtils.NotSupportedOrImplementedException;
14 |
15 | static AppTheme PlatformRequestedTheme() => throw ExceptionUtils.NotSupportedOrImplementedException;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AppInfo/AppInfo.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class AppInfo
6 | {
7 | public static string PackageName => PlatformGetPackageName();
8 |
9 | public static string Name => PlatformGetName();
10 |
11 | public static string VersionString => PlatformGetVersionString();
12 |
13 | public static Version Version => Utils.ParseVersion(VersionString);
14 |
15 | public static string BuildString => PlatformGetBuild();
16 |
17 | public static void ShowSettingsUI() => PlatformShowSettingsUI();
18 |
19 | public static AppTheme RequestedTheme => PlatformRequestedTheme();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AppInfo/AppInfo.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 | using Tizen.Applications;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class AppInfo
7 | {
8 | static string PlatformGetPackageName()
9 | => Application.Current.ApplicationInfo.PackageId;
10 |
11 | static string PlatformGetName()
12 | => Application.Current.ApplicationInfo.Label;
13 |
14 | static string PlatformGetVersionString()
15 | => Platform.CurrentPackage.Version;
16 |
17 | static string PlatformGetBuild()
18 | => Version.Build.ToString(CultureInfo.InvariantCulture);
19 |
20 | static void PlatformShowSettingsUI()
21 | {
22 | Permissions.EnsureDeclared();
23 | AppControl.SendLaunchRequest(new AppControl() { Operation = AppControlOperations.Setting });
24 | }
25 |
26 | static AppTheme PlatformRequestedTheme()
27 | {
28 | return AppTheme.Unspecified;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AppInfo/AppTheme.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum AppTheme
4 | {
5 | Unspecified,
6 | Light,
7 | Dark
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AssemblyInfo/AssemblyInfo.android.cs:
--------------------------------------------------------------------------------
1 | using Android;
2 |
3 | [assembly: LinkerSafe]
4 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AssemblyInfo/AssemblyInfo.ios.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | #pragma warning disable CS0618 // Type or member is obsolete
4 | [assembly: LinkerSafe]
5 | #pragma warning restore CS0618 // Type or member is obsolete
6 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/AssemblyInfo/AssemblyInfo.shared.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly: InternalsVisibleTo("XamarinEssentialsTests")]
4 | [assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsAndroid")]
5 | [assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsUWP")]
6 | [assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsShared")]
7 | [assembly: InternalsVisibleTo("XamarinEssentialsDeviceTestsiOS")]
8 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Barometer/Barometer.netstandard.tvos.macos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class Barometer
4 | {
5 | internal static bool IsSupported =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | internal static void PlatformStart(SensorSpeed sensorSpeed) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | internal static void PlatformStop() =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Barometer/Barometer.tizen.cs:
--------------------------------------------------------------------------------
1 | using Tizen.Sensor;
2 | using TizenBarometerSensor = Tizen.Sensor.PressureSensor;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Barometer
7 | {
8 | static TizenBarometerSensor DefaultSensor
9 | => (TizenBarometerSensor)Platform.GetDefaultSensor(SensorType.Barometer);
10 |
11 | internal static bool IsSupported
12 | => TizenBarometerSensor.IsSupported;
13 |
14 | internal static void PlatformStart(SensorSpeed sensorSpeed)
15 | {
16 | DefaultSensor.Interval = sensorSpeed.ToPlatform();
17 | DefaultSensor.DataUpdated += DataUpdated;
18 | DefaultSensor.Start();
19 | }
20 |
21 | internal static void PlatformStop()
22 | {
23 | DefaultSensor.DataUpdated -= DataUpdated;
24 | DefaultSensor.Stop();
25 | }
26 |
27 | static void DataUpdated(object sender, PressureSensorDataUpdatedEventArgs e)
28 | {
29 | OnChanged(new BarometerData(e.Pressure));
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Browser/Browser.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using AppKit;
4 | using Foundation;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class Browser
9 | {
10 | static Task PlatformOpenAsync(Uri uri, BrowserLaunchOptions options) =>
11 | Task.FromResult(NSWorkspace.SharedWorkspace.OpenUrl(new NSUrl(uri.AbsoluteUri)));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Browser/Browser.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Browser
7 | {
8 | static Task PlatformOpenAsync(Uri uri, BrowserLaunchOptions options) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Browser/Browser.tizen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using Tizen.Applications;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class Browser
9 | {
10 | static Task PlatformOpenAsync(Uri uri, BrowserLaunchOptions launchMode)
11 | {
12 | if (uri == null)
13 | throw new ArgumentNullException(nameof(uri));
14 |
15 | Permissions.EnsureDeclared();
16 |
17 | var appControl = new AppControl
18 | {
19 | Operation = AppControlOperations.View,
20 | Uri = uri.AbsoluteUri
21 | };
22 |
23 | var hasMatches = AppControl.GetMatchedApplicationIds(appControl).Any();
24 |
25 | if (hasMatches)
26 | AppControl.SendLaunchRequest(appControl);
27 |
28 | return Task.FromResult(hasMatches);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Browser/Browser.uwp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Browser
7 | {
8 | static Task PlatformOpenAsync(Uri uri, BrowserLaunchOptions options) =>
9 | Windows.System.Launcher.LaunchUriAsync(uri).AsTask();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Browser/BrowserLaunchMode.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum BrowserLaunchMode
4 | {
5 | SystemPreferred = 0,
6 | External = 1
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Browser/BrowserLaunchOptions.shared.cs:
--------------------------------------------------------------------------------
1 | #if !NETSTANDARD1_0
2 | using System.Drawing;
3 | #endif
4 |
5 | using System;
6 |
7 | namespace Xamarin.Essentials
8 | {
9 | public class BrowserLaunchOptions
10 | {
11 | #if !NETSTANDARD1_0
12 | public Color? PreferredToolbarColor { get; set; }
13 |
14 | public Color? PreferredControlColor { get; set; }
15 | #endif
16 |
17 | public BrowserLaunchMode LaunchMode { get; set; } = BrowserLaunchMode.SystemPreferred;
18 |
19 | public BrowserTitleMode TitleMode { get; set; } = BrowserTitleMode.Default;
20 |
21 | public BrowserLaunchFlags Flags { get; set; } = BrowserLaunchFlags.None;
22 |
23 | internal bool HasFlag(BrowserLaunchFlags flag)
24 | => Flags.HasFlag(flag);
25 | }
26 |
27 | [Flags]
28 | public enum BrowserLaunchFlags
29 | {
30 | None = 0,
31 | LaunchAdjacent = 1,
32 | PresentAsPageSheet = 2,
33 | PresentAsFormSheet = 4
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Browser/BrowserTitleMode.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum BrowserTitleMode
4 | {
5 | Default = 0,
6 | Show = 1,
7 | Hide = 2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Clipboard
6 | {
7 | static Task PlatformSetTextAsync(string text)
8 | => throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static bool PlatformHasText
11 | => throw ExceptionUtils.NotSupportedOrImplementedException;
12 |
13 | static Task PlatformGetTextAsync()
14 | => throw ExceptionUtils.NotSupportedOrImplementedException;
15 |
16 | static void StartClipboardListeners()
17 | => throw ExceptionUtils.NotSupportedOrImplementedException;
18 |
19 | static void StopClipboardListeners()
20 | => throw ExceptionUtils.NotSupportedOrImplementedException;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Compass/Compass.netstandard.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class Compass
4 | {
5 | internal static bool IsSupported =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | internal static void PlatformStart(SensorSpeed sensorSpeed, bool applyLowPassFilter) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | internal static void PlatformStop() =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Compass/Compass.tizen.cs:
--------------------------------------------------------------------------------
1 | using Tizen.Sensor;
2 | using TizenCompass = Tizen.Sensor.OrientationSensor;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Compass
7 | {
8 | internal static TizenCompass DefaultSensor =>
9 | (TizenCompass)Platform.GetDefaultSensor(SensorType.Compass);
10 |
11 | internal static bool IsSupported =>
12 | TizenCompass.IsSupported;
13 |
14 | internal static void PlatformStart(SensorSpeed sensorSpeed, bool applyLowPassFilter)
15 | {
16 | DefaultSensor.Interval = sensorSpeed.ToPlatform();
17 | DefaultSensor.DataUpdated += DataUpdated;
18 | DefaultSensor.Start();
19 | }
20 |
21 | internal static void PlatformStop()
22 | {
23 | DefaultSensor.DataUpdated -= DataUpdated;
24 | DefaultSensor.Stop();
25 | }
26 |
27 | static void DataUpdated(object sender, OrientationSensorDataUpdatedEventArgs e)
28 | {
29 | OnChanged(new CompassData(e.Azimuth));
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Compass/LowPassFilter.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | class LowPassFilter
7 | {
8 | const int length = 10;
9 |
10 | readonly Queue history = new Queue(length);
11 | float sin;
12 | float cos;
13 |
14 | internal void Add(float radians)
15 | {
16 | sin += (float)Math.Sin(radians);
17 |
18 | cos += (float)Math.Cos(radians);
19 |
20 | history.Enqueue(radians);
21 |
22 | if (history.Count > length)
23 | {
24 | var old = history.Dequeue();
25 |
26 | sin -= (float)Math.Sin(old);
27 |
28 | cos -= (float)Math.Cos(old);
29 | }
30 | }
31 |
32 | internal float Average()
33 | {
34 | var size = history.Count;
35 |
36 | return (float)Math.Atan2(sin / size, cos / size);
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Connectivity/Connectivity.netstandard.watchos.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Connectivity
6 | {
7 | static NetworkAccess PlatformNetworkAccess =>
8 | throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static IEnumerable PlatformConnectionProfiles =>
11 | throw ExceptionUtils.NotSupportedOrImplementedException;
12 |
13 | static void StartListeners() =>
14 | throw ExceptionUtils.NotSupportedOrImplementedException;
15 |
16 | static void StopListeners() =>
17 | throw ExceptionUtils.NotSupportedOrImplementedException;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Connectivity/Connectivity.shared.enums.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum ConnectionProfile
4 | {
5 | Unknown = 0,
6 | Bluetooth = 1,
7 | Cellular = 2,
8 | Ethernet = 3,
9 | WiFi = 4
10 | }
11 |
12 | public enum NetworkAccess
13 | {
14 | Unknown = 0,
15 | None = 1,
16 | Local = 2,
17 | ConstrainedInternet = 3,
18 | Internet = 4
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Contacts/Contacts.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class Contacts
8 | {
9 | static Task PlatformPickContactAsync() => throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static Task> PlatformGetAllAsync(CancellationToken cancellationToken) => throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Contacts/Contacts.shared.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class Contacts
8 | {
9 | public static async Task PickContactAsync()
10 | {
11 | // iOS does not require permissions for the picker
12 | if (DeviceInfo.Platform != DevicePlatform.iOS)
13 | await Permissions.EnsureGrantedAsync();
14 |
15 | return await PlatformPickContactAsync();
16 | }
17 |
18 | public static Task> GetAllAsync(CancellationToken cancellationToken = default)
19 | => PlatformGetAllAsync(cancellationToken);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/DeviceDisplay/DeviceDisplay.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class DeviceDisplay
4 | {
5 | static bool PlatformKeepScreenOn
6 | {
7 | get => throw ExceptionUtils.NotSupportedOrImplementedException;
8 | set => throw ExceptionUtils.NotSupportedOrImplementedException;
9 | }
10 |
11 | static DisplayInfo GetMainDisplayInfo() => throw ExceptionUtils.NotSupportedOrImplementedException;
12 |
13 | static void StartScreenMetricsListeners() => throw ExceptionUtils.NotSupportedOrImplementedException;
14 |
15 | static void StopScreenMetricsListeners() => throw ExceptionUtils.NotSupportedOrImplementedException;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/DeviceInfo/DeviceInfo.netstandard.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class DeviceInfo
4 | {
5 | static string GetModel() => throw ExceptionUtils.NotSupportedOrImplementedException;
6 |
7 | static string GetManufacturer() => throw ExceptionUtils.NotSupportedOrImplementedException;
8 |
9 | static string GetDeviceName() => throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static string GetVersionString() => throw ExceptionUtils.NotSupportedOrImplementedException;
12 |
13 | static DevicePlatform GetPlatform() => DevicePlatform.Unknown;
14 |
15 | static DeviceIdiom GetIdiom() => DeviceIdiom.Unknown;
16 |
17 | static DeviceType GetDeviceType() => DeviceType.Unknown;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/DeviceInfo/DeviceInfo.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class DeviceInfo
6 | {
7 | public static string Model => GetModel();
8 |
9 | public static string Manufacturer => GetManufacturer();
10 |
11 | public static string Name => GetDeviceName();
12 |
13 | public static string VersionString => GetVersionString();
14 |
15 | public static Version Version => Utils.ParseVersion(VersionString);
16 |
17 | public static DevicePlatform Platform => GetPlatform();
18 |
19 | public static DeviceIdiom Idiom => GetIdiom();
20 |
21 | public static DeviceType DeviceType => GetDeviceType();
22 | }
23 |
24 | public enum DeviceType
25 | {
26 | Unknown = 0,
27 | Physical = 1,
28 | Virtual = 2
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Email/Email.macos.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using AppKit;
3 | using Foundation;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class Email
8 | {
9 | internal static bool IsComposeSupported =>
10 | MainThread.InvokeOnMainThread(() => NSWorkspace.SharedWorkspace.UrlForApplication(NSUrl.FromString("mailto:")) != null);
11 |
12 | static Task PlatformComposeAsync(EmailMessage message)
13 | {
14 | var url = GetMailToUri(message);
15 |
16 | using var nsurl = NSUrl.FromString(url);
17 | NSWorkspace.SharedWorkspace.OpenUrl(nsurl);
18 | return Task.CompletedTask;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Email/Email.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Email
6 | {
7 | internal static bool IsComposeSupported =>
8 | throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static Task PlatformComposeAsync(EmailMessage message) =>
11 | throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 |
14 | #if NETSTANDARD1_0 || NETSTANDARD2_0
15 | public partial class EmailAttachment
16 | {
17 | string PlatformGetContentType(string extension) =>
18 | throw ExceptionUtils.NotSupportedOrImplementedException;
19 | }
20 | #endif
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Flashlight/Flashlight.netstandard.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Flashlight
6 | {
7 | static Task PlatformTurnOnAsync() =>
8 | throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static Task PlatformTurnOffAsync() =>
11 | throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Flashlight/Flashlight.shared.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Flashlight
6 | {
7 | public static Task TurnOnAsync() =>
8 | PlatformTurnOnAsync();
9 |
10 | public static Task TurnOffAsync() =>
11 | PlatformTurnOffAsync();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Flashlight/Flashlight.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Tizen.System;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Flashlight
7 | {
8 | internal static bool IsSupported
9 | => Platform.GetFeatureInfo("camera.back.flash");
10 |
11 | internal static Task SwitchFlashlight(bool switchOn)
12 | {
13 | Permissions.EnsureDeclared();
14 | return Task.Run(() =>
15 | {
16 | if (!IsSupported)
17 | throw new FeatureNotSupportedException();
18 |
19 | if (switchOn)
20 | Led.Brightness = Led.MaxBrightness;
21 | else
22 | Led.Brightness = 0;
23 | });
24 | }
25 |
26 | static Task PlatformTurnOnAsync()
27 | {
28 | return SwitchFlashlight(true);
29 | }
30 |
31 | static Task PlatformTurnOffAsync()
32 | {
33 | return SwitchFlashlight(false);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Geocoding/Geocoding.ios.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using CoreLocation;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class Geocoding
8 | {
9 | static async Task> PlatformGetPlacemarksAsync(double latitude, double longitude)
10 | {
11 | using (var geocoder = new CLGeocoder())
12 | {
13 | var addressList = await geocoder.ReverseGeocodeLocationAsync(new CLLocation(latitude, longitude));
14 |
15 | return addressList?.ToPlacemarks();
16 | }
17 | }
18 |
19 | static async Task> PlatformGetLocationsAsync(string address)
20 | {
21 | using (var geocoder = new CLGeocoder())
22 | {
23 | var positionList = await geocoder.GeocodeAddressAsync(address);
24 |
25 | return positionList?.ToLocations();
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Geocoding/Geocoding.netstandard.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Geocoding
7 | {
8 | static Task> PlatformGetPlacemarksAsync(double latitude, double longitude) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static Task> PlatformGetLocationsAsync(string address) =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Geocoding/Geocoding.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class Geocoding
8 | {
9 | public static Task> GetPlacemarksAsync(Location location)
10 | {
11 | if (location == null)
12 | throw new ArgumentNullException(nameof(location));
13 |
14 | return GetPlacemarksAsync(location.Latitude, location.Longitude);
15 | }
16 |
17 | public static Task> GetPlacemarksAsync(double latitude, double longitude)
18 | => PlatformGetPlacemarksAsync(latitude, longitude);
19 |
20 | public static Task> GetLocationsAsync(string address)
21 | => PlatformGetLocationsAsync(address);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Geolocation/Geolocation.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class Geolocation
8 | {
9 | static Task PlatformLastKnownLocationAsync() =>
10 | throw ExceptionUtils.NotSupportedOrImplementedException;
11 |
12 | static Task PlatformLocationAsync(GeolocationRequest request, CancellationToken cancellationToken) =>
13 | throw ExceptionUtils.NotSupportedOrImplementedException;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Geolocation/Geolocation.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class Geolocation
9 | {
10 | public static Task GetLastKnownLocationAsync() =>
11 | PlatformLastKnownLocationAsync();
12 |
13 | public static Task GetLocationAsync() =>
14 | PlatformLocationAsync(new GeolocationRequest(), default);
15 |
16 | public static Task GetLocationAsync(GeolocationRequest request) =>
17 | PlatformLocationAsync(request ?? new GeolocationRequest(), default);
18 |
19 | public static Task GetLocationAsync(GeolocationRequest request, CancellationToken cancelToken) =>
20 | PlatformLocationAsync(request ?? new GeolocationRequest(), cancelToken);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Gyroscope/Gyroscope.ios.watchos.cs:
--------------------------------------------------------------------------------
1 | using CoreMotion;
2 | using Foundation;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Gyroscope
7 | {
8 | internal static bool IsSupported =>
9 | Platform.MotionManager?.GyroAvailable ?? false;
10 |
11 | internal static void PlatformStart(SensorSpeed sensorSpeed)
12 | {
13 | var manager = Platform.MotionManager;
14 | manager.GyroUpdateInterval = sensorSpeed.ToPlatform();
15 | manager.StartGyroUpdates(Platform.GetCurrentQueue(), DataUpdated);
16 | }
17 |
18 | static void DataUpdated(CMGyroData data, NSError error)
19 | {
20 | if (data == null)
21 | return;
22 |
23 | var field = data.RotationRate;
24 | var gyroData = new GyroscopeData(field.x, field.y, field.z);
25 | OnChanged(gyroData);
26 | }
27 |
28 | internal static void PlatformStop() =>
29 | Platform.MotionManager?.StopGyroUpdates();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Gyroscope/Gyroscope.netstandard.tvos.macos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class Gyroscope
4 | {
5 | internal static bool IsSupported =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | internal static void PlatformStart(SensorSpeed sensorSpeed) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | internal static void PlatformStop() =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Gyroscope/Gyroscope.tizen.cs:
--------------------------------------------------------------------------------
1 | using Tizen.Sensor;
2 | using TizenGyroscope = Tizen.Sensor.Gyroscope;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Gyroscope
7 | {
8 | internal static TizenGyroscope DefaultSensor =>
9 | (TizenGyroscope)Platform.GetDefaultSensor(SensorType.Gyroscope);
10 |
11 | internal static bool IsSupported =>
12 | TizenGyroscope.IsSupported;
13 |
14 | internal static void PlatformStart(SensorSpeed sensorSpeed)
15 | {
16 | DefaultSensor.Interval = sensorSpeed.ToPlatform();
17 | DefaultSensor.DataUpdated += DataUpdated;
18 | DefaultSensor.Start();
19 | }
20 |
21 | internal static void PlatformStop()
22 | {
23 | DefaultSensor.DataUpdated -= DataUpdated;
24 | DefaultSensor.Stop();
25 | }
26 |
27 | static void DataUpdated(object sender, GyroscopeDataUpdatedEventArgs e)
28 | {
29 | OnChanged(new GyroscopeData(e.X, e.Y, e.Z));
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/HapticFeedback/HapticFeedback.android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Threading.Tasks;
4 | using Android.Views;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class HapticFeedback
9 | {
10 | internal static bool IsSupported => true;
11 |
12 | static void PlatformPerform(HapticFeedbackType type)
13 | {
14 | Permissions.EnsureDeclared();
15 |
16 | try
17 | {
18 | Platform.CurrentActivity?.Window?.DecorView?.PerformHapticFeedback(ConvertType(type));
19 | }
20 | catch (Exception ex)
21 | {
22 | Debug.WriteLine($"HapticFeedback Exception: {ex.Message}");
23 | }
24 | }
25 |
26 | static FeedbackConstants ConvertType(HapticFeedbackType type) =>
27 | type switch
28 | {
29 | HapticFeedbackType.LongPress => FeedbackConstants.LongPress,
30 | _ => FeedbackConstants.ContextClick
31 | };
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/HapticFeedback/HapticFeedback.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using AppKit;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class HapticFeedback
8 | {
9 | internal static bool IsSupported => true;
10 |
11 | static void PlatformPerform(HapticFeedbackType type)
12 | {
13 | if (type == HapticFeedbackType.LongPress)
14 | NSHapticFeedbackManager.DefaultPerformer.PerformFeedback(NSHapticFeedbackPattern.Generic, NSHapticFeedbackPerformanceTime.Default);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/HapticFeedback/HapticFeedback.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class HapticFeedback
7 | {
8 | internal static bool IsSupported
9 | => throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static void PlatformPerform(HapticFeedbackType type)
12 | => throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/HapticFeedback/HapticFeedback.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class HapticFeedback
6 | {
7 | public static void Perform(HapticFeedbackType type = HapticFeedbackType.Click)
8 | {
9 | if (!IsSupported)
10 | throw new FeatureNotSupportedException();
11 | PlatformPerform(type);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/HapticFeedback/HapticFeedbackType.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum HapticFeedbackType
4 | {
5 | Click,
6 | LongPress
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Launcher/Launcher.netstandard.watchos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Launcher
7 | {
8 | static Task PlatformCanOpenAsync(Uri uri) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static Task PlatformOpenAsync(Uri uri) =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 |
14 | static Task PlatformOpenAsync(OpenFileRequest request) =>
15 | throw ExceptionUtils.NotSupportedOrImplementedException;
16 |
17 | static Task PlatformTryOpenAsync(Uri uri) =>
18 | throw ExceptionUtils.NotSupportedOrImplementedException;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Magnetometer/Magnetometer.netstandard.tvos.macos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class Magnetometer
4 | {
5 | internal static bool IsSupported =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | internal static void PlatformStart(SensorSpeed sensorSpeed) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | internal static void PlatformStop() =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/MainThread/MainThread.android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.OS;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class MainThread
7 | {
8 | static volatile Handler handler;
9 |
10 | static bool PlatformIsMainThread
11 | {
12 | get
13 | {
14 | if (Platform.HasApiLevel(BuildVersionCodes.M))
15 | return Looper.MainLooper.IsCurrentThread;
16 |
17 | return Looper.MyLooper() == Looper.MainLooper;
18 | }
19 | }
20 |
21 | static void PlatformBeginInvokeOnMainThread(Action action)
22 | {
23 | if (handler?.Looper != Looper.MainLooper)
24 | handler = new Handler(Looper.MainLooper);
25 |
26 | handler.Post(action);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/MainThread/MainThread.ios.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Foundation;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class MainThread
7 | {
8 | static bool PlatformIsMainThread =>
9 | NSThread.Current.IsMainThread;
10 |
11 | static void PlatformBeginInvokeOnMainThread(Action action)
12 | {
13 | NSRunLoop.Main.BeginInvokeOnMainThread(action.Invoke);
14 | }
15 |
16 | internal static T InvokeOnMainThread(Func factory)
17 | {
18 | T value = default;
19 | NSRunLoop.Main.InvokeOnMainThread(() => value = factory());
20 | return value;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/MainThread/MainThread.netstandard.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class MainThread
6 | {
7 | static void PlatformBeginInvokeOnMainThread(Action action) =>
8 | throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static bool PlatformIsMainThread =>
11 | throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/MainThread/MainThread.tizen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ElmSharp;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class MainThread
7 | {
8 | static void PlatformBeginInvokeOnMainThread(Action action)
9 | {
10 | if (PlatformIsMainThread)
11 | action();
12 | else
13 | EcoreMainloop.PostAndWakeUp(action);
14 | }
15 |
16 | static bool PlatformIsMainThread
17 | => EcoreMainloop.IsMainThread;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Map/Map.netstandard.tvos.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Map
6 | {
7 | internal static Task PlatformOpenMapsAsync(double latitude, double longitude, MapLaunchOptions options)
8 | => throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | internal static Task PlatformOpenMapsAsync(Placemark placemark, MapLaunchOptions options)
11 | => throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Map/MapLaunchOptions.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public class MapLaunchOptions
4 | {
5 | public NavigationMode NavigationMode { get; set; } = NavigationMode.None;
6 |
7 | public string Name { get; set; } = string.Empty;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Map/NavigationMode.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum NavigationMode
4 | {
5 | None = 0,
6 | Default = 1,
7 | Bicycling = 2,
8 | Driving = 3,
9 | Transit = 4,
10 | Walking = 5,
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/MediaPicker/MediaPicker.netstandard.watchos.tvos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Threading.Tasks;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class MediaPicker
8 | {
9 | static bool PlatformIsCaptureSupported =>
10 | throw new NotImplementedInReferenceAssemblyException();
11 |
12 | static Task PlatformPickPhotoAsync(MediaPickerOptions options) =>
13 | throw new NotImplementedInReferenceAssemblyException();
14 |
15 | static Task PlatformCapturePhotoAsync(MediaPickerOptions options) =>
16 | throw new NotImplementedInReferenceAssemblyException();
17 |
18 | static Task PlatformPickVideoAsync(MediaPickerOptions options) =>
19 | throw new NotImplementedInReferenceAssemblyException();
20 |
21 | static Task PlatformCaptureVideoAsync(MediaPickerOptions options) =>
22 | throw new NotImplementedInReferenceAssemblyException();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/OrientationSensor/OrientationSensor.netstandard.tvos.macos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class OrientationSensor
4 | {
5 | internal static bool IsSupported =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | static void PlatformStart(SensorSpeed sensorSpeed) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static void PlatformStop() =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Permissions/Permissions.shared.enums.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum PermissionStatus
4 | {
5 | // Permission is in an unknown state
6 | Unknown = 0,
7 |
8 | // Denied by user
9 | Denied = 1,
10 |
11 | // Feature is disabled on device
12 | Disabled = 2,
13 |
14 | // Granted by user
15 | Granted = 3,
16 |
17 | // Restricted (only iOS)
18 | Restricted = 4
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/PhoneDialer/PhoneDialer.ios.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using CoreTelephony;
3 | using Foundation;
4 | using UIKit;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class PhoneDialer
9 | {
10 | const string noNetworkProviderCode = "65535";
11 |
12 | internal static bool IsSupported => UIApplication.SharedApplication.CanOpenUrl(CreateNsUrl(new string('0', 10)));
13 |
14 | static void PlatformOpen(string number)
15 | {
16 | ValidateOpen(number);
17 |
18 | var nsUrl = CreateNsUrl(number);
19 | Launcher.PlatformOpenAsync(nsUrl);
20 | }
21 |
22 | static NSUrl CreateNsUrl(string number) => new NSUrl(new Uri($"tel:{number}").AbsoluteUri);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/PhoneDialer/PhoneDialer.macos.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 | using Foundation;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class PhoneDialer
7 | {
8 | internal static bool IsSupported =>
9 | MainThread.InvokeOnMainThread(() => NSWorkspace.SharedWorkspace.UrlForApplication(NSUrl.FromString($"tel:0000000000")) != null);
10 |
11 | static void PlatformOpen(string number)
12 | {
13 | ValidateOpen(number);
14 |
15 | var nsurl = NSUrl.FromString($"tel:{number}");
16 | NSWorkspace.SharedWorkspace.OpenUrl(nsurl);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/PhoneDialer/PhoneDialer.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class PhoneDialer
4 | {
5 | internal static bool IsSupported =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | static void PlatformOpen(string number) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/PhoneDialer/PhoneDialer.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class PhoneDialer
6 | {
7 | internal static void ValidateOpen(string number)
8 | {
9 | if (string.IsNullOrWhiteSpace(number))
10 | throw new ArgumentNullException(nameof(number));
11 |
12 | if (!IsSupported)
13 | throw new FeatureNotSupportedException();
14 | }
15 |
16 | public static void Open(string number)
17 | => PlatformOpen(number);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/PhoneDialer/PhoneDialer.tizen.cs:
--------------------------------------------------------------------------------
1 | using Tizen.Applications;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class PhoneDialer
6 | {
7 | internal static bool IsSupported
8 | => Platform.GetFeatureInfo("contact");
9 |
10 | static void PlatformOpen(string number)
11 | {
12 | Permissions.EnsureDeclared();
13 |
14 | var appControl = new AppControl
15 | {
16 | Operation = AppControlOperations.Dial,
17 | Uri = "tel:",
18 | };
19 |
20 | if (!string.IsNullOrEmpty(number))
21 | appControl.Uri += number;
22 |
23 | AppControl.SendLaunchRequest(appControl);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/PhoneDialer/PhoneDialer.uwp.cs:
--------------------------------------------------------------------------------
1 | using Windows.ApplicationModel.Calls;
2 | using Windows.Foundation.Metadata;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class PhoneDialer
7 | {
8 | internal static bool IsSupported =>
9 | ApiInformation.IsTypePresent("Windows.ApplicationModel.Calls.PhoneCallManager");
10 |
11 | static void PlatformOpen(string number)
12 | {
13 | ValidateOpen(number);
14 |
15 | PhoneCallManager.ShowPhoneCallUI(number, string.Empty);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Platform/Platform.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | #if !NETSTANDARD
4 | public static partial class Platform
5 | {
6 | }
7 | #endif
8 | }
9 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Platform/Platform.uwp.cs:
--------------------------------------------------------------------------------
1 | using Windows.ApplicationModel.Activation;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Platform
6 | {
7 | internal const string AppManifestFilename = "AppxManifest.xml";
8 | internal const string AppManifestXmlns = "http://schemas.microsoft.com/appx/manifest/foundation/windows10";
9 | internal const string AppManifestUapXmlns = "http://schemas.microsoft.com/appx/manifest/uap/windows10";
10 |
11 | public static string MapServiceToken { get; set; }
12 |
13 | public static async void OnLaunched(LaunchActivatedEventArgs e)
14 | => await AppActions.OnLaunched(e);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Preferences/Preferences.netstandard.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public static partial class Preferences
4 | {
5 | static bool PlatformContainsKey(string key, string sharedName) =>
6 | throw ExceptionUtils.NotSupportedOrImplementedException;
7 |
8 | static void PlatformRemove(string key, string sharedName) =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static void PlatformClear(string sharedName) =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 |
14 | static void PlatformSet(string key, T value, string sharedName) =>
15 | throw ExceptionUtils.NotSupportedOrImplementedException;
16 |
17 | static T PlatformGet(string key, T defaultValue, string sharedName) =>
18 | throw ExceptionUtils.NotSupportedOrImplementedException;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Resources/xml/xamarin_essentials_fileprovider_file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Screenshot/Screenshot.netstandard.tizen.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Screenshot
7 | {
8 | static bool PlatformIsCaptureSupported =>
9 | throw ExceptionUtils.NotSupportedOrImplementedException;
10 |
11 | static Task PlatformCaptureAsync() =>
12 | throw ExceptionUtils.NotSupportedOrImplementedException;
13 | }
14 |
15 | public partial class ScreenshotResult
16 | {
17 | ScreenshotResult()
18 | {
19 | }
20 |
21 | internal Task PlatformOpenReadAsync(ScreenshotFormat format) =>
22 | throw ExceptionUtils.NotSupportedOrImplementedException;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Screenshot/Screenshot.shared.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Screenshot
7 | {
8 | public static bool IsCaptureSupported
9 | => PlatformIsCaptureSupported;
10 |
11 | public static Task CaptureAsync()
12 | {
13 | if (!IsCaptureSupported)
14 | throw new FeatureNotSupportedException();
15 |
16 | return PlatformCaptureAsync();
17 | }
18 | }
19 |
20 | public partial class ScreenshotResult
21 | {
22 | public int Width { get; }
23 |
24 | public int Height { get; }
25 |
26 | public Task OpenReadAsync(ScreenshotFormat format = ScreenshotFormat.Png) =>
27 | PlatformOpenReadAsync(format);
28 | }
29 |
30 | public enum ScreenshotFormat
31 | {
32 | Png,
33 | Jpeg
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/SecureStorage/SecureStorage.netstandard.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public partial class SecureStorage
6 | {
7 | static Task PlatformGetAsync(string key) =>
8 | throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static Task PlatformSetAsync(string key, string data) =>
11 | throw ExceptionUtils.NotSupportedOrImplementedException;
12 |
13 | static bool PlatformRemove(string key) =>
14 | throw ExceptionUtils.NotSupportedOrImplementedException;
15 |
16 | static void PlatformRemoveAll() =>
17 | throw ExceptionUtils.NotSupportedOrImplementedException;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Share/Share.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Share
6 | {
7 | static Task PlatformRequestAsync(ShareTextRequest request) =>
8 | throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static Task PlatformRequestAsync(ShareMultipleFilesRequest request) =>
11 | throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Sms/Sms.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using AppKit;
5 | using Foundation;
6 |
7 | namespace Xamarin.Essentials
8 | {
9 | public static partial class Sms
10 | {
11 | internal static bool IsComposeSupported =>
12 | MainThread.InvokeOnMainThread(() => NSWorkspace.SharedWorkspace.UrlForApplication(NSUrl.FromString("sms:")) != null);
13 |
14 | static Task PlatformComposeAsync(SmsMessage message)
15 | {
16 | var recipients = string.Join(",", message.Recipients.Select(r => Uri.EscapeDataString(r)));
17 |
18 | var uri = $"sms:/open?addresses={recipients}";
19 |
20 | if (!string.IsNullOrEmpty(message?.Body))
21 | uri += "&body=" + Uri.EscapeDataString(message.Body);
22 |
23 | var nsurl = NSUrl.FromString(uri);
24 | NSWorkspace.SharedWorkspace.OpenUrl(nsurl);
25 | return Task.CompletedTask;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Sms/Sms.netstandard.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Sms
6 | {
7 | internal static bool IsComposeSupported
8 | => throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static Task PlatformComposeAsync(SmsMessage message)
11 | => throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Sms/Sms.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Tizen.Applications;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Sms
7 | {
8 | internal static bool IsComposeSupported
9 | => Platform.GetFeatureInfo("network.telephony.sms");
10 |
11 | static Task PlatformComposeAsync(SmsMessage message)
12 | {
13 | Permissions.EnsureDeclared();
14 |
15 | var appControl = new AppControl
16 | {
17 | Operation = AppControlOperations.Compose,
18 | Uri = "sms:",
19 | };
20 |
21 | if (!string.IsNullOrEmpty(message.Body))
22 | appControl.ExtraData.Add(AppControlData.Text, message.Body);
23 | if (message.Recipients.Count > 0)
24 | appControl.Uri += string.Join(" ", message.Recipients);
25 |
26 | AppControl.SendLaunchRequest(appControl);
27 |
28 | return Task.CompletedTask;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Sms/Sms.uwp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.ApplicationModel.Chat;
4 | using Windows.Foundation.Metadata;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class Sms
9 | {
10 | internal static bool IsComposeSupported
11 | => ApiInformation.IsTypePresent("Windows.ApplicationModel.Chat.ChatMessageManager");
12 |
13 | static Task PlatformComposeAsync(SmsMessage message)
14 | {
15 | var chat = new ChatMessage();
16 | if (!string.IsNullOrWhiteSpace(message?.Body))
17 | chat.Body = message.Body;
18 |
19 | foreach (var recipient in message?.Recipients)
20 | chat.Recipients.Add(recipient);
21 |
22 | return ChatMessageManager.ShowComposeSmsMessageAsync(chat).AsTask();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/TextToSpeech/TextToSpeech.netstandard.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class TextToSpeech
8 | {
9 | internal static Task PlatformSpeakAsync(string text, SpeechOptions options, CancellationToken cancelToken = default) =>
10 | throw ExceptionUtils.NotSupportedOrImplementedException;
11 |
12 | internal static Task> PlatformGetLocalesAsync() =>
13 | throw ExceptionUtils.NotSupportedOrImplementedException;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/DisplayOrientation.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum DisplayOrientation
4 | {
5 | Unknown = 0,
6 | Portrait = 1,
7 | Landscape = 2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/DisplayRotation.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum DisplayRotation
4 | {
5 | Unknown = 0,
6 | Rotation0 = 1,
7 | Rotation90 = 2,
8 | Rotation180 = 3,
9 | Rotation270 = 4
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/LocationExtensions.shared.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class LocationExtensions
6 | {
7 | public static double CalculateDistance(this Location locationStart, double latitudeEnd, double longitudeEnd, DistanceUnits units) =>
8 | Location.CalculateDistance(locationStart, latitudeEnd, longitudeEnd, units);
9 |
10 | public static double CalculateDistance(this Location locationStart, Location locationEnd, DistanceUnits units) =>
11 | Location.CalculateDistance(locationStart, locationEnd, units);
12 |
13 | public static Task OpenMapsAsync(this Location location, MapLaunchOptions options) =>
14 | Map.OpenAsync(location, options);
15 |
16 | public static Task OpenMapsAsync(this Location location) =>
17 | Map.OpenAsync(location);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlacemarkExtensions.ios.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using CoreLocation;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class PlacemarkExtensions
8 | {
9 | internal static IEnumerable ToPlacemarks(this IEnumerable addresses)
10 | {
11 | return addresses.Select(address => new Placemark
12 | {
13 | Location = address.ToLocation(),
14 | FeatureName = address.Name,
15 | PostalCode = address.PostalCode,
16 | SubLocality = address.SubLocality,
17 | CountryCode = address.IsoCountryCode,
18 | CountryName = address.Country,
19 | Thoroughfare = address.Thoroughfare,
20 | SubThoroughfare = address.SubThoroughfare,
21 | Locality = address.Locality,
22 | AdminArea = address.AdministrativeArea,
23 | SubAdminArea = address.SubAdministrativeArea
24 | });
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlacemarkExtensions.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class PlacemarkExtensions
7 | {
8 | public static Task OpenMapsAsync(this Placemark placemark, MapLaunchOptions options) =>
9 | Map.OpenAsync(placemark, options);
10 |
11 | public static Task OpenMapsAsync(this Placemark placemark) =>
12 | Map.OpenAsync(placemark);
13 |
14 | internal static string GetEscapedAddress(this Placemark placemark)
15 | {
16 | if (placemark == null)
17 | throw new ArgumentNullException(nameof(placemark));
18 |
19 | var address = $"{placemark.Thoroughfare} {placemark.Locality} {placemark.AdminArea} {placemark.PostalCode} {placemark.CountryName}";
20 |
21 | return Uri.EscapeDataString(address);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.android.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using AndroidColor = Android.Graphics.Color;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class ColorExtensions
7 | {
8 | public static Color ToSystemColor(this AndroidColor color) =>
9 | Color.FromArgb(color.A, color.R, color.G, color.B);
10 |
11 | public static AndroidColor ToPlatformColor(this Color color) =>
12 | new AndroidColor(color.R, color.G, color.B, color.A);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.ios.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using UIKit;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class ColorExtensions
8 | {
9 | public static Color ToSystemColor(this UIColor color)
10 | {
11 | if (color == null)
12 | throw new ArgumentNullException(nameof(color));
13 |
14 | color.GetRGBA(out var red, out var green, out var blue, out var alpha);
15 | return Color.FromArgb((int)Math.Round(alpha * 255), (int)Math.Round(red * 255), (int)Math.Round(green * 255), (int)Math.Round(blue * 255));
16 | }
17 |
18 | public static UIColor ToPlatformColor(this Color color) =>
19 | new UIColor(color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using AppKit;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class ColorExtensions
8 | {
9 | public static Color ToSystemColor(this NSColor color)
10 | {
11 | if (color == null)
12 | throw new ArgumentNullException(nameof(color));
13 |
14 | // make sure the colorspace is valid for RGBA
15 | // we can't check as the check will throw if it is invalid
16 | color = color.UsingColorSpace(NSColorSpace.SRGBColorSpace);
17 |
18 | color.GetRgba(out var red, out var green, out var blue, out var alpha);
19 | return Color.FromArgb((int)Math.Round(alpha * 255), (int)Math.Round(red * 255), (int)Math.Round(green * 255), (int)Math.Round(blue * 255));
20 | }
21 |
22 | public static NSColor ToPlatformColor(this Color color) =>
23 | NSColor.FromRgba(color.R, color.G, color.B, color.A);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using EColor = ElmSharp.Color;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class ColorExtensions
7 | {
8 | public static Color ToSystemColor(this EColor color) =>
9 | Color.FromArgb(color.A, color.R, color.G, color.B);
10 |
11 | public static EColor ToPlatformColor(this Color color) =>
12 | new EColor(color.R, color.G, color.B, color.A);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/ColorExtensions.uwp.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using WindowsColor = Windows.UI.Color;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class ColorExtensions
7 | {
8 | public static Color ToSystemColor(this WindowsColor color) =>
9 | Color.FromArgb(color.A, color.R, color.G, color.B);
10 |
11 | public static WindowsColor ToPlatformColor(this Color color) =>
12 | WindowsColor.FromArgb(color.A, color.R, color.G, color.B);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.android.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using AndroidPoint = Android.Graphics.Point;
3 | using AndroidPointF = Android.Graphics.PointF;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class PointExtensions
8 | {
9 | public static Point ToSystemPoint(this AndroidPoint point) =>
10 | new Point(point.X, point.Y);
11 |
12 | public static PointF ToSystemPointF(this AndroidPointF point) =>
13 | new PointF(point.X, point.Y);
14 |
15 | public static AndroidPoint ToPlatformPoint(this Point point) =>
16 | new AndroidPoint(point.X, point.Y);
17 |
18 | public static AndroidPointF ToPlatformPointF(this PointF point) =>
19 | new AndroidPointF(point.X, point.Y);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.ios.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using iOSPoint = CoreGraphics.CGPoint;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class PointExtensions
8 | {
9 | public static Point ToSystemPoint(this iOSPoint point)
10 | {
11 | if (point.X > int.MaxValue)
12 | throw new ArgumentOutOfRangeException(nameof(point.X));
13 |
14 | if (point.Y > int.MaxValue)
15 | throw new ArgumentOutOfRangeException(nameof(point.Y));
16 |
17 | return new Point((int)point.X, (int)point.Y);
18 | }
19 |
20 | public static PointF ToSystemPointF(this iOSPoint point) =>
21 | new PointF((float)point.X, (float)point.Y);
22 |
23 | public static iOSPoint ToPlatformPoint(this Point point) =>
24 | new iOSPoint((nfloat)point.X, (nfloat)point.Y);
25 |
26 | public static iOSPoint ToPlatformPoint(this PointF point) =>
27 | new iOSPoint((nfloat)point.X, (nfloat)point.Y);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using EPoint = ElmSharp.Point;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static class PointExtensions
7 | {
8 | public static Point ToSystemPoint(this EPoint point) =>
9 | new Point(point.X, point.Y);
10 |
11 | public static PointF ToSystemPointF(this EPoint point) =>
12 | new PointF(point.X, point.Y);
13 |
14 | public static EPoint ToPlatformPoint(this Point point) =>
15 | new EPoint() { X = point.X, Y = point.Y };
16 |
17 | public static EPoint ToPlatformPoint(this PointF point) =>
18 | ToPlatformPointF(point);
19 |
20 | public static EPoint ToPlatformPointF(this PointF point) =>
21 | new EPoint() { X = (int)point.X, Y = (int)point.Y };
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/PointExtensions.uwp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using WindowsPoint = Windows.Foundation.Point;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class PointExtensions
8 | {
9 | public static Point ToSystemPoint(this WindowsPoint point)
10 | {
11 | if (point.X > int.MaxValue)
12 | throw new ArgumentOutOfRangeException(nameof(point.X));
13 |
14 | if (point.Y > int.MaxValue)
15 | throw new ArgumentOutOfRangeException(nameof(point.Y));
16 |
17 | return new Point((int)point.X, (int)point.Y);
18 | }
19 |
20 | public static PointF ToSystemPointF(this WindowsPoint point) =>
21 | new PointF((float)point.X, (float)point.Y);
22 |
23 | public static WindowsPoint ToPlatformPoint(this Point point) =>
24 | new WindowsPoint(point.X, point.Y);
25 |
26 | public static WindowsPoint ToPlatformPoint(this PointF point) =>
27 | new WindowsPoint(point.X, point.Y);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/RectangleExtensions.android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using Android.Graphics;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class RectangleExtensions
8 | {
9 | public static Rectangle ToSystemRectangle(this Rect rect) =>
10 | new Rectangle(rect.Left, rect.Top, rect.Width(), rect.Height());
11 |
12 | public static RectangleF ToSystemRectangleF(this RectF rect) =>
13 | new RectangleF(rect.Left, rect.Top, rect.Width(), rect.Height());
14 |
15 | public static Rect ToPlatformRectangle(this Rectangle rect) =>
16 | new Rect(rect.Left, rect.Top, rect.Right, rect.Bottom);
17 |
18 | public static RectF ToPlatformRectangleF(this RectangleF rect) =>
19 | new RectF(rect.Left, rect.Top, rect.Right, rect.Bottom);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/RectangleExtensions.tizen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using ERect = ElmSharp.Rect;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class RectangleExtensions
8 | {
9 | public static Rectangle ToSystemRectangle(this ERect rect) =>
10 | new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height);
11 |
12 | public static RectangleF ToSystemRectangleF(this ERect rect) =>
13 | new RectangleF(rect.Left, rect.Top, rect.Width, rect.Height);
14 |
15 | public static ERect ToPlatformRectangle(this Rectangle rect) =>
16 | new ERect(rect.Left, rect.Top, rect.Right, rect.Bottom);
17 |
18 | public static ERect ToPlatformRectangle(this RectangleF rect) =>
19 | ToPlatformRectangleF(rect);
20 |
21 | public static ERect ToPlatformRectangleF(this RectangleF rect) =>
22 | new ERect((int)rect.Left, (int)rect.Top, (int)rect.Right, (int)rect.Bottom);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/SizeExtensions.android.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using AndroidSize = Android.Util.Size;
3 | using AndroidSizeF = Android.Util.SizeF;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class SizeExtensions
8 | {
9 | public static Size ToSystemSize(this AndroidSize size) =>
10 | new Size(size.Width, size.Height);
11 |
12 | public static SizeF ToSystemSizeF(this AndroidSizeF size) =>
13 | new SizeF(size.Width, size.Height);
14 |
15 | public static AndroidSize ToPlatformSize(this Size size) =>
16 | new AndroidSize(size.Width, size.Height);
17 |
18 | public static AndroidSizeF ToPlatformSizeF(this SizeF size) =>
19 | new AndroidSizeF(size.Width, size.Height);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/SizeExtensions.ios.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using iOSSize = CoreGraphics.CGSize;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class SizeExtensions
8 | {
9 | public static Size ToSystemSize(this iOSSize size)
10 | {
11 | if (size.Width > int.MaxValue)
12 | throw new ArgumentOutOfRangeException(nameof(size.Width));
13 |
14 | if (size.Height > int.MaxValue)
15 | throw new ArgumentOutOfRangeException(nameof(size.Height));
16 |
17 | return new Size((int)size.Width, (int)size.Height);
18 | }
19 |
20 | public static SizeF ToSystemSizeF(this iOSSize size) =>
21 | new SizeF((float)size.Width, (float)size.Height);
22 |
23 | public static iOSSize ToPlatformSize(this Size size) =>
24 | new iOSSize((nfloat)size.Width, (nfloat)size.Height);
25 |
26 | public static iOSSize ToPlatformSize(this SizeF size) =>
27 | new iOSSize((nfloat)size.Width, (nfloat)size.Height);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/SizeExtensions.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using ESize = ElmSharp.Size;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static class SizeExtensions
7 | {
8 | public static Size ToSystemSize(this ESize size) =>
9 | new Size(size.Width, size.Height);
10 |
11 | public static SizeF ToSystemSizeF(this ESize size) =>
12 | new SizeF(size.Width, size.Height);
13 |
14 | public static ESize ToPlatformSize(this Size size) =>
15 | new ESize(size.Width, size.Height);
16 |
17 | public static ESize ToPlatformSize(this SizeF size) =>
18 | ToPlatformSizeF(size);
19 |
20 | public static ESize ToPlatformSizeF(this SizeF size) =>
21 | new ESize((int)size.Width, (int)size.Height);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/PlatformExtensions/SizeExtensions.uwp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using WindowsSize = Windows.Foundation.Size;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static class SizeExtensions
8 | {
9 | public static Size ToSystemSize(this WindowsSize size)
10 | {
11 | if (size.Width > int.MaxValue)
12 | throw new ArgumentOutOfRangeException(nameof(size.Width));
13 |
14 | if (size.Height > int.MaxValue)
15 | throw new ArgumentOutOfRangeException(nameof(size.Height));
16 |
17 | return new Size((int)size.Width, (int)size.Height);
18 | }
19 |
20 | public static SizeF ToSystemSizFe(this WindowsSize size) =>
21 | new SizeF((float)size.Width, (float)size.Height);
22 |
23 | public static WindowsSize ToPlatformSize(this Size size) =>
24 | new WindowsSize(size.Width, size.Height);
25 |
26 | public static WindowsSize ToPlatformSize(this SizeF size) =>
27 | new WindowsSize(size.Width, size.Height);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/SensorSpeed.android.cs:
--------------------------------------------------------------------------------
1 | using Android.Hardware;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | static class SensorSpeedExtensions
6 | {
7 | internal static SensorDelay ToPlatform(this SensorSpeed sensorSpeed)
8 | {
9 | switch (sensorSpeed)
10 | {
11 | case SensorSpeed.Fastest:
12 | return SensorDelay.Fastest;
13 | case SensorSpeed.Game:
14 | return SensorDelay.Game;
15 | case SensorSpeed.UI:
16 | return SensorDelay.Ui;
17 | }
18 |
19 | return SensorDelay.Normal;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/SensorSpeed.ios.tvos.watchos.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | static class SensorSpeedExtensions
4 | {
5 | internal static double ToPlatform(this SensorSpeed sensorSpeed)
6 | {
7 | switch (sensorSpeed)
8 | {
9 | case SensorSpeed.Fastest:
10 | return .02;
11 | case SensorSpeed.Game:
12 | return .04;
13 | case SensorSpeed.UI:
14 | return .08;
15 | }
16 |
17 | return .225;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/SensorSpeed.shared.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | public enum SensorSpeed
4 | {
5 | Default = 0,
6 | UI = 1,
7 | Game = 2,
8 | Fastest = 3,
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/SensorSpeed.tizen.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | static class SensorSpeedExtensions
4 | {
5 | internal static uint ToPlatform(this SensorSpeed sensorSpeed)
6 | {
7 | switch (sensorSpeed)
8 | {
9 | case SensorSpeed.Fastest:
10 | return 10;
11 | case SensorSpeed.Game:
12 | return 20;
13 | case SensorSpeed.UI:
14 | return 60;
15 | }
16 |
17 | return 100;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/SensorSpeed.uwp.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Essentials
2 | {
3 | static class SensorSpeedExtensions
4 | {
5 | internal static uint ToPlatform(this SensorSpeed sensorSpeed)
6 | {
7 | switch (sensorSpeed)
8 | {
9 | case SensorSpeed.Fastest:
10 | return 20;
11 | case SensorSpeed.Game:
12 | return 40;
13 | case SensorSpeed.UI:
14 | return 80;
15 | }
16 |
17 | return 225;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Types/Shared/PreserveAttribute.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | [AttributeUsage(AttributeTargets.All)]
7 | [EditorBrowsable(EditorBrowsableState.Never)]
8 | sealed class PreserveAttribute : Attribute
9 | {
10 | #pragma warning disable SA1401 // Fields should be private
11 | public bool AllMembers;
12 | public bool Conditional;
13 | #pragma warning restore SA1401 // Fields should be private
14 |
15 | public PreserveAttribute(bool allMembers, bool conditional)
16 | {
17 | AllMembers = allMembers;
18 | Conditional = conditional;
19 | }
20 |
21 | public PreserveAttribute()
22 | {
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Vibration/Vibration.ios.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using AudioToolbox;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Vibration
7 | {
8 | internal static bool IsSupported => true;
9 |
10 | static void PlatformVibrate(TimeSpan duration) =>
11 | SystemSound.Vibrate.PlaySystemSound();
12 |
13 | static void PlatformCancel()
14 | {
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Vibration/Vibration.netstandard.tvos.watchos.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Vibration
6 | {
7 | internal static bool IsSupported
8 | => throw ExceptionUtils.NotSupportedOrImplementedException;
9 |
10 | static void PlatformVibrate(TimeSpan duration)
11 | => throw ExceptionUtils.NotSupportedOrImplementedException;
12 |
13 | static void PlatformCancel()
14 | => throw ExceptionUtils.NotSupportedOrImplementedException;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Vibration/Vibration.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xamarin.Essentials
4 | {
5 | public static partial class Vibration
6 | {
7 | public static void Vibrate()
8 | => Vibrate(TimeSpan.FromMilliseconds(500));
9 |
10 | public static void Vibrate(double duration)
11 | => Vibrate(TimeSpan.FromMilliseconds(duration));
12 |
13 | public static void Vibrate(TimeSpan duration)
14 | {
15 | if (!IsSupported)
16 | throw new FeatureNotSupportedException();
17 |
18 | if (duration.TotalMilliseconds < 0)
19 | duration = TimeSpan.Zero;
20 | else if (duration.TotalSeconds > 5)
21 | duration = TimeSpan.FromSeconds(5);
22 |
23 | PlatformVibrate(duration);
24 | }
25 |
26 | public static void Cancel()
27 | {
28 | if (!IsSupported)
29 | throw new FeatureNotSupportedException();
30 |
31 | PlatformCancel();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Vibration/Vibration.tizen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using Tizen.System;
4 |
5 | namespace Xamarin.Essentials
6 | {
7 | public static partial class Vibration
8 | {
9 | internal static bool IsSupported
10 | => Vibrator.NumberOfVibrators > 0;
11 |
12 | static void PlatformVibrate(TimeSpan duration)
13 | {
14 | Permissions.EnsureDeclared();
15 | Vibrator.Vibrators.FirstOrDefault()?.Vibrate((int)duration.TotalMilliseconds, 100);
16 | }
17 |
18 | static void PlatformCancel()
19 | {
20 | Permissions.EnsureDeclared();
21 | Vibrator.Vibrators.FirstOrDefault()?.Stop();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/Vibration/Vibration.uwp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.Phone.Devices.Notification;
3 |
4 | namespace Xamarin.Essentials
5 | {
6 | public static partial class Vibration
7 | {
8 | internal static bool IsSupported
9 | => Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.Devices.Notification.VibrationDevice") && DefaultDevice != null;
10 |
11 | static VibrationDevice DefaultDevice => VibrationDevice.GetDefault();
12 |
13 | static void PlatformVibrate(TimeSpan duration) =>
14 | DefaultDevice.Vibrate(duration);
15 |
16 | static void PlatformCancel() =>
17 | DefaultDevice.Cancel();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/WebAuthenticator/AppleSignInAuthenticator.netstandard.android.tvos.watchos.uwp.tizen.macos.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading.Tasks;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class AppleSignInAuthenticator
9 | {
10 | static Task PlatformAuthenticateAsync(Options options) =>
11 | throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/WebAuthenticator/AppleSignInAuthenticator.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading.Tasks;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class AppleSignInAuthenticator
9 | {
10 | public static Task AuthenticateAsync(Options options = null)
11 | => PlatformAuthenticateAsync(options ?? new Options());
12 |
13 | public class Options
14 | {
15 | public bool IncludeFullNameScope { get; set; } = false;
16 |
17 | public bool IncludeEmailScope { get; set; } = false;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/WebAuthenticator/WebAuthenticator.netstandard.watchos.tizen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading.Tasks;
5 |
6 | namespace Xamarin.Essentials
7 | {
8 | public static partial class WebAuthenticator
9 | {
10 | static Task PlatformAuthenticateAsync(WebAuthenticatorOptions webAuthenticatorOptions)
11 | => throw ExceptionUtils.NotSupportedOrImplementedException;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Xamarin.Essentials/WebAuthenticator/WebAuthenticator.shared.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Runtime.CompilerServices;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Xamarin.Essentials
8 | {
9 | public static partial class WebAuthenticator
10 | {
11 | public static Task AuthenticateAsync(Uri url, Uri callbackUrl)
12 | => PlatformAuthenticateAsync(new WebAuthenticatorOptions { Url = url, CallbackUrl = callbackUrl });
13 |
14 | public static Task AuthenticateAsync(WebAuthenticatorOptions webAuthenticatorOptions)
15 | => PlatformAuthenticateAsync(webAuthenticatorOptions);
16 | }
17 |
18 | public class WebAuthenticatorOptions
19 | {
20 | public Uri Url { get; set; }
21 |
22 | public Uri CallbackUrl { get; set; }
23 |
24 | public bool PrefersEphemeralWebBrowserSession { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/appcenter-post-clone.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | echo "Variables:"
4 |
5 | # Updating manifest
6 | sed -i '' "s/AC_IOS/$AC_IOS/g" $BUILD_REPOSITORY_LOCALPATH/Samples/Samples/Helpers/CommonConstants
7 |
8 | sed -i '' "s/APP-SECRET/$APP_SECRET/g" $BUILD_REPOSITORY_LOCALPATH/Samples/Samples.iOS/Info.plist
9 |
10 | echo "Manifest updated!"
11 |
--------------------------------------------------------------------------------
/build-tools/automation/guardian/CredScanSuppressions.json:
--------------------------------------------------------------------------------
1 | {
2 | "tool": "Credential Scanner",
3 | "suppressions": [
4 |
5 | ]
6 | }
--------------------------------------------------------------------------------
/build-tools/automation/guardian/tsaoptions-v2.json:
--------------------------------------------------------------------------------
1 | {
2 | "codebaseName": "xamarin.essentials_main",
3 | "notificationAliases": [
4 | "dotnet-maui-eng@microsoft.com"
5 | ],
6 | "instanceUrl": "https://devdiv.visualstudio.com/",
7 | "projectName": "DevDiv",
8 | "areaPath": "DevDiv\\VS Client - Runtime SDKs\\Essentials",
9 | "iterationPath": "DevDiv",
10 | "allTools": true
11 | }
--------------------------------------------------------------------------------
/docs/.gitattributes:
--------------------------------------------------------------------------------
1 | # a special case for docs
2 | *.xml text eol=lf
--------------------------------------------------------------------------------
/docs/en/breadcrumb/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Docs
2 | tocHref: /
--------------------------------------------------------------------------------
/docs/en/ns-Xamarin.Essentials.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Xamarin.Essentials offers a cross-platform API for platform specific features.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/frameworks.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/nugetreadme.txt:
--------------------------------------------------------------------------------
1 | ## Xamarin.Essentials
2 |
3 | Thank you for installing Xamarin.Essentials, be sure to read through our full documentation at:
4 | https://aka.ms/xamarinessentials
5 |
6 | ## Setup
7 |
8 | Ensure that you install Xamarin.Essentials into all of your projects.
9 |
10 | For Android projects there is a small amount of setup needed to handle permissions. Please follow our short guide at:
11 | https://aka.ms/essentials-getstarted
12 |
13 | ## Release Notes
14 |
15 | See our full release notes for more information: https://aka.ms/essentials-releasenotes
16 |
--------------------------------------------------------------------------------
/stylecop.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
3 |
4 | "settings": {
5 | "layoutRules": {
6 | "newlineAtEndOfFile": "require"
7 | },
8 | "orderingRules": {
9 | "systemUsingDirectivesFirst": true,
10 | "usingDirectivesPlacement": "outsideNamespace"
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------