Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 25bc636

Browse files
Enable Nullability for Android, GTK, iOS, Tizen, UWP & WPF Sample Projects (#1015)
* Enable Nullable on Unit Tests * Enable Nullable on Xamarin.CommunityToolkit.Markup * Enable Nullable on Xamarin.CommunityToolkit.Sample * Enable Nullable on Android, GTK, iOS and Tizen Samples * Enable Nullable for UWP & WPF Sample Projects
1 parent 1e07fe6 commit 25bc636

8 files changed

+24
-3
lines changed

samples/XCT.Sample.Android/SplashActivity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Xamarin.CommunityToolkit.Sample.Droid
99
[Activity(Label = "XamarinCommunityToolkitSample", Icon = "@mipmap/icon", Theme = "@style/SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
1010
public class SplashActivity : AppCompatActivity
1111
{
12-
protected override void OnCreate(Bundle savedInstanceState)
12+
protected override void OnCreate(Bundle? savedInstanceState)
1313
{
1414
base.OnCreate(savedInstanceState);
1515
var intent = new Intent(this, typeof(MainActivity));

samples/XCT.Sample.Android/Xamarin.CommunityToolkit.Sample.Android.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
2323
<NuGetPackageImportStamp>
2424
</NuGetPackageImportStamp>
25+
<Nullable>enable</Nullable>
26+
<WarningsAsErrors>nullable</WarningsAsErrors>
27+
<LangVersion>latest</LangVersion>
2528
</PropertyGroup>
2629
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2730
<DebugSymbols>true</DebugSymbols>

samples/XCT.Sample.GTK/Xamarin.CommunityToolkit.Sample.GTK.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
<FileAlignment>512</FileAlignment>
1414
<Deterministic>true</Deterministic>
1515
<TargetFrameworkProfile />
16+
<Nullable>enable</Nullable>
17+
<WarningsAsErrors>nullable</WarningsAsErrors>
18+
<LangVersion>latest</LangVersion>
1619
</PropertyGroup>
1720
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1821
<DebugSymbols>true</DebugSymbols>

samples/XCT.Sample.Tizen/Xamarin.CommunityToolkit.Sample.Tizen.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>tizen40</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<WarningsAsErrors>nullable</WarningsAsErrors>
8+
<LangVersion>latest</LangVersion>
69
</PropertyGroup>
710

811
<ItemGroup>

samples/XCT.Sample.UWP/Xamarin.CommunityToolkit.Sample.UWP.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<FileAlignment>512</FileAlignment>
1919
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
2020
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
21+
<Nullable>enable</Nullable>
22+
<WarningsAsErrors>nullable</WarningsAsErrors>
23+
<LangVersion>latest</LangVersion>
2124
</PropertyGroup>
2225
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
2326
<DebugSymbols>true</DebugSymbols>

samples/XCT.Sample.WPF/Xamarin.CommunityToolkit.Sample.WPF.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<Deterministic>true</Deterministic>
1717
<NuGetPackageImportStamp>
1818
</NuGetPackageImportStamp>
19+
<Nullable>enable</Nullable>
20+
<WarningsAsErrors>nullable</WarningsAsErrors>
21+
<LangVersion>latest</LangVersion>
1922
</PropertyGroup>
2023
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2124
<PlatformTarget>AnyCPU</PlatformTarget>

samples/XCT.Sample.iOS/Renderers/NoLineNavigationRenderer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ public override void ViewWillAppear(bool animated)
2525
// Newest iOS version fix - trycatch isn't optimal
2626
try
2727
{
28-
NavigationBar.ScrollEdgeAppearance.ShadowImage = new UIKit.UIImage();
29-
NavigationBar.ScrollEdgeAppearance.ShadowColor = null;
28+
if (NavigationBar.ScrollEdgeAppearance != null)
29+
{
30+
NavigationBar.ScrollEdgeAppearance.ShadowImage = new UIKit.UIImage();
31+
NavigationBar.ScrollEdgeAppearance.ShadowColor = null;
32+
}
3033
}
3134
catch (Exception)
3235
{

samples/XCT.Sample.iOS/Xamarin.CommunityToolkit.Sample.iOS.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
1616
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
1717
<ProvisioningType>automatic</ProvisioningType>
18+
<Nullable>enable</Nullable>
19+
<WarningsAsErrors>nullable</WarningsAsErrors>
20+
<LangVersion>latest</LangVersion>
1821
</PropertyGroup>
1922
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
2023
<DebugSymbols>true</DebugSymbols>

0 commit comments

Comments
 (0)