From 7b05b511ec0749a26236405d6949f990a40fa6b7 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Tue, 24 Mar 2020 15:59:49 -0400 Subject: [PATCH] feat: Add support for Android10 and AndroidX BREAKING CHANGE: All targets are now using the AndroidX support libraries. If your application uses explicit references to support libraries, you'll to upgrade those as well. Uno upgraded from: - Xamarin.Android.Support.v4 - Xamarin.Android.Support.v7.AppCompat - Xamarin.Android.Support.v7.RecyclerView To : - Xamarin.AndroidX.Legacy.Support.V4 - Xamarin.AndroidX.AppCompat - Xamarin.AndroidX.RecyclerView - Xamarin.AndroidX.Fragment --- build/PackageDiffIgnore.xml | 1279 +++++++++-------- build/Uno.UI.Build.csproj | 2 +- build/Uno.UI.Lottie.nuspec | 1 + build/Uno.UI.nuspec | 386 ++--- doc/articles/controls/ListViewBase.md | 2 +- src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.csproj | 6 +- src/Directory.Build.targets | 15 + .../Properties/AndroidManifest.xml | 4 +- .../SamplesApp.Droid/SamplesApp.Droid.csproj | 2 +- .../CrossTargetedLibrary.csproj | 4 +- .../System.Xaml/Uno.Xaml.csproj | 4 +- .../DependencyObjectGenerator.cs | 2 +- .../XamlGenerationTests.Core.csproj | 22 +- .../XamlGenerationTests.csproj | 22 +- src/TargetFrameworkSelection.targets | 9 +- src/Uno.Foundation/Uno.Foundation.csproj | 4 +- src/Uno.UI-Android-only.slnf | 1 + .../Uno.UI.BindingHelper.Android.csproj | 30 +- .../Uno/UI/UnoMotionHelper.java | 2 +- .../Uno/UI/UnoRecyclerView.java | 2 +- .../Uno/UI/UnoTwoDScrollView.java | 2 +- .../Uno.UI.DualScreen.csproj | 6 +- src/Uno.UI.Maps/Uno.UI.Maps.csproj | 12 +- .../Uno.UI.RemoteControl.csproj | 4 +- .../Uno.UI.RuntimeTests.csproj | 2 +- src/Uno.UI.Toolkit/UIElementExtensions.cs | 2 +- src/Uno.UI.Toolkit/Uno.UI.Toolkit.csproj | 25 +- src/Uno.UI/BaseActivity.Android.cs | 2 +- src/Uno.UI/BaseFragment.Android.cs | 2 +- .../Controls/AppBarButtonRenderer.Android.cs | 2 +- src/Uno.UI/Controls/BindableButton.Android.cs | 4 +- .../Controls/BindableCheckBox.Android.cs | 2 +- .../Controls/BindableDrawerLayout.Android.cs | 4 +- .../Controls/BindableFragment.Android.cs | 4 +- .../Controls/BindableItemsView.Android.cs | 4 +- .../Controls/BindablePagerAdapter.Android.cs | 4 +- .../Controls/BindableRadioButton.Android.cs | 2 +- .../Controls/BindableSwitchCompat.Android.cs | 24 +- .../Controls/CommandBarRenderer.Android.cs | 9 +- .../NavigationAppBarButtonRenderer.Android.cs | 4 +- .../Controls/SlidingTabLayout.Android.cs | 2 +- src/Uno.UI/DrawableHelper.Android.cs | 1 - .../FragmentManagerExtensions.Android.cs | 2 +- .../Extensions/PermissionsHelper.Android.cs | 4 +- .../Extensions/RecyclerExtensions.Android.cs | 2 +- .../Extensions/ToolbarExtensions.Android.cs | 2 +- src/Uno.UI/IFragmentTracker.Android.cs | 2 +- .../Mixins/Android/FrameworkElementMixins.tt | 2 +- .../Controls/BorderLayerRenderer.Android.cs | 2 +- .../Controls/FlipView/FlipView.Android.cs | 3 +- .../FlipView/FlipViewAdapter.Android.cs | 4 +- .../FlipView/NativePagedView.Android.cs | 2 +- .../ItemsStackPanelLayout.Android.cs | 2 +- .../ItemsWrapGridLayout.Android.cs | 2 +- .../ListViewBase/BufferViewCache.Android.cs | 2 +- .../ListViewBase/ListViewBase.Android.cs | 3 +- .../NativeListViewBase.Android.cs | 2 +- .../NativeListViewBase.SnapPoints.Android.cs | 5 +- .../NativeListViewBaseAdapter.Android.cs | 2 +- .../ScrollingViewCache.Android.cs | 2 +- .../ListViewBase/UnoViewHolder.Android.cs | 2 +- .../VirtualizingPanelLayout.Android.cs | 8 +- .../Pivot/ExtendedViewPager.Android.cs | 2 +- .../Pivot/NativePivotPresenter.Android.cs | 4 +- .../Controls/Pivot/PivotAdapter.Android.cs | 10 +- .../Pivot/PivotItemFragment.Android.cs | 7 +- .../ProgressRing/ProgressRing.Android.cs | 6 + .../Controls/TextBox/TextBoxView.Android.cs | 29 +- ...IFrameworkElementImplementation.Android.tt | 1 + src/Uno.UI/UI/Xaml/UIElement.Android.cs | 3 +- src/Uno.UI/Uno.UI.csproj | 26 +- .../ApplicationModel/PackageId.Android.cs | 2 +- src/Uno.UWP/Devices/Lights/Lamp.Android.cs | 2 + src/Uno.UWP/Extensions/PermissionsHelper.cs | 1 - .../Activities/AwaitableResultActivity.cs | 2 +- src/Uno.UWP/Helpers/DrawableHelper.Android.cs | 5 +- .../Media/Capture/CameraCaptureUI.Android.cs | 2 +- .../Notification/VibrationDevice.Android.cs | 2 +- .../ApplicationDataContainer.Android.cs | 2 + src/Uno.UWP/Storage/KnownFolders.Android.cs | 6 +- .../UI/Popups/MessageDialog.Android.cs | 4 +- src/Uno.UWP/Uno.csproj | 20 +- src/Uno.UWPSyncGenerator/Generator.cs | 2 +- src/crosstargeting_override.props.sample | 2 +- 84 files changed, 1146 insertions(+), 971 deletions(-) diff --git a/build/PackageDiffIgnore.xml b/build/PackageDiffIgnore.xml index c851a5a1b1e2..a76aeb13dc2d 100644 --- a/build/PackageDiffIgnore.xml +++ b/build/PackageDiffIgnore.xml @@ -1,608 +1,608 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -834,6 +833,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/Uno.UI.Build.csproj b/build/Uno.UI.Build.csproj index 1db321533de2..0cc33740a068 100644 --- a/build/Uno.UI.Build.csproj +++ b/build/Uno.UI.Build.csproj @@ -169,7 +169,7 @@ - + diff --git a/build/Uno.UI.Lottie.nuspec b/build/Uno.UI.Lottie.nuspec index 2ebf26cdedac..73b1a4dd2571 100644 --- a/build/Uno.UI.Lottie.nuspec +++ b/build/Uno.UI.Lottie.nuspec @@ -62,5 +62,6 @@ + diff --git a/build/Uno.UI.nuspec b/build/Uno.UI.nuspec index 089030b68bcd..28e4ba3d0f32 100644 --- a/build/Uno.UI.nuspec +++ b/build/Uno.UI.nuspec @@ -1,37 +1,48 @@  - Uno.UI - 2.7.1000 - Uno.UI - nventive - nventive - false - https://platform.uno/ - Apache-2.0 - https://nv-assets.azurewebsites.net/logos/uno.png - Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. - Copyright (C) 2015-2019 nventive inc. - all rights reserved - - - - - - - - - - - - - - - - - - - - + Uno.UI + 2.7.1000 + Uno.UI + nventive + nventive + false + https://platform.uno/ + Apache-2.0 + https://nv-assets.azurewebsites.net/logos/uno.png + Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. + Copyright (C) 2015-2019 nventive inc. - all rights reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51,158 +62,171 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/articles/controls/ListViewBase.md b/doc/articles/controls/ListViewBase.md index 46ef94c7339a..a44a7422b877 100644 --- a/doc/articles/controls/ListViewBase.md +++ b/doc/articles/controls/ListViewBase.md @@ -159,7 +159,7 @@ ScrollViewer + ScrollContentPresenter. | Uno class | Android base class | iOS base class | Description | | --- | --- | --- | --- | -| NativeListViewBase | Android.Support.V7.Widget.RecyclerView | UIKit.UICollectionView | Native list view, parent of item views. | +| NativeListViewBase | AndroidX.RecyclerView.Widget.RecyclerView | UIKit.UICollectionView | Native list view, parent of item views. | | ItemsStackPanelLayout(ItemsWrapGridLayout) | RecyclerView.LayoutManager | UIKit.UICollectionViewLayout | Tells NativeListViewBase how to lay out its items. Bridge for ItemsStackPanel(ItemsWrapGrid). | | NativeListViewBaseAdapter(Android), ListViewBaseSource(iOS) | RecyclerView.Adapter | UIKit.UICollectionViewSource | Handles creation and reuse of item views. No direct UWP equivalent. | | ScrollingViewCache | RecyclerView.ViewCacheExtension | - | Additional virtualization handling on Android which optimizes scroll performance. | diff --git a/src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.csproj b/src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.csproj index c4026c41b1bb..0350707af38d 100644 --- a/src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.csproj +++ b/src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.csproj @@ -1,8 +1,8 @@  - xamarinmac20;MonoAndroid90;xamarinios10;net461;netstandard2.0 - xamarinmac20;MonoAndroid90;xamarinios10;net461;netstandard2.0 + xamarinmac20;MonoAndroid10.0;xamarinios10;net461;netstandard2.0 + xamarinmac20;MonoAndroid90;MonoAndroid10.0;xamarinios10;net461;netstandard2.0 $(NoWarn);NU1701 true true @@ -37,7 +37,7 @@ - + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 650757764e02..af0608a1dbfa 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -37,4 +37,19 @@ + + + + + + + + + + + + + + + diff --git a/src/SamplesApp/SamplesApp.Droid/Properties/AndroidManifest.xml b/src/SamplesApp/SamplesApp.Droid/Properties/AndroidManifest.xml index 5ed4b5b7379e..60650d676d23 100644 --- a/src/SamplesApp/SamplesApp.Droid/Properties/AndroidManifest.xml +++ b/src/SamplesApp/SamplesApp.Droid/Properties/AndroidManifest.xml @@ -1,7 +1,7 @@  - + - + \ No newline at end of file diff --git a/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj b/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj index 13a2612b6a80..6fc77940a7a3 100644 --- a/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj +++ b/src/SamplesApp/SamplesApp.Droid/SamplesApp.Droid.csproj @@ -15,7 +15,7 @@ true Resources\Resource.Designer.cs Off - v9.0 + v10.0 Properties\AndroidManifest.xml True ..\SamplesApp.Shared\Strings diff --git a/src/SolutionTemplate/UnoLibraryTemplate/CrossTargetedLibrary.csproj b/src/SolutionTemplate/UnoLibraryTemplate/CrossTargetedLibrary.csproj index 0856c418e1ba..06715309c8d6 100644 --- a/src/SolutionTemplate/UnoLibraryTemplate/CrossTargetedLibrary.csproj +++ b/src/SolutionTemplate/UnoLibraryTemplate/CrossTargetedLibrary.csproj @@ -1,7 +1,7 @@ - netstandard2.0;xamarinios10;monoandroid90;uap10.0.16299 + netstandard2.0;xamarinios10;MonoAndroid90;monoandroid10.0;uap10.0.16299 true @@ -11,7 +11,7 @@ $(DefineConstants);__WASM__ - + diff --git a/src/SourceGenerators/System.Xaml/Uno.Xaml.csproj b/src/SourceGenerators/System.Xaml/Uno.Xaml.csproj index f173901ce8f3..2b9b5af7da38 100644 --- a/src/SourceGenerators/System.Xaml/Uno.Xaml.csproj +++ b/src/SourceGenerators/System.Xaml/Uno.Xaml.csproj @@ -1,7 +1,7 @@ - xamarinmac20;net461;xamarinios10;MonoAndroid90;netstandard2.0 - net461;MonoAndroid80;MonoAndroid90;xamarinios10;netstandard2.0;xamarinmac20 + xamarinmac20;net461;xamarinios10;MonoAndroid10.0;netstandard2.0 + net461;MonoAndroid90;MonoAndroid10.0;xamarinios10;netstandard2.0;xamarinmac20 true True diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators/DependencyObject/DependencyObjectGenerator.cs b/src/SourceGenerators/Uno.UI.SourceGenerators/DependencyObject/DependencyObjectGenerator.cs index bfc11793fa2f..447abf9083c8 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators/DependencyObject/DependencyObjectGenerator.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators/DependencyObject/DependencyObjectGenerator.cs @@ -50,7 +50,7 @@ public SerializationMethodsGenerator(SourceGeneratorContext context) _androidViewSymbol = comp.GetTypeByMetadataName("Android.Views.View"); _javaObjectSymbol = comp.GetTypeByMetadataName("Java.Lang.Object"); _androidActivitySymbol = comp.GetTypeByMetadataName("Android.App.Activity"); - _androidFragmentSymbol = comp.GetTypeByMetadataName("Android.Support.V4.App.Fragment"); + _androidFragmentSymbol = comp.GetTypeByMetadataName("AndroidX.Fragment.App.Fragment"); _bindableAttributeSymbol = comp.GetTypeByMetadataName("Windows.UI.Xaml.Data.BindableAttribute"); _iFrameworkElementSymbol = comp.GetTypeByMetadataName(XamlConstants.Types.IFrameworkElement); } diff --git a/src/SourceGenerators/XamlGenerationTests.Core/XamlGenerationTests.Core.csproj b/src/SourceGenerators/XamlGenerationTests.Core/XamlGenerationTests.Core.csproj index 05bb348066a3..f75ef91e1d5d 100644 --- a/src/SourceGenerators/XamlGenerationTests.Core/XamlGenerationTests.Core.csproj +++ b/src/SourceGenerators/XamlGenerationTests.Core/XamlGenerationTests.Core.csproj @@ -1,7 +1,7 @@  - MonoAndroid90;xamarinios10;netstandard2.0 - MonoAndroid90;xamarinios10 + MonoAndroid10.0;xamarinios10;netstandard2.0 + MonoAndroid90;MonoAndroid10.0;xamarinios10;netstandard2.0 @@ -22,15 +22,15 @@ - - 28.0.0.1 - - - 28.0.0.1 - - - 28.0.0.1 - + + + + + + + + + diff --git a/src/SourceGenerators/XamlGenerationTests/XamlGenerationTests.csproj b/src/SourceGenerators/XamlGenerationTests/XamlGenerationTests.csproj index b23805131b6e..756a938764a6 100644 --- a/src/SourceGenerators/XamlGenerationTests/XamlGenerationTests.csproj +++ b/src/SourceGenerators/XamlGenerationTests/XamlGenerationTests.csproj @@ -1,7 +1,7 @@  - MonoAndroid90;xamarinios10;netstandard2.0 - MonoAndroid90;xamarinios10 + MonoAndroid10.0;xamarinios10;netstandard2.0 + MonoAndroid90;MonoAndroid10.0;xamarinios10;netstandard2.0 @@ -22,15 +22,15 @@ - - 28.0.0.1 - - - 28.0.0.1 - - - 28.0.0.1 - + + + + + + + + + diff --git a/src/TargetFrameworkSelection.targets b/src/TargetFrameworkSelection.targets index 8b4bee6a10b7..fb9d8cbf7db7 100644 --- a/src/TargetFrameworkSelection.targets +++ b/src/TargetFrameworkSelection.targets @@ -18,10 +18,13 @@ <_OverrideTargetFrameworksDependency Include="GetTargetFrameworkProperties" /> - - <_OverrideTargetFrameworksDependency Include="GetTargetFrameworks" /> + + <_OverrideTargetFrameworksDependency Include="GetTargetFrameworks" /> + + + <_OverrideTargetFrameworksDependency Include="CollectPackageReferences" /> - + <_OverrideTargetFrameworksDependency Include="_GenerateRestoreGraphProjectEntry" /> <_OverrideTargetFrameworksDependency Include="_GenerateRestoreGraph" /> <_OverrideTargetFrameworksDependency Include="_IsProjectRestoreSupported" /> diff --git a/src/Uno.Foundation/Uno.Foundation.csproj b/src/Uno.Foundation/Uno.Foundation.csproj index dd9986b90c5f..cc278f4b2d9d 100644 --- a/src/Uno.Foundation/Uno.Foundation.csproj +++ b/src/Uno.Foundation/Uno.Foundation.csproj @@ -1,7 +1,7 @@  - xamarinmac20;xamarinios10;MonoAndroid90;net461;netstandard2.0 - MonoAndroid90;xamarinios10;net461;netstandard2.0;xamarinmac20 + xamarinmac20;xamarinios10;MonoAndroid10.0;net461;netstandard2.0 + MonoAndroid90;MonoAndroid10.0;xamarinios10;net461;netstandard2.0;xamarinmac20 diff --git a/src/Uno.UI-Android-only.slnf b/src/Uno.UI-Android-only.slnf index 125bfd6d941b..8b0e22f79fb8 100644 --- a/src/Uno.UI-Android-only.slnf +++ b/src/Uno.UI-Android-only.slnf @@ -9,6 +9,7 @@ "SamplesApp\\SamplesApp.UITests\\SamplesApp.UITests.csproj", "SamplesApp\\SamplesApp.UnitTests.Shared\\SamplesApp.UnitTests.Shared.shproj", "SamplesApp\\UITests.Shared\\UITests.Shared.shproj", + "SourceGenerators\\System.Xaml\\Uno.Xaml.csproj", "SourceGenerators\\Uno.UI.SourceGenerators\\Uno.UI.SourceGenerators.csproj", "SourceGenerators\\Uno.UI.Tasks\\Uno.UI.Tasks.csproj", "T4Generator\\T4Generator.csproj", diff --git a/src/Uno.UI.BindingHelper.Android/Uno.UI.BindingHelper.Android.csproj b/src/Uno.UI.BindingHelper.Android/Uno.UI.BindingHelper.Android.csproj index d35b1e299717..71af4d3016e5 100644 --- a/src/Uno.UI.BindingHelper.Android/Uno.UI.BindingHelper.Android.csproj +++ b/src/Uno.UI.BindingHelper.Android/Uno.UI.BindingHelper.Android.csproj @@ -1,6 +1,6 @@  - MonoAndroid90;net461;xamarinios10;netstandard2.0;xamarinmac20 + MonoAndroid90;MonoAndroid10.0;net461;xamarinios10;netstandard2.0;xamarinmac20 true 1701;1702;1705;109 @@ -10,7 +10,7 @@ false true - true + true <_isWindows>$([MSBuild]::IsOsPlatform(Windows)) @@ -28,12 +28,15 @@ - - 28.0.0.1 - - - 28.0.0.1 - + + + + + + + + + @@ -93,13 +96,8 @@ <_CompileUnoJavaAfterTargets Include="_ExtractLibraryProjectImports"/> - + + <_AndroidJar Include="%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\MonoAndroid\$(TargetFrameworkVersion)\mono.android.jar" /> @@ -121,7 +119,7 @@ <_flattenAndroidJar Condition="!$(_isWindows)">@(_AndroidJar, ':') <_flattenAndroidJar Condition="$(_isWindows)">@(_AndroidJar) - <_CompileCommand>"$(_JavaCBinPath)" -g -source $(_javaVersion) -d .\$(IntermediateOutputPath)\unoclasses -target $(_javaVersion) -J-Dfile.encoding=UTF8 -classpath "$(_flattenAndroidJar)" -bootclasspath "$(_AndroidSdkDirectory)platforms\android-$(_AndroidApiLevel)\android.jar" -encoding UTF-8 .\Uno\UI\*.java + <_CompileCommand>"$(_JavaCBinPath)" -g -source $(_javaVersion) -d .\$(IntermediateOutputPath)\unoclasses -target $(_javaVersion) -J-Dfile.encoding=UTF8 -classpath "$(_flattenAndroidJar)" -bootclasspath "$(_AndroidSdkDirectory)platforms\android-$(_AndroidApiLevel)\android.jar" -encoding UTF-8 .\Uno\UI\*.java diff --git a/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoMotionHelper.java b/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoMotionHelper.java index 7346c49bc575..35c86ed12328 100644 --- a/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoMotionHelper.java +++ b/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoMotionHelper.java @@ -448,7 +448,7 @@ private static final boolean isMotionInView(MotionEvent e, View view) { return false; } - final Rect clipBounds = android.support.v4.view.ViewCompat.getClipBounds(view); + final Rect clipBounds = androidx.core.view.ViewCompat.getClipBounds(view); if (clipBounds == null) { return true; } else{ diff --git a/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoRecyclerView.java b/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoRecyclerView.java index 4fed1046694b..1b6df571489b 100644 --- a/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoRecyclerView.java +++ b/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoRecyclerView.java @@ -2,7 +2,7 @@ import android.content.Context; import android.graphics.Matrix; -import android.support.v7.widget.RecyclerView; +import androidx.recyclerview.widget.RecyclerView; import android.view.*; import java.lang.*; diff --git a/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoTwoDScrollView.java b/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoTwoDScrollView.java index 45183156f38c..45d53ba5be7c 100644 --- a/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoTwoDScrollView.java +++ b/src/Uno.UI.BindingHelper.Android/Uno/UI/UnoTwoDScrollView.java @@ -41,7 +41,7 @@ import android.widget.LinearLayout; import android.widget.OverScroller; import android.widget.TextView; -import android.support.v4.widget.EdgeEffectCompat; +import androidx.core.widget.EdgeEffectCompat; import android.util.Log; /** diff --git a/src/Uno.UI.DualScreen/Uno.UI.DualScreen.csproj b/src/Uno.UI.DualScreen/Uno.UI.DualScreen.csproj index e810cf925141..73a64d62235e 100644 --- a/src/Uno.UI.DualScreen/Uno.UI.DualScreen.csproj +++ b/src/Uno.UI.DualScreen/Uno.UI.DualScreen.csproj @@ -1,7 +1,7 @@  - MonoAndroid90 - MonoAndroid90 + MonoAndroid10.0 + MonoAndroid90;MonoAndroid10.0 true @@ -41,7 +41,7 @@ - + diff --git a/src/Uno.UI.Maps/Uno.UI.Maps.csproj b/src/Uno.UI.Maps/Uno.UI.Maps.csproj index eafac773a53f..6a8d585e979c 100644 --- a/src/Uno.UI.Maps/Uno.UI.Maps.csproj +++ b/src/Uno.UI.Maps/Uno.UI.Maps.csproj @@ -1,7 +1,7 @@  - MonoAndroid90;xamarinios10 - MonoAndroid90;xamarinios10 + MonoAndroid10.0;xamarinios10 + MonoAndroid90;MonoAndroid10.0;xamarinios10 true @@ -41,7 +41,13 @@ - + + + + + + + diff --git a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj index a301b545b1b6..d6248c50fa52 100644 --- a/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj +++ b/src/Uno.UI.RemoteControl/Uno.UI.RemoteControl.csproj @@ -1,8 +1,8 @@  - xamarinmac20;xamarinios10;MonoAndroid90;netstandard2.0 - MonoAndroid90;xamarinios10;net461;netstandard2.0;xamarinmac20 + xamarinmac20;xamarinios10;MonoAndroid10.0;netstandard2.0 + MonoAndroid90;MonoAndroid10.0;xamarinios10;net461;netstandard2.0;xamarinmac20 diff --git a/src/Uno.UI.RuntimeTests/Uno.UI.RuntimeTests.csproj b/src/Uno.UI.RuntimeTests/Uno.UI.RuntimeTests.csproj index 569fb2b7e2f0..ce63ee3921b9 100644 --- a/src/Uno.UI.RuntimeTests/Uno.UI.RuntimeTests.csproj +++ b/src/Uno.UI.RuntimeTests/Uno.UI.RuntimeTests.csproj @@ -1,7 +1,7 @@  - netstandard2.0;xamarinios10;monoandroid90;xamarinmac20;uap10.0.17763 + netstandard2.0;xamarinios10;monoandroid10.0;xamarinmac20;uap10.0.17763 true diff --git a/src/Uno.UI.Toolkit/UIElementExtensions.cs b/src/Uno.UI.Toolkit/UIElementExtensions.cs index 4db24c50a0a4..c4320df06b5b 100644 --- a/src/Uno.UI.Toolkit/UIElementExtensions.cs +++ b/src/Uno.UI.Toolkit/UIElementExtensions.cs @@ -60,7 +60,7 @@ internal static void SetElevationInternal(this DependencyObject element, double #if __ANDROID__ if (element is Android.Views.View view) { - view.Elevation = (float)Uno.UI.ViewHelper.LogicalToPhysicalPixels(elevation); + AndroidX.Core.View.ViewCompat.SetElevation(view, (float)Uno.UI.ViewHelper.LogicalToPhysicalPixels(elevation)); } #elif __IOS__ if (element is UIKit.UIView view) diff --git a/src/Uno.UI.Toolkit/Uno.UI.Toolkit.csproj b/src/Uno.UI.Toolkit/Uno.UI.Toolkit.csproj index b1ed997e7902..d4df7e501e57 100644 --- a/src/Uno.UI.Toolkit/Uno.UI.Toolkit.csproj +++ b/src/Uno.UI.Toolkit/Uno.UI.Toolkit.csproj @@ -1,7 +1,7 @@  - xamarinmac20;MonoAndroid90;uap10.0.17763;xamarinios10;netstandard2.0 - MonoAndroid90;uap10.0.17763;xamarinios10;netstandard2.0;xamarinmac20 + xamarinmac20;MonoAndroid10.0;uap10.0.17763;xamarinios10;netstandard2.0 + MonoAndroid90;MonoAndroid10.0;uap10.0.17763;xamarinios10;netstandard2.0;xamarinmac20 @@ -42,18 +42,15 @@ - - 28.0.0.1 - none - - - 28.0.0.1 - none - - - 28.0.0.1 - none - + + + + + + + + + diff --git a/src/Uno.UI/BaseActivity.Android.cs b/src/Uno.UI/BaseActivity.Android.cs index 2b25922cb08b..c40957144b75 100644 --- a/src/Uno.UI/BaseActivity.Android.cs +++ b/src/Uno.UI/BaseActivity.Android.cs @@ -27,7 +27,7 @@ namespace Uno.UI | Android.Content.PM.ConfigChanges.ScreenSize )] #pragma warning disable 618 - public partial class BaseActivity : Android.Support.V7.App.AppCompatActivity, DependencyObject + public partial class BaseActivity : AndroidX.AppCompat.App.AppCompatActivity, DependencyObject #pragma warning restore 618 { diff --git a/src/Uno.UI/BaseFragment.Android.cs b/src/Uno.UI/BaseFragment.Android.cs index 8aa0005e844b..b18199bfcac6 100644 --- a/src/Uno.UI/BaseFragment.Android.cs +++ b/src/Uno.UI/BaseFragment.Android.cs @@ -9,7 +9,7 @@ using Uno.Disposables; using System.Runtime.CompilerServices; using System.Collections.Generic; -using Fragment = Android.Support.V4.App.Fragment; +using Fragment = AndroidX.Fragment.App.Fragment; namespace Uno.UI { diff --git a/src/Uno.UI/Controls/AppBarButtonRenderer.Android.cs b/src/Uno.UI/Controls/AppBarButtonRenderer.Android.cs index 585655f44af3..ffc50135cf92 100644 --- a/src/Uno.UI/Controls/AppBarButtonRenderer.Android.cs +++ b/src/Uno.UI/Controls/AppBarButtonRenderer.Android.cs @@ -1,5 +1,5 @@ #if __ANDROID__ -using Android.Support.V4.Graphics.Drawable; +using AndroidX.Core.Graphics.Drawable; using Android.Views; using System; using System.Collections.Generic; diff --git a/src/Uno.UI/Controls/BindableButton.Android.cs b/src/Uno.UI/Controls/BindableButton.Android.cs index b5fe21ba7970..fdff735ce850 100644 --- a/src/Uno.UI/Controls/BindableButton.Android.cs +++ b/src/Uno.UI/Controls/BindableButton.Android.cs @@ -20,7 +20,7 @@ namespace Uno.UI.Controls { - public partial class BindableButton : Android.Support.V7.Widget.AppCompatButton, DependencyObject + public partial class BindableButton : AndroidX.AppCompat.Widget.AppCompatButton, DependencyObject { private SerialDisposable _commandCanExecute = new SerialDisposable(); private CompositeDisposable _subscriptions = new CompositeDisposable(); @@ -143,4 +143,4 @@ private void ExecuteCommand(ICommand command, object parameter) command.Execute(parameter ?? default(object)); } } -} \ No newline at end of file +} diff --git a/src/Uno.UI/Controls/BindableCheckBox.Android.cs b/src/Uno.UI/Controls/BindableCheckBox.Android.cs index d53cb71ed4fe..df3854be03fa 100644 --- a/src/Uno.UI/Controls/BindableCheckBox.Android.cs +++ b/src/Uno.UI/Controls/BindableCheckBox.Android.cs @@ -9,7 +9,7 @@ namespace Uno.UI.Controls { - public partial class BindableCheckBox : Android.Support.V7.Widget.AppCompatCheckBox, INotifyPropertyChanged, DependencyObject + public partial class BindableCheckBox : AndroidX.AppCompat.Widget.AppCompatCheckBox, INotifyPropertyChanged, DependencyObject { public event PropertyChangedEventHandler PropertyChanged; diff --git a/src/Uno.UI/Controls/BindableDrawerLayout.Android.cs b/src/Uno.UI/Controls/BindableDrawerLayout.Android.cs index 141c7e0065b8..c86e37f4cec4 100644 --- a/src/Uno.UI/Controls/BindableDrawerLayout.Android.cs +++ b/src/Uno.UI/Controls/BindableDrawerLayout.Android.cs @@ -1,5 +1,4 @@ -using Android.Support.V4.Widget; -using System; +using System; using System.Collections.Generic; using System.Text; using Android.Runtime; @@ -15,6 +14,7 @@ using Uno.Extensions; using Windows.UI.Xaml.Media; using Size = Windows.Foundation.Size; +using AndroidX.DrawerLayout.Widget; namespace Uno.UI.Controls { diff --git a/src/Uno.UI/Controls/BindableFragment.Android.cs b/src/Uno.UI/Controls/BindableFragment.Android.cs index 5ab7b6193c56..daec4c988a97 100644 --- a/src/Uno.UI/Controls/BindableFragment.Android.cs +++ b/src/Uno.UI/Controls/BindableFragment.Android.cs @@ -9,9 +9,9 @@ using Android.Runtime; using Android.Views; using Android.Widget; -using Android.Support.V4.App; +using AndroidX.Fragment.App; using Uno.Extensions; -using Fragment = Android.Support.V4.App.Fragment; +using Fragment = AndroidX.Fragment.App.Fragment; using Windows.UI.Xaml.Data; using System.Runtime.CompilerServices; using Windows.UI.Xaml; diff --git a/src/Uno.UI/Controls/BindableItemsView.Android.cs b/src/Uno.UI/Controls/BindableItemsView.Android.cs index f2a99f7ce237..dee67343c203 100644 --- a/src/Uno.UI/Controls/BindableItemsView.Android.cs +++ b/src/Uno.UI/Controls/BindableItemsView.Android.cs @@ -11,7 +11,7 @@ using Android.Content; using Android.OS; using Android.Runtime; -using Android.Support.V4.App; +using AndroidX.Fragment.App; using Android.Views; using Android.Widget; using Android.Util; @@ -234,4 +234,4 @@ public ItemsSourceChangedEventArgs(IEnumerable source) } public IEnumerable ItemsSource { get; set; } } -} \ No newline at end of file +} diff --git a/src/Uno.UI/Controls/BindablePagerAdapter.Android.cs b/src/Uno.UI/Controls/BindablePagerAdapter.Android.cs index 9524758b2906..2ac3742a838d 100644 --- a/src/Uno.UI/Controls/BindablePagerAdapter.Android.cs +++ b/src/Uno.UI/Controls/BindablePagerAdapter.Android.cs @@ -9,7 +9,7 @@ using Android.Runtime; using Android.Views; using Android.Widget; -using Android.Support.V4.View; +using AndroidX.ViewPager.Widget; using Uno.Disposables; using System.Collections; using System.Collections.Specialized; @@ -191,4 +191,4 @@ public void OnClick(View v) } } } -} \ No newline at end of file +} diff --git a/src/Uno.UI/Controls/BindableRadioButton.Android.cs b/src/Uno.UI/Controls/BindableRadioButton.Android.cs index ee6e94fd5c9b..0d2f3d7f9879 100644 --- a/src/Uno.UI/Controls/BindableRadioButton.Android.cs +++ b/src/Uno.UI/Controls/BindableRadioButton.Android.cs @@ -10,7 +10,7 @@ namespace Uno.UI.Controls { - public partial class BindableRadioButton : Android.Support.V7.Widget.AppCompatRadioButton, DependencyObject, INotifyPropertyChanged + public partial class BindableRadioButton : AndroidX.AppCompat.Widget.AppCompatRadioButton, DependencyObject, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; diff --git a/src/Uno.UI/Controls/BindableSwitchCompat.Android.cs b/src/Uno.UI/Controls/BindableSwitchCompat.Android.cs index 6da26ccaf56e..7592d8056ab5 100644 --- a/src/Uno.UI/Controls/BindableSwitchCompat.Android.cs +++ b/src/Uno.UI/Controls/BindableSwitchCompat.Android.cs @@ -13,7 +13,7 @@ namespace Uno.UI.Controls { - public partial class BindableSwitchCompat : Android.Support.V7.Widget.SwitchCompat, DependencyObject + public partial class BindableSwitchCompat : AndroidX.AppCompat.Widget.SwitchCompat, DependencyObject { public BindableSwitchCompat() : base(ContextHelper.Current) @@ -26,8 +26,8 @@ public BindableSwitchCompat() // TextOn and TextOff properties must be set to an empty string or the following error will happen because the properties are null. // E / AndroidRuntime(6313): java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference // E / AndroidRuntime(6313): at android.text.StaticLayout.< init > (StaticLayout.java:49) - // E / AndroidRuntime(6313): at android.support.v7.widget.SwitchCompat.makeLayout(SwitchCompat.java:606) - // E / AndroidRuntime(6313): at android.support.v7.widget.SwitchCompat.onMeasure(SwitchCompat.java:526) + // E / AndroidRuntime(6313): at AndroidX.AppCompat.widget.SwitchCompat.makeLayout(SwitchCompat.java:606) + // E / AndroidRuntime(6313): at AndroidX.AppCompat.widget.SwitchCompat.onMeasure(SwitchCompat.java:526) // E / AndroidRuntime(6313): at android.view.View.measure(View.java:17547) TextOn = ""; @@ -76,13 +76,19 @@ private void OnThumbTintChanged(Brush newValue) { if (newValue is SolidColorBrush asColorBrush) { +#if __ANDROID_28__ +#pragma warning disable 618 // SetColorFilter is deprecated ThumbDrawable?.SetColorFilter(asColorBrush.ColorWithOpacity, PorterDuff.Mode.SrcIn); +#pragma warning restore 618 // SetColorFilter is deprecated +#else + ThumbDrawable?.SetColorFilter(new BlendModeColorFilter(asColorBrush.ColorWithOpacity, BlendMode.SrcIn)); +#endif } } - #endregion +#endregion - #region TrackTint DependencyProperty +#region TrackTint DependencyProperty /// /// The color used to tint the appearance of the track. @@ -100,11 +106,17 @@ private void OnTrackTintChanged(Brush newValue) { if (newValue is SolidColorBrush asColorBrush) { +#if __ANDROID_28__ +#pragma warning disable 618 // SetColorFilter is deprecated TrackDrawable?.SetColorFilter(asColorBrush.ColorWithOpacity, PorterDuff.Mode.SrcIn); +#pragma warning restore 618 // SetColorFilter is deprecated +#else + TrackDrawable?.SetColorFilter(new BlendModeColorFilter(asColorBrush.ColorWithOpacity, BlendMode.SrcIn)); +#endif } } - #endregion +#endregion private void OnCheckedChange(object sender, CheckedChangeEventArgs e) { diff --git a/src/Uno.UI/Controls/CommandBarRenderer.Android.cs b/src/Uno.UI/Controls/CommandBarRenderer.Android.cs index fe88c43bed58..3fa54d6171a9 100644 --- a/src/Uno.UI/Controls/CommandBarRenderer.Android.cs +++ b/src/Uno.UI/Controls/CommandBarRenderer.Android.cs @@ -1,6 +1,5 @@ #if __ANDROID__ using Android.Graphics.Drawables; -using Android.Support.V7.Widget; using Android.Views; using System; using System.Collections.Generic; @@ -14,14 +13,14 @@ using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; -using Android.Support.V4.Graphics.Drawable; -using Android.Support.V7.App; using Android.App; using Uno.Extensions; using Uno.Logging; using Microsoft.Extensions.Logging; using Android.Views.InputMethods; using Android.Content; +using AndroidX.AppCompat.Widget; +using AndroidX.Core.Graphics.Drawable; namespace Uno.UI.Controls { @@ -225,7 +224,7 @@ protected override void Render() } else { - Native.NavigationIcon = new Android.Support.V7.Graphics.Drawable.DrawerArrowDrawable(ContextHelper.Current) + Native.NavigationIcon = new AndroidX.AppCompat.Graphics.Drawable.DrawerArrowDrawable(ContextHelper.Current) { // 0 = menu icon // 1 = back icon @@ -239,7 +238,7 @@ protected override void Render() { switch (Native.NavigationIcon) { - case Android.Support.V7.Graphics.Drawable.DrawerArrowDrawable drawerArrowDrawable: + case AndroidX.AppCompat.Graphics.Drawable.DrawerArrowDrawable drawerArrowDrawable: drawerArrowDrawable.Color = (Android.Graphics.Color)backButtonForeground; break; case Drawable drawable: diff --git a/src/Uno.UI/Controls/NavigationAppBarButtonRenderer.Android.cs b/src/Uno.UI/Controls/NavigationAppBarButtonRenderer.Android.cs index d2e93bba7c84..f0751babbcd0 100644 --- a/src/Uno.UI/Controls/NavigationAppBarButtonRenderer.Android.cs +++ b/src/Uno.UI/Controls/NavigationAppBarButtonRenderer.Android.cs @@ -1,6 +1,6 @@ #if __ANDROID__ -using Android.Support.V4.Graphics.Drawable; -using Android.Support.V7.Widget; +using AndroidX.Core.Graphics.Drawable; +using AndroidX.AppCompat.Widget; using System; using System.Collections.Generic; using System.Text; diff --git a/src/Uno.UI/Controls/SlidingTabLayout.Android.cs b/src/Uno.UI/Controls/SlidingTabLayout.Android.cs index 4462bc6e3f04..60188cdd438e 100644 --- a/src/Uno.UI/Controls/SlidingTabLayout.Android.cs +++ b/src/Uno.UI/Controls/SlidingTabLayout.Android.cs @@ -1,5 +1,5 @@ using Android.Graphics; -using Android.Support.V4.View; +using AndroidX.ViewPager.Widget; using Android.Util; using Android.Views; using Android.Widget; diff --git a/src/Uno.UI/DrawableHelper.Android.cs b/src/Uno.UI/DrawableHelper.Android.cs index 48a546eb2c5b..062613fdc218 100644 --- a/src/Uno.UI/DrawableHelper.Android.cs +++ b/src/Uno.UI/DrawableHelper.Android.cs @@ -1,5 +1,4 @@ using Android.Graphics.Drawables; -using Android.Support.V4.Content; using System; using System.ComponentModel; using Windows.UI.Xaml.Media; diff --git a/src/Uno.UI/Extensions/FragmentManagerExtensions.Android.cs b/src/Uno.UI/Extensions/FragmentManagerExtensions.Android.cs index bd5f8e6da539..268b5f91e903 100644 --- a/src/Uno.UI/Extensions/FragmentManagerExtensions.Android.cs +++ b/src/Uno.UI/Extensions/FragmentManagerExtensions.Android.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Text; -using Android.Support.V4.App; +using AndroidX.Fragment.App; using Android.Content; using Android.OS; using Android.Runtime; diff --git a/src/Uno.UI/Extensions/PermissionsHelper.Android.cs b/src/Uno.UI/Extensions/PermissionsHelper.Android.cs index 9a73a8da3f0e..188c92feb261 100644 --- a/src/Uno.UI/Extensions/PermissionsHelper.Android.cs +++ b/src/Uno.UI/Extensions/PermissionsHelper.Android.cs @@ -5,8 +5,8 @@ using System.Threading; using System.Threading.Tasks; using Android.Content.PM; -using Android.Support.V4.App; -using Android.Support.V4.Content; +using AndroidX.Core.App; +using AndroidX.Core.Content; using Uno.Extensions; namespace Uno.UI.Extensions diff --git a/src/Uno.UI/Extensions/RecyclerExtensions.Android.cs b/src/Uno.UI/Extensions/RecyclerExtensions.Android.cs index 9354c71414bf..2c49498c79c0 100644 --- a/src/Uno.UI/Extensions/RecyclerExtensions.Android.cs +++ b/src/Uno.UI/Extensions/RecyclerExtensions.Android.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Android.Views; namespace Uno.UI.Extensions diff --git a/src/Uno.UI/Extensions/ToolbarExtensions.Android.cs b/src/Uno.UI/Extensions/ToolbarExtensions.Android.cs index cc2354180efa..9450f6fe73c9 100644 --- a/src/Uno.UI/Extensions/ToolbarExtensions.Android.cs +++ b/src/Uno.UI/Extensions/ToolbarExtensions.Android.cs @@ -8,7 +8,7 @@ namespace Uno.UI.Extensions { public static class ToolbarExtensions { - public static Android.Graphics.Color GetTitleTextColor(this Android.Support.V7.Widget.Toolbar toolbar) + public static Android.Graphics.Color GetTitleTextColor(this AndroidX.AppCompat.Widget.Toolbar toolbar) { try { diff --git a/src/Uno.UI/IFragmentTracker.Android.cs b/src/Uno.UI/IFragmentTracker.Android.cs index 5f0adfb9c76e..4e6f1f8e4369 100644 --- a/src/Uno.UI/IFragmentTracker.Android.cs +++ b/src/Uno.UI/IFragmentTracker.Android.cs @@ -2,7 +2,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Fragment = Android.Support.V4.App.Fragment; +using Fragment = AndroidX.Fragment.App.Fragment; namespace Uno.UI diff --git a/src/Uno.UI/Mixins/Android/FrameworkElementMixins.tt b/src/Uno.UI/Mixins/Android/FrameworkElementMixins.tt index f7c791f357a4..5912765dd537 100644 --- a/src/Uno.UI/Mixins/Android/FrameworkElementMixins.tt +++ b/src/Uno.UI/Mixins/Android/FrameworkElementMixins.tt @@ -8,7 +8,7 @@ AddClass("Windows.UI.Xaml.Controls", "Image", hasNewMaxWidthHeight: true, hasAutomationPeer: true, hasLayouter: true); AddClass("Uno.UI.Controls.Legacy", "HorizontalGridView"); AddClass("Uno.UI.Controls.Legacy", "HorizontalListView"); - AddClass("Windows.UI.Xaml.Controls", "ProgressRing"); + AddClass("Windows.UI.Xaml.Controls", "ProgressRing", hasNewMinWidthHeight: true, hasNewMaxWidthHeight: true); AddClass("Windows.UI.Xaml.Controls", "ScrollContentPresenter", callsBaseOnLayout: false, hasLayouter: true); AddClass("Windows.UI.Xaml.Controls", "NativePagedView", hasLayouter: true); AddClass("Windows.UI.Xaml.Controls", "TextBoxView", hasNewMinWidthHeight: true, hasNewMaxWidthHeight: true); diff --git a/src/Uno.UI/UI/Xaml/Controls/BorderLayerRenderer.Android.cs b/src/Uno.UI/UI/Xaml/Controls/BorderLayerRenderer.Android.cs index 95b5c32e65e6..8d571fcd4c97 100644 --- a/src/Uno.UI/UI/Xaml/Controls/BorderLayerRenderer.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/BorderLayerRenderer.Android.cs @@ -15,7 +15,7 @@ using System.Threading; using System.Threading.Tasks; using Uno.UI; -using Android.Support.V4.View; +using AndroidX.AppCompat.View; using System.Diagnostics; namespace Windows.UI.Xaml.Controls diff --git a/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipView.Android.cs b/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipView.Android.cs index 37051a948f75..f7f0d4dbd384 100644 --- a/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipView.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipView.Android.cs @@ -6,6 +6,7 @@ using Uno.Extensions; using Uno.UI.Extensions; using Windows.UI.Xaml.Controls.Primitives; +using AndroidX.ViewPager.Widget; namespace Windows.UI.Xaml.Controls { @@ -50,7 +51,7 @@ partial void OnSelectedIndexChangedPartial(int oldValue, int newValue, bool anim PagedView.SetCurrentItem(newValue, smoothScroll: animateChange); } - private class FlipViewPageChangeListener : Android.Support.V4.View.ViewPager.SimpleOnPageChangeListener + private class FlipViewPageChangeListener : ViewPager.SimpleOnPageChangeListener { private WeakReference _ownerReference; /// diff --git a/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipViewAdapter.Android.cs b/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipViewAdapter.Android.cs index 12469464cef0..842ca88da46c 100644 --- a/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipViewAdapter.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/FlipView/FlipViewAdapter.Android.cs @@ -1,5 +1,4 @@ -using Android.Support.V4.View; -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -9,6 +8,7 @@ using Uno.Extensions; using Uno.UI.Controls; using Uno.Extensions.Specialized; +using AndroidX.ViewPager.Widget; namespace Windows.UI.Xaml.Controls { diff --git a/src/Uno.UI/UI/Xaml/Controls/FlipView/NativePagedView.Android.cs b/src/Uno.UI/UI/Xaml/Controls/FlipView/NativePagedView.Android.cs index e1f1b1c9e6fc..11ef31eaa343 100644 --- a/src/Uno.UI/UI/Xaml/Controls/FlipView/NativePagedView.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/FlipView/NativePagedView.Android.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; -using Android.Support.V4.View; +using AndroidX.ViewPager.Widget; using Android.Views; using Windows.Foundation; using Uno.Extensions; diff --git a/src/Uno.UI/UI/Xaml/Controls/ItemsStackPanel/ItemsStackPanelLayout.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ItemsStackPanel/ItemsStackPanelLayout.Android.cs index 86e5566972f4..af62c153870e 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ItemsStackPanel/ItemsStackPanelLayout.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ItemsStackPanel/ItemsStackPanelLayout.Android.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Uno.UI; using Uno.UI.Extensions; using Windows.UI.Xaml.Controls.Primitives; diff --git a/src/Uno.UI/UI/Xaml/Controls/ItemsWrapGrid/ItemsWrapGridLayout.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ItemsWrapGrid/ItemsWrapGridLayout.Android.cs index 432f72ccef1a..0fc17c153090 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ItemsWrapGrid/ItemsWrapGridLayout.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ItemsWrapGrid/ItemsWrapGridLayout.Android.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using System.Drawing; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Android.Views; using Uno.Extensions; using Uno.UI; diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/BufferViewCache.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/BufferViewCache.Android.cs index 8d8b6e63263a..30ac44930b38 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/BufferViewCache.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/BufferViewCache.Android.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Android.Views; using Microsoft.Extensions.Logging; using Uno.Extensions; diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBase.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBase.Android.cs index fc403d7ba20a..ddad62531e5b 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBase.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBase.Android.cs @@ -10,7 +10,8 @@ using Uno.Logging; using Microsoft.Extensions.Logging; using System; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; +using AndroidX.AppCompat.Widget; using Windows.UI.Xaml.Data; using Windows.UI.Core; using Android.Views; diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.Android.cs index 7889a14e9bbf..2c86370f3d31 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.Android.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.AppCompat.Widget; using Android.Views; using Uno.Extensions; using Uno.UI; diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.SnapPoints.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.SnapPoints.Android.cs index a00cbbf45cbb..635425963c09 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.SnapPoints.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.SnapPoints.Android.cs @@ -3,11 +3,12 @@ using System; using System.Collections.Generic; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Android.Views; using Microsoft.Extensions.Logging; using Uno.Extensions; using Windows.UI.Xaml.Controls.Primitives; +using static AndroidX.RecyclerView.Widget.RecyclerView; namespace Windows.UI.Xaml.Controls { @@ -102,4 +103,4 @@ public override int FindTargetSnapPosition(LayoutManager layoutManager, int velo } } -#endif \ No newline at end of file +#endif diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBaseAdapter.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBaseAdapter.Android.cs index a17bba172667..60a23328e4fd 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBaseAdapter.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBaseAdapter.Android.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Android.Views; using Uno.Client; using Uno.Extensions; diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ScrollingViewCache.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ScrollingViewCache.Android.cs index 05bfad22f4ce..66988f575e71 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ScrollingViewCache.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/ScrollingViewCache.Android.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Android.Views; using Uno.Extensions; using Uno.Logging; diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/UnoViewHolder.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/UnoViewHolder.Android.cs index f9ee5dde2cb5..8f1c1cc5b513 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/UnoViewHolder.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/UnoViewHolder.Android.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; namespace Windows.UI.Xaml.Controls { diff --git a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelLayout.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelLayout.Android.cs index cfb892ed63a1..2918ba2193c5 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelLayout.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelLayout.Android.cs @@ -4,7 +4,7 @@ using Windows.Foundation; using System.Linq; using System.Text; -using Android.Support.V7.Widget; +using AndroidX.RecyclerView.Widget; using Android.Views; using Uno.Extensions; using Uno.UI; @@ -134,7 +134,7 @@ public override RecyclerView.LayoutParams GenerateDefaultLayoutParams() } /// - /// "Lay out all relevant child views from the given adapter." https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager.html#onLayoutChildren(android.support.v7.widget.RecyclerView.Recycler, android.support.v7.widget.RecyclerView.State) + /// "Lay out all relevant child views from the given adapter." https://developer.android.com/reference/AndroidX.RecyclerView.Widget/RecyclerView.LayoutManager.html#onLayoutChildren(AndroidX.RecyclerView.Widget.RecyclerView.Recycler, AndroidX.RecyclerView.Widget.RecyclerView.State) /// public override void OnLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { @@ -408,7 +408,7 @@ public override void OnMeasure(RecyclerView.Recycler recycler, RecyclerView.Stat } /// - /// "Offset all child views attached to the parent RecyclerView by dx pixels along the horizontal axis." https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager.html#offsetChildrenHorizontal(int) + /// "Offset all child views attached to the parent RecyclerView by dx pixels along the horizontal axis." https://developer.android.com/reference/AndroidX.RecyclerView.Widget/RecyclerView.LayoutManager.html#offsetChildrenHorizontal(int) /// public override void OffsetChildrenHorizontal(int dx) { @@ -418,7 +418,7 @@ public override void OffsetChildrenHorizontal(int dx) } /// - /// "Offset all child views attached to the parent RecyclerView by dy pixels along the vertical axis." https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager.html#offsetChildrenVertical(int) + /// "Offset all child views attached to the parent RecyclerView by dy pixels along the vertical axis." https://developer.android.com/reference/AndroidX.RecyclerView.Widget/RecyclerView.LayoutManager.html#offsetChildrenVertical(int) /// public override void OffsetChildrenVertical(int dy) { diff --git a/src/Uno.UI/UI/Xaml/Controls/Pivot/ExtendedViewPager.Android.cs b/src/Uno.UI/UI/Xaml/Controls/Pivot/ExtendedViewPager.Android.cs index ea10e392ab32..637860953b77 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Pivot/ExtendedViewPager.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Pivot/ExtendedViewPager.Android.cs @@ -1,7 +1,7 @@ using Android.Content; using Android.Graphics; using Android.Runtime; -using Android.Support.V4.View; +using AndroidX.ViewPager.Widget; using Android.Util; using Android.Views; using Uno.UI; diff --git a/src/Uno.UI/UI/Xaml/Controls/Pivot/NativePivotPresenter.Android.cs b/src/Uno.UI/UI/Xaml/Controls/Pivot/NativePivotPresenter.Android.cs index 1f29c006fc59..d537bce38f08 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Pivot/NativePivotPresenter.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Pivot/NativePivotPresenter.Android.cs @@ -1,7 +1,7 @@ using Android.App; using Android.Graphics; -using Android.Support.V4.App; -using Android.Support.V4.View; +using AndroidX.ViewPager.Widget; +using AndroidX.Fragment.App; using Android.Util; using Android.Views; using Uno.Extensions; diff --git a/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotAdapter.Android.cs b/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotAdapter.Android.cs index 1a28100a10ae..ec45428dde4b 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotAdapter.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotAdapter.Android.cs @@ -1,5 +1,5 @@ using Android.App; -using Android.Support.V4.App; +using AndroidX.Fragment.App; using Uno.Extensions; using System; using System.Collections.Generic; @@ -12,7 +12,8 @@ public class PivotAdapter : FragmentPagerAdapter private readonly NativePivotPresenter _pivot; private List _fragments; - public PivotAdapter(Android.Support.V4.App.FragmentManager fragmentManager, NativePivotPresenter pivot) +#pragma warning disable CS0618 // Type or member is obsolete + public PivotAdapter(AndroidX.Fragment.App.FragmentManager fragmentManager, NativePivotPresenter pivot) : base(fragmentManager) { if (pivot == null) @@ -24,9 +25,10 @@ public PivotAdapter(Android.Support.V4.App.FragmentManager fragmentManager, Nati _fragments = new List(); } - public PivotAdapter(Android.Support.V4.App.FragmentManager fm) : base(fm) + public PivotAdapter(AndroidX.Fragment.App.FragmentManager fm) : base(fm) { } +#pragma warning restore CS0618 // Type or member is obsolete public void OnDataContextChanged() { @@ -43,7 +45,7 @@ public override void NotifyDataSetChanged() base.NotifyDataSetChanged(); } - public override Android.Support.V4.App.Fragment GetItem(int position) + public override AndroidX.Fragment.App.Fragment GetItem(int position) { return _fragments[position]; } diff --git a/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotItemFragment.Android.cs b/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotItemFragment.Android.cs index 573a51d9bb29..4529bc6c6df5 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotItemFragment.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Pivot/PivotItemFragment.Android.cs @@ -1,5 +1,5 @@ using Android.OS; -using Android.Support.V4.App; +using AndroidX.Fragment.App; using Android.Views; using Uno.Extensions; using System; @@ -58,7 +58,7 @@ public override View OnCreateView(LayoutInflater inflater, ViewGroup container, return _item; } - +#pragma warning disable CS0618 // Type or member is obsolete private void Update() { if (UserVisibleHint && _created && _item != null) @@ -68,6 +68,7 @@ private void Update() } } +#pragma warning disable CS0672 // Member overrides obsolete member public override bool UserVisibleHint { get { return base.UserVisibleHint; } @@ -77,5 +78,7 @@ public override bool UserVisibleHint Update(); } } +#pragma warning restore CS0672 // Member overrides obsolete member +#pragma warning restore CS0618 // Type or member is obsolete } } diff --git a/src/Uno.UI/UI/Xaml/Controls/ProgressRing/ProgressRing.Android.cs b/src/Uno.UI/UI/Xaml/Controls/ProgressRing/ProgressRing.Android.cs index 0d091723ac8a..0786dd2ac925 100644 --- a/src/Uno.UI/UI/Xaml/Controls/ProgressRing/ProgressRing.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/ProgressRing/ProgressRing.Android.cs @@ -31,7 +31,13 @@ private static void OnForegroundChanged(DependencyObject dependencyObject, Depen if (progressRing != null && foregroundColor != null) { +#if __ANDROID_28__ +#pragma warning disable 618 // SetColorFilter is deprecated progressRing.IndeterminateDrawable?.SetColorFilter(foregroundColor.Color, PorterDuff.Mode.SrcIn); +#pragma warning restore 618 // SetColorFilter is deprecated +#else + progressRing.IndeterminateDrawable?.SetColorFilter(new BlendModeColorFilter(foregroundColor.Color, BlendMode.SrcIn)); +#endif } } diff --git a/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.Android.cs b/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.Android.cs index e15f64f68ae7..d221ded2e238 100644 --- a/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.Android.cs +++ b/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.Android.cs @@ -18,6 +18,8 @@ using Windows.UI.Xaml.Input; using Uno.UI.Extensions; using Uno.UI.DataBinding; +using AndroidX.Core.Content; +using AndroidX.Core.Graphics; namespace Windows.UI.Xaml.Controls { @@ -159,21 +161,42 @@ public static void SetCursorColor(EditText editText, Color color) var mCursorDrawableRes = _cursorDrawableResField.GetInt(editText); var editor = _editorField.Get(editText); + +#if __ANDROID_28__ +#pragma warning disable 618 // SetColorFilter is deprecated if ((int)Build.VERSION.SdkInt < 28) // 28 means BuildVersionCodes.P { var drawables = new Drawable[2]; - drawables[0] = Android.Support.V4.Content.ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); - drawables[1] = Android.Support.V4.Content.ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); + drawables[0] = ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); + drawables[1] = ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); drawables[0].SetColorFilter(color, PorterDuff.Mode.SrcIn); drawables[1].SetColorFilter(color, PorterDuff.Mode.SrcIn); _cursorDrawableField.Set(editor, drawables); } else { - var drawable = Android.Support.V4.Content.ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); + var drawable = ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); drawable.SetColorFilter(color, PorterDuff.Mode.SrcIn); _cursorDrawableField.Set(editor, drawable); } +#pragma warning restore 618 // SetColorFilter is deprecated +#else + if ((int)Build.VERSION.SdkInt < 28) // 28 means BuildVersionCodes.P + { + var drawables = new Drawable[2]; + drawables[0] = ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); + drawables[1] = ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); + drawables[0].SetColorFilter(new BlendModeColorFilterCompat(color, BlendModeCompat.SrcIn)); + drawables[1].SetColorFilter(new BlendModeColorFilterCompat(color, BlendModeCompat.SrcIn)); + _cursorDrawableField.Set(editor, drawables); + } + else + { + var drawable = ContextCompat.GetDrawable(editText.Context, mCursorDrawableRes); + drawable.SetColorFilter(new BlendModeColorFilterCompat(color, BlendModeCompat.SrcIn)); + _cursorDrawableField.Set(editor, drawable); + } +#endif } catch (Exception) { diff --git a/src/Uno.UI/UI/Xaml/IFrameworkElementImplementation.Android.tt b/src/Uno.UI/UI/Xaml/IFrameworkElementImplementation.Android.tt index 89cf7e953521..74556cd1b0d3 100644 --- a/src/Uno.UI/UI/Xaml/IFrameworkElementImplementation.Android.tt +++ b/src/Uno.UI/UI/Xaml/IFrameworkElementImplementation.Android.tt @@ -4,6 +4,7 @@ <#@ import namespace="System.Collections.Generic" #> #pragma warning disable 108 +#pragma warning disable 109 // The member does not hide an accessible member. The new keyword is not required. using Android.Runtime; using Android.Views; diff --git a/src/Uno.UI/UI/Xaml/UIElement.Android.cs b/src/Uno.UI/UI/Xaml/UIElement.Android.cs index bed37b712323..ce2466f2f303 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.Android.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.Android.cs @@ -5,8 +5,9 @@ using System; using System.Collections.Generic; using System.Linq; +using AndroidX.Core.View; +using Windows.Foundation; using Windows.UI.Xaml.Controls; -using Android.Support.V4.View; using Windows.UI.Xaml.Media; using Android.Graphics; using Android.Views; diff --git a/src/Uno.UI/Uno.UI.csproj b/src/Uno.UI/Uno.UI.csproj index 9dce574f110f..4df7afaef2f1 100644 --- a/src/Uno.UI/Uno.UI.csproj +++ b/src/Uno.UI/Uno.UI.csproj @@ -1,7 +1,7 @@ - xamarinmac20;MonoAndroid90;xamarinios10;net461;netstandard2.0 - MonoAndroid90;xamarinios10;net461;netstandard2.0;xamarinmac20 + xamarinmac20;MonoAndroid10.0;xamarinios10;net461;netstandard2.0 + MonoAndroid90;MonoAndroid10.0;xamarinios10;net461;netstandard2.0;xamarinmac20 @@ -167,15 +167,17 @@ - - none - - - none - - - none - + + + + + + + + + + + @@ -190,7 +192,7 @@ false - + false diff --git a/src/Uno.UWP/ApplicationModel/PackageId.Android.cs b/src/Uno.UWP/ApplicationModel/PackageId.Android.cs index fbac5a6781a2..892158675f20 100644 --- a/src/Uno.UWP/ApplicationModel/PackageId.Android.cs +++ b/src/Uno.UWP/ApplicationModel/PackageId.Android.cs @@ -43,7 +43,7 @@ public PackageVersion Version private long GetVersionCode() { #if __ANDROID_28__ - return Android.Support.V4.Content.PM.PackageInfoCompat.GetLongVersionCode(_packageInfo); + return AndroidX.Core.Content.PM.PackageInfoCompat.GetLongVersionCode(_packageInfo); #else return _packageInfo.VersionCode; #endif diff --git a/src/Uno.UWP/Devices/Lights/Lamp.Android.cs b/src/Uno.UWP/Devices/Lights/Lamp.Android.cs index eae2c358ccff..a3f5590a46db 100644 --- a/src/Uno.UWP/Devices/Lights/Lamp.Android.cs +++ b/src/Uno.UWP/Devices/Lights/Lamp.Android.cs @@ -143,7 +143,9 @@ public void Dispose() { lock (_lock) { +#pragma warning disable CS0618 // Type or member is obsolete _camera?.Release(); +#pragma warning restore CS0618 // Type or member is obsolete _camera?.Dispose(); _camera = null; _surfaceTexture?.Dispose(); diff --git a/src/Uno.UWP/Extensions/PermissionsHelper.cs b/src/Uno.UWP/Extensions/PermissionsHelper.cs index 5d9dd0f20ec2..a1055297d4ef 100644 --- a/src/Uno.UWP/Extensions/PermissionsHelper.cs +++ b/src/Uno.UWP/Extensions/PermissionsHelper.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Android; using Android.Content.PM; -using Android.Support.V4.App; using Uno; using Uno.Extensions; using Uno.UI; diff --git a/src/Uno.UWP/Helpers/Activities/AwaitableResultActivity.cs b/src/Uno.UWP/Helpers/Activities/AwaitableResultActivity.cs index 4fce8d89c940..97bf407f2c84 100644 --- a/src/Uno.UWP/Helpers/Activities/AwaitableResultActivity.cs +++ b/src/Uno.UWP/Helpers/Activities/AwaitableResultActivity.cs @@ -7,7 +7,7 @@ using Android.Content; using Android.Content.PM; using Android.Runtime; -using Android.Support.V4.App; +using AndroidX.Fragment.App; using Uno.UI; namespace Uno.Helpers.Activities diff --git a/src/Uno.UWP/Helpers/DrawableHelper.Android.cs b/src/Uno.UWP/Helpers/DrawableHelper.Android.cs index 689e323f7505..658dc3d1404d 100644 --- a/src/Uno.UWP/Helpers/DrawableHelper.Android.cs +++ b/src/Uno.UWP/Helpers/DrawableHelper.Android.cs @@ -1,6 +1,7 @@ #if __ANDROID__ using Android.Graphics.Drawables; -using Android.Support.V4.Content; +using AndroidX.Core.Content; +using AndroidX.Core.Graphics.Drawable; using System; using System.Collections.Generic; using System.Linq; @@ -67,7 +68,7 @@ public static Drawable FromUri(Uri uri) if (drawable != null) { // Makes the drawable compatible with DrawableCompat pre-Lollipop. - drawable = Android.Support.V4.Graphics.Drawable.DrawableCompat.Wrap(drawable); + drawable = DrawableCompat.Wrap(drawable); drawable = drawable.Mutate(); } diff --git a/src/Uno.UWP/Media/Capture/CameraCaptureUI.Android.cs b/src/Uno.UWP/Media/Capture/CameraCaptureUI.Android.cs index 03fdcf4aa9b9..bfce5e811c14 100644 --- a/src/Uno.UWP/Media/Capture/CameraCaptureUI.Android.cs +++ b/src/Uno.UWP/Media/Capture/CameraCaptureUI.Android.cs @@ -8,7 +8,7 @@ using Android.Content.PM; using Android.Provider; using Android.Runtime; -using Android.Support.V4.App; +using AndroidX.Fragment.App; using Microsoft.Extensions.Logging; using Uno.Extensions; using Uno.UI; diff --git a/src/Uno.UWP/Phone/Devices/Notification/VibrationDevice.Android.cs b/src/Uno.UWP/Phone/Devices/Notification/VibrationDevice.Android.cs index cccebdfea576..19c06227a515 100644 --- a/src/Uno.UWP/Phone/Devices/Notification/VibrationDevice.Android.cs +++ b/src/Uno.UWP/Phone/Devices/Notification/VibrationDevice.Android.cs @@ -5,7 +5,7 @@ using Android.App; using Android.Content; using Android.OS; -using Android.Support.V4.Content; +using AndroidX.Core.Content; namespace Windows.Phone.Devices.Notification { diff --git a/src/Uno.UWP/Storage/ApplicationDataContainer.Android.cs b/src/Uno.UWP/Storage/ApplicationDataContainer.Android.cs index 6818a57c695e..9a185e763e13 100644 --- a/src/Uno.UWP/Storage/ApplicationDataContainer.Android.cs +++ b/src/Uno.UWP/Storage/ApplicationDataContainer.Android.cs @@ -26,7 +26,9 @@ private class SharedPreferencesPropertySet : IPropertySet public SharedPreferencesPropertySet() { +#pragma warning disable 618 _preferences = PreferenceManager.GetDefaultSharedPreferences(ApplicationData.GetAndroidAppContext()); +#pragma warning restore 618 } public object this[string key] diff --git a/src/Uno.UWP/Storage/KnownFolders.Android.cs b/src/Uno.UWP/Storage/KnownFolders.Android.cs index 6a145c7fc059..5ad5622cf546 100644 --- a/src/Uno.UWP/Storage/KnownFolders.Android.cs +++ b/src/Uno.UWP/Storage/KnownFolders.Android.cs @@ -4,7 +4,11 @@ namespace Windows.Storage { public static partial class KnownFolders { - internal static StorageFolder FolderFromAndroidName(string name) => new StorageFolder(Android.OS.Environment.GetExternalStoragePublicDirectory(name).CanonicalPath); + internal static StorageFolder FolderFromAndroidName(string name) +#pragma warning disable CS0618 // Type or member is obsolete + => new StorageFolder(Android.OS.Environment.GetExternalStoragePublicDirectory(name).CanonicalPath); +#pragma warning restore CS0618 // Type or member is obsolete + public static StorageFolder MusicLibrary => FolderFromAndroidName(Android.OS.Environment.DirectoryMusic); public static StorageFolder VideosLibrary => FolderFromAndroidName(Android.OS.Environment.DirectoryMovies); diff --git a/src/Uno.UWP/UI/Popups/MessageDialog.Android.cs b/src/Uno.UWP/UI/Popups/MessageDialog.Android.cs index 09d9c8ac1d44..d74723785ab4 100644 --- a/src/Uno.UWP/UI/Popups/MessageDialog.Android.cs +++ b/src/Uno.UWP/UI/Popups/MessageDialog.Android.cs @@ -42,7 +42,7 @@ public IAsyncOperation ShowAsync() ButtonType = GetDialogButtonType(index) }) .Aggregate( - new global::Android.Support.V7.App.AlertDialog.Builder(ContextHelper.Current) + new global::AndroidX.AppCompat.App.AlertDialog.Builder(ContextHelper.Current) .SetTitle(Title ?? "") .SetMessage(Content ?? "") .SetOnCancelListener(new DialogListener(this, invokedCommand)) @@ -117,4 +117,4 @@ public void OnDismiss(IDialogInterface dialog) } } } -#endif \ No newline at end of file +#endif diff --git a/src/Uno.UWP/Uno.csproj b/src/Uno.UWP/Uno.csproj index 3013e6fed713..ad3604b0ae45 100644 --- a/src/Uno.UWP/Uno.csproj +++ b/src/Uno.UWP/Uno.csproj @@ -1,8 +1,8 @@  - xamarinmac20;xamarinios10;MonoAndroid90;net461;netstandard2.0 - MonoAndroid90;xamarinios10;net461;netstandard2.0;xamarinmac20 + xamarinmac20;xamarinios10;MonoAndroid10.0;net461;netstandard2.0 + MonoAndroid90;MonoAndroid10.0;xamarinios10;net461;netstandard2.0;xamarinmac20 @@ -47,14 +47,14 @@ - - 28.0.0.1 - none - - - 28.0.0.1 - none - + + + + + + + + diff --git a/src/Uno.UWPSyncGenerator/Generator.cs b/src/Uno.UWPSyncGenerator/Generator.cs index bfb9d4f100bb..9b3833ead2bb 100644 --- a/src/Uno.UWPSyncGenerator/Generator.cs +++ b/src/Uno.UWPSyncGenerator/Generator.cs @@ -50,7 +50,7 @@ public virtual void Build(string basePath, string baseName, string sourceAssembl _referenceCompilation = LoadProject(@"..\..\..\..\Uno.UWPSyncGenerator.Reference\Uno.UWPSyncGenerator.Reference.csproj"); _iOSCompilation = LoadProject($@"{basePath}\{baseName}.csproj", "xamarinios10"); - _androidCompilation = LoadProject($@"{basePath}\{baseName}.csproj", "MonoAndroid90"); + _androidCompilation = LoadProject($@"{basePath}\{baseName}.csproj", "MonoAndroid10.0"); _net461Compilation = LoadProject($@"{basePath}\{baseName}.csproj", "net461"); _wasmCompilation = LoadProject($@"{basePath}\{baseName}.csproj", "netstandard2.0"); _macCompilation = LoadProject($@"{basePath}\{baseName}.csproj", "xamarinmac20"); diff --git a/src/crosstargeting_override.props.sample b/src/crosstargeting_override.props.sample index 5dfb612cd269..9b2aaff77ee1 100644 --- a/src/crosstargeting_override.props.sample +++ b/src/crosstargeting_override.props.sample @@ -19,7 +19,7 @@ Available build targets: uap10.0.17763 (Windows) xamarinios10 (iOS) - MonoAndroid90 (Android 9.0) + MonoAndroid10.0 (Android 10.0) netstandard2.0 (WebAssembly) xamarinmac20 (macOS) net461 (Tests)