Skip to content

Commit 6dd0924

Browse files
committed
Upgrade to .NET 8.0
1 parent 9aac364 commit 6dd0924

27 files changed

+314
-399
lines changed

CameraUtils/CameraUtils.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0-android</TargetFramework>
3+
<TargetFramework>net8.0-android</TargetFramework>
44
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
55
<Nullable>disable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>

CameraXBasic/CameraXBasic.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0-android</TargetFramework>
3+
<TargetFramework>net8.0-android</TargetFramework>
44
<SupportedOSPlatformVersion>28</SupportedOSPlatformVersion>
55
<OutputType>Exe</OutputType>
66
<Nullable>disable</Nullable>
@@ -11,10 +11,10 @@
1111
</PropertyGroup>
1212
<ItemGroup>
1313
<PackageReference Include="Xamarin.Android.Glide" Version="4.16.0.2" />
14-
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.3.1" />
15-
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.1" />
16-
<PackageReference Include="Xamarin.AndroidX.Navigation.Fragment" Version="2.7.6" />
17-
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.2" />
18-
<PackageReference Include="Xamarin.KotlinX.Coroutines.Core" Version="1.7.3.3" />
14+
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.3.2" />
15+
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.2" />
16+
<PackageReference Include="Xamarin.AndroidX.Navigation.Fragment" Version="2.7.7.1" />
17+
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.3" />
18+
<PackageReference Include="Xamarin.KotlinX.Coroutines.Core" Version="1.8.0.1" />
1919
</ItemGroup>
2020
</Project>

CameraXBasic/Fragments/CameraFragment.cs

+2
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,15 @@ public void OnClick(View v)
517517
.Format(JavaSystem.CurrentTimeMillis());
518518
var contentValues = new ContentValues();
519519
#pragma warning disable 0618
520+
#pragma warning disable CA1416
520521
contentValues.Put(MediaStore.MediaColumns.DisplayName, name);
521522
contentValues.Put(MediaStore.MediaColumns.MimeType, PhotoType);
522523
if (Build.VERSION.SdkInt > BuildVersionCodes.P)
523524
{
524525
var appName = RequireContext().Resources.GetString(Resource.String.app_name);
525526
contentValues.Put(MediaStore.MediaColumns.RelativePath, "Pictures/" + appName);
526527
}
528+
#pragma warning restore CA1416
527529
#pragma warning restore 0618
528530

529531
// Create output options object which contains file + metadata

CameraXBasic/Utils/MediaStoreUtils.cs

+2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public MediaStoreUtils(Context context)
1414

1515
MediaStoreCollection =
1616
Build.VERSION.SdkInt >= BuildVersionCodes.Q ?
17+
#pragma warning disable CA1416
1718
MediaStore.Images.Media.GetContentUri(MediaStore.VolumeExternal) :
19+
#pragma warning restore CA1416
1820
Uri.FromFile(context.GetExternalFilesDir(null));
1921
}
2022
Context context;

CameraXBasic/Utils/ViewExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,11 @@ private static void HideSystemUI(this Window window)
9696
SystemUiFlags.ImmersiveSticky |
9797
SystemUiFlags.LayoutHideNavigation |
9898
SystemUiFlags.HideNavigation;
99+
#pragma warning disable 618
99100
#pragma warning disable CA1422
100101
window.DecorView.SystemUiVisibility = (StatusBarVisibility)fullscreenFlags;
101102
#pragma warning restore CA1422
103+
#pragma warning restore 618
102104
}
103105
}
104106
}
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0-android</TargetFramework>
3+
<TargetFramework>net8.0-android</TargetFramework>
44
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
55
<OutputType>Exe</OutputType>
66
<Nullable>disable</Nullable>
@@ -10,9 +10,9 @@
1010
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.2" />
14-
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.1" />
15-
<PackageReference Include="Xamarin.AndroidX.Camera.Extensions" Version="1.3.1" />
16-
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.2" />
13+
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.2.1" />
14+
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.2" />
15+
<PackageReference Include="Xamarin.AndroidX.Camera.Extensions" Version="1.3.2" />
16+
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.3" />
1717
</ItemGroup>
1818
</Project>

CameraXMlKit/CameraXMlKit.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0-android</TargetFramework>
3+
<TargetFramework>net8.0-android</TargetFramework>
44
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
55
<OutputType>Exe</OutputType>
66
<Nullable>disable</Nullable>

CameraXTfLite/CameraXTfLite.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0-android</TargetFramework>
4-
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
3+
<TargetFramework>net8.0-android</TargetFramework>
4+
<SupportedOSPlatformVersion>24</SupportedOSPlatformVersion>
55
<OutputType>Exe</OutputType>
66
<Nullable>disable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
@@ -11,9 +11,9 @@
1111
<AndroidStoreUncompressedFileExtensions>tflite</AndroidStoreUncompressedFileExtensions>
1212
</PropertyGroup>
1313
<ItemGroup>
14-
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.3.1" />
15-
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.1" />
16-
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.2" />
14+
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.3.2" />
15+
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.2" />
16+
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.3" />
1717
<PackageReference Include="TensorFlow.Lite.Support" Version="0.4.4" />
1818
<PackageReference Include="TensorFlow.Lite.Metadata" Version="0.4.4" />
1919
</ItemGroup>

CameraXVideo/CameraXVideo.csproj

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0-android</TargetFramework>
3+
<TargetFramework>net8.0-android</TargetFramework>
44
<SupportedOSPlatformVersion>24</SupportedOSPlatformVersion>
55
<OutputType>Exe</OutputType>
66
<Nullable>disable</Nullable>
@@ -10,11 +10,11 @@
1010
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.3.1" />
14-
<PackageReference Include="Xamarin.AndroidX.Camera.Video" Version="1.3.1" />
15-
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.1" />
16-
<PackageReference Include="Xamarin.AndroidX.Navigation.Fragment" Version="2.7.6" />
17-
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.2" />
18-
<PackageReference Include="Xamarin.KotlinX.Coroutines.Core" Version="1.7.3.3" />
13+
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.3.2" />
14+
<PackageReference Include="Xamarin.AndroidX.Camera.Video" Version="1.3.2" />
15+
<PackageReference Include="Xamarin.AndroidX.Camera.View" Version="1.3.2" />
16+
<PackageReference Include="Xamarin.AndroidX.Navigation.Fragment" Version="2.7.7.1" />
17+
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.10.0.3" />
18+
<PackageReference Include="Xamarin.KotlinX.Coroutines.Core" Version="1.8.0.1" />
1919
</ItemGroup>
2020
</Project>

HdrViewfinder/Properties/AndroidManifest.xml HdrViewfinder/AndroidManifest.xml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
<uses-permission android:name="android.permission.CAMERA"/>
2929
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
30-
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
3130

3231
<application
3332
android:allowBackup="true"

HdrViewfinder/CameraOps.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Collections.Generic;
2-
using Android.Hardware.Camera2;
1+
using Android.Hardware.Camera2;
32
using Android.OS;
43
using Android.Util;
54
using Android.Views;
@@ -192,8 +191,10 @@ private void StartCameraSession()
192191

193192
try
194193
{
194+
#pragma warning disable CA1422
195195
mCameraDevice.CreateCaptureSession(
196196
mSurfaces, mCameraSessionListener, mCameraHandler);
197+
#pragma warning restore CA1422
197198
}
198199
catch (CameraAccessException e)
199200
{
+11-84
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,20 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
32
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{D699D5F6-F7C7-41BC-9A82-8CE6E29A4F47}</ProjectGuid>
9-
<ProjectTypeGuids>{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
10-
<TemplateGuid>{77efb91c-a7e9-4b0e-a7c5-31eeec3c6d46}</TemplateGuid>
11-
<OutputType>Library</OutputType>
12-
<AppDesignerFolder>Properties</AppDesignerFolder>
13-
<RootNamespace>HdrMerge</RootNamespace>
14-
<AssemblyName>HdrMerge</AssemblyName>
15-
<FileAlignment>512</FileAlignment>
16-
<Deterministic>True</Deterministic>
17-
<TargetFrameworkVersion>v13.0</TargetFrameworkVersion>
18-
<AndroidClassParser>class-parse</AndroidClassParser>
19-
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
20-
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
21-
<JavaOptions></JavaOptions>
3+
<TargetFramework>net8.0-android</TargetFramework>
4+
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
227
</PropertyGroup>
23-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
24-
<DebugSymbols>true</DebugSymbols>
25-
<DebugType>portable</DebugType>
26-
<Optimize>false</Optimize>
27-
<OutputPath>bin\Debug\</OutputPath>
28-
<DefineConstants>DEBUG;TRACE</DefineConstants>
29-
<ErrorReport>prompt</ErrorReport>
30-
<WarningLevel>4</WarningLevel>
31-
<Commandlineparameters></Commandlineparameters>
32-
<MandroidExtraArgs></MandroidExtraArgs>
33-
<AndroidHttpClientHandlerType></AndroidHttpClientHandlerType>
34-
<AndroidSigningStorePass></AndroidSigningStorePass>
35-
<MandroidExtraArgs></MandroidExtraArgs>
36-
<AndroidHttpClientHandlerType></AndroidHttpClientHandlerType>
37-
<AndroidSigningStorePass></AndroidSigningStorePass>
38-
<RunWithWarnings>true</RunWithWarnings>
39-
</PropertyGroup>
40-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41-
<DebugType>portable</DebugType>
42-
<Optimize>true</Optimize>
43-
<OutputPath>bin\Release\</OutputPath>
44-
<DefineConstants>TRACE</DefineConstants>
45-
<ErrorReport>prompt</ErrorReport>
46-
<WarningLevel>4</WarningLevel>
47-
<JavaMaximumHeapSize></JavaMaximumHeapSize>
48-
<JavaMaximumHeapSize></JavaMaximumHeapSize>
49-
<AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
50-
</PropertyGroup>
51-
<ItemGroup>
52-
<Reference Include="Mono.Android" />
53-
<Reference Include="System" />
54-
</ItemGroup>
55-
<ItemGroup>
56-
<Compile Include="Properties\AssemblyInfo.cs" />
57-
</ItemGroup>
588
<ItemGroup>
59-
<None Include="Jars\AboutJars.txt" />
60-
<None Include="Additions\AboutAdditions.txt" />
61-
<None Include="hdr_merge\gradlew" />
62-
<None Include="hdr_merge\build.gradle" />
63-
<None Include="hdr_merge\gradle.properties" />
64-
<None Include="hdr_merge\gradlew.bat" />
65-
<None Include="hdr_merge\settings.gradle" />
66-
<None Include="hdr_merge\hdr_merge\build.gradle" />
67-
<None Include="hdr_merge\hdr_merge\src\main\AndroidManifest.xml" />
68-
<None Include="hdr_merge\hdr_merge\src\main\rs\hdr_merge.rs" />
69-
<None Include="hdr_merge\gradle\wrapper\gradle-wrapper.jar" />
70-
<None Include="hdr_merge\gradle\wrapper\gradle-wrapper.properties" />
9+
<None Remove="hdr_merge\**\*" />
10+
<AndroidJavaSource Remove="hdr_merge\**\*" />
11+
<AndroidLibrary Remove="hdr_merge\**\*" />
7112
</ItemGroup>
72-
<ItemGroup>
73-
<TransformFile Include="Transforms\Metadata.xml" />
74-
<TransformFile Include="Transforms\EnumFields.xml" />
75-
<TransformFile Include="Transforms\EnumMethods.xml" />
76-
</ItemGroup>
77-
<ItemGroup>
78-
<LibraryProjectZip Include="Jars\hdr_merge-$(Configuration).aar" />
79-
</ItemGroup>
80-
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
81-
<Target Name="BeforeClean">
13+
<Target Name="HdrClean" BeforeTargets="CoreClean">
8214
<Exec Command="hdr_merge\gradlew -p hdr_merge clean" />
8315
</Target>
84-
<Target Name="BeforeBuild">
16+
<Target Name="HdrCompile" BeforeTargets="_ExtractAar">
8517
<Exec Command="hdr_merge\gradlew -p hdr_merge assemble$(Configuration)" />
8618
<Copy SourceFiles="hdr_merge\hdr_merge\build\outputs\aar\hdr_merge-$(Configuration).aar" DestinationFolder="Jars\" />
8719
</Target>
88-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
89-
Other similar extension points exist, see Microsoft.Common.targets.
90-
<Target Name="AfterBuild">
91-
</Target>
92-
-->
93-
</Project>
20+
</Project>

HdrViewfinder/HdrMerge/HdrMerge.sln

-25
This file was deleted.
Binary file not shown.
-19.9 KB
Binary file not shown.

HdrViewfinder/HdrMerge/Properties/AssemblyInfo.cs

-26
This file was deleted.

HdrViewfinder/HdrMerge/hdr_merge/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath "com.android.tools.build:gradle:4.1.2"
8+
classpath "com.android.tools.build:gradle:7.2.2"
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

HdrViewfinder/HdrMerge/hdr_merge/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

HdrViewfinder/HdrMerge/hdr_merge/hdr_merge/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ android {
66
compileSdkVersion 31
77

88
defaultConfig {
9-
minSdkVersion 21
9+
minSdkVersion 23
1010
targetSdkVersion 31
1111
}
1212

0 commit comments

Comments
 (0)