Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/switch ph1 to net8 #557

Merged
merged 32 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
239965f
Update documentation & CI (#501)
wcoder Jan 27, 2023
846a0c5
Simplify projects to SDK style (#498)
wcoder Feb 14, 2023
13e3ad0
Migrate to .NET6+ (#513)
wcoder Feb 21, 2023
545b06a
Migrate from Xamarin.Essentials to Microsoft.Maui.Essentials (#517)
wcoder Feb 24, 2023
08ad4e5
Update documentation & rework nested namespaces (#514)
wcoder Feb 24, 2023
860f848
Resolve warnings (#515)
wcoder Feb 27, 2023
a4cb501
Implementation of 'Notification' and 'Bluetooth' permissions (#519)
nkrisko Mar 2, 2023
174a957
Add System.Text.Json serializer and tests (#521)
wcoder Mar 9, 2023
bce6fc3
Show warning when ConfigureAwait should be used (#522)
wcoder Mar 24, 2023
27a1124
Remove Chunkify method (#523)
wcoder Mar 28, 2023
107c72d
Remove Newtonsoft.Json (#524)
wcoder Mar 29, 2023
0f589bb
Update CI environment (#530)
wcoder Aug 2, 2023
da8d58b
Migrate Common.iOS & Common.Droid Tests to .NET6 (#525)
wcoder Aug 2, 2023
5645e21
Replace Connectivity plugin to MAUI Essentials (#531)
wcoder Aug 3, 2023
70783d4
location eq added
Oct 13, 2023
ee61471
comment fixed
Oct 16, 2023
2505c34
Merge pull request #537 from Softeq/feature/add-equatable-interface-f…
wcoder Oct 25, 2023
27f1b7a
Refactor permissions library (#535)
wcoder Oct 25, 2023
f87e2c8
Add binding support for Count property (ObservableKeyGroupsCollection…
wcoder Oct 25, 2023
4fdd0da
Update docfx (#534)
wcoder Oct 27, 2023
84e4ef3
Improvements before migration to .NET8 (#539)
wcoder Dec 20, 2023
1e59f30
Migrate to .NET8 (#536)
wcoder Dec 27, 2023
4ea3f80
Feature/minor fixes (#545)
pavel-leonenko Mar 27, 2024
acd47d9
Update ph1 to net8 (#542)
sleushunou Mar 27, 2024
6903065
Merge branch 'master' into feature/PH1-merge-master
Mar 27, 2024
dac607b
Merge pull request #546 from Softeq/feature/PH1-merge-master
sleushunou Mar 28, 2024
db8abd2
nugets update (#549)
sleushunou Apr 29, 2024
a865cf9
fix build
sleushunou Apr 30, 2024
24bc137
Merge pull request #550 from Softeq/fix-ios-ph1
sleushunou Apr 30, 2024
eb1be10
Added unsubscribing from CanExecute-related events when disposing Set…
pavel-leonenko Jul 6, 2024
eb4f4b0
Merge branch 'project/PH1' into project/PH1-net8
Jul 15, 2024
122722d
Merge pull request #555 from Softeq/project/PH1-net8-merge
pavel-leonenko Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<LangVersion>8.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<DebugType>portable</DebugType>
<MauiVersion>8.0.21</MauiVersion>
</PropertyGroup>

<!-- Assembly Info -->
<PropertyGroup>
<Product>XToolkit</Product>
<Company>Softeq Development Corporation</Company>
<Copyright>Copyright © 2024 Softeq Development Corporation</Copyright>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Softeq
Copyright (c) 2024 Softeq

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ Common | [![Softeq.XToolkit.Common](https://buildstats.info/nuget/Softeq.XToo
Bindings | [![Softeq.XToolkit.Bindings](https://buildstats.info/nuget/Softeq.XToolkit.Bindings?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.Bindings)
Permissions | [![Softeq.XToolkit.Permissions](https://buildstats.info/nuget/Softeq.XToolkit.Permissions?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.Permissions)
PushNotifications | [![Softeq.XToolkit.PushNotifications](https://buildstats.info/nuget/Softeq.XToolkit.PushNotifications?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.PushNotifications)
Remote | [![Softeq.XToolkit.Remote](https://buildstats.info/nuget/Softeq.XToolkit.Remote?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.Remote)
WhiteLabel | [![Softeq.XToolkit.WhiteLabel](https://buildstats.info/nuget/Softeq.XToolkit.WhiteLabel?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.WhiteLabel)
WhiteLabel.Essentials | [![Softeq.XToolkit.WhiteLabel.Essentials](https://buildstats.info/nuget/Softeq.XToolkit.WhiteLabel.Essentials?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.WhiteLabel.Essentials)
WhiteLabel.Forms | [![Softeq.XToolkit.WhiteLabel.Forms](https://buildstats.info/nuget/Softeq.XToolkit.WhiteLabel.Forms?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.WhiteLabel.Forms)
Remote | [![Softeq.XToolkit.Remote](https://buildstats.info/nuget/Softeq.XToolkit.Remote?includePreReleases=true)](https://www.nuget.org/packages/Softeq.XToolkit.Remote)

## Documentation

Expand Down
12 changes: 12 additions & 0 deletions Softeq.XToolkit.Bindings.Droid/Bindable/BindableViewHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using AndroidX.RecyclerView.Widget;
using Softeq.XToolkit.Bindings.Abstract;
using Softeq.XToolkit.Bindings.Extensions;
using Softeq.XToolkit.Common.Disposables;
using Softeq.XToolkit.Common.Weak;

#nullable disable
Expand All @@ -16,10 +17,13 @@ namespace Softeq.XToolkit.Bindings.Droid.Bindable
public abstract class BindableViewHolder<TViewModel>
: RecyclerView.ViewHolder, IBindableViewHolder
{
private readonly DisposableSubscriptionsComponent _subscriptionsComponent;

private IDisposable _itemViewClickSubscription;

protected BindableViewHolder(View itemView) : base(itemView)
{
_subscriptionsComponent = new DisposableSubscriptionsComponent(SetCommandsWithDisposing);
}

public event EventHandler ItemClicked;
Expand Down Expand Up @@ -63,11 +67,19 @@ protected virtual void OnItemViewClick(object sender, EventArgs e)

public virtual void DoAttachBindings()
{
_subscriptionsComponent.CreateSubscriptions();
}

public virtual void DoDetachBindings()
{
this.DetachBindings();

_subscriptionsComponent.DisposeSubscriptions();
}

protected virtual IEnumerable<IDisposable> SetCommandsWithDisposing()
{
return [];
}
}
}
39 changes: 27 additions & 12 deletions Softeq.XToolkit.Bindings.Droid/DroidBindingFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Windows.Input;
using Android.Views;
using Android.Widget;
using Softeq.XToolkit.Common.Disposables;
using Softeq.XToolkit.Common.Threading;

namespace Softeq.XToolkit.Bindings.Droid
Expand Down Expand Up @@ -147,18 +148,20 @@ public override Delegate GetCommandHandler<T>(
}

/// <inheritdoc />
public override void HandleCommandCanExecute<T>(
public override IDisposable HandleCommandCanExecute<T>(
object element,
ICommand command,
Binding<T, T>? commandParameterBinding)
{
if (element is View view)
{
HandleViewEnabled(view, command, commandParameterBinding);
return HandleViewEnabled(view, command, commandParameterBinding);
}

return Disposable.Create(() => { });
}

private static void HandleViewEnabled<T>(
private static IDisposable HandleViewEnabled<T>(
View view,
ICommand command,
Binding<T, T>? commandParameterBinding)
Expand All @@ -171,20 +174,32 @@ private static void HandleViewEnabled<T>(
() => view.Enabled = command.CanExecute(commandParameter));

// set by CanExecute
command.CanExecuteChanged += (s, args) =>
{
Execute.BeginOnUIThread(
() => view.Enabled = command.CanExecute(commandParameter));
};
command.CanExecuteChanged += OnCommandCanExecuteChanged;

// set by bindable command parameter
if (commandParameterBinding != null)
{
commandParameterBinding.ValueChanged += (s, args) =>
commandParameterBinding.ValueChanged += OnCommandParameterBindingValueChanged;
}

return Disposable.Create(() =>
{
if (commandParameterBinding != null)
{
Execute.BeginOnUIThread(
() => view.Enabled = command.CanExecute(commandParameterBinding.Value));
};
commandParameterBinding.ValueChanged -= OnCommandParameterBindingValueChanged;
}

command.CanExecuteChanged -= OnCommandCanExecuteChanged;
});

void OnCommandCanExecuteChanged(object? s, EventArgs args)
{
Execute.BeginOnUIThread(() => view.Enabled = command.CanExecute(commandParameter));
}

void OnCommandParameterBindingValueChanged(object? s, EventArgs args)
{
Execute.BeginOnUIThread(() => view.Enabled = command.CanExecute(commandParameterBinding.Value));
}
}
}
Expand Down
31 changes: 0 additions & 31 deletions Softeq.XToolkit.Bindings.Droid/Properties/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,84 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2B4A678B-63B4-49DB-99B1-BFE7793110C4}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Softeq.XToolkit.Bindings.Droid</RootNamespace>
<AssemblyName>Softeq.XToolkit.Bindings.Droid</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v13.0</TargetFrameworkVersion>
<TargetFramework>net8.0-android34.0</TargetFramework>
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.2.1.5" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<ProjectReference Include="..\Softeq.XToolkit.Common\Softeq.XToolkit.Common.csproj" />
<ProjectReference Include="..\Softeq.XToolkit.Common.Droid\Softeq.XToolkit.Common.Droid.csproj" />
<ProjectReference Include="..\Softeq.XToolkit.Bindings\Softeq.XToolkit.Bindings.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="DroidBinding.cs" />
<Compile Include="DroidBindingFactory.cs" />
<Compile Include="ObservableAdapter.cs" />
<Compile Include="ObservableAdapterExtended.cs" />
<Compile Include="ObservableGroupAdapter.cs" />
<Compile Include="ObservableRecyclerGroupViewAdapter.cs" />
<Compile Include="ObservableRecyclerViewAdapter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Bindable\IBindableViewHolder.cs" />
<Compile Include="Bindable\BindableViewHolder.cs" />
<Compile Include="Bindable\BindableRecyclerViewAdapter.cs" />
<Compile Include="Bindable\BindableViewHolderLayoutAttribute.cs" />
<Compile Include="Bindable\ItemType.cs" />
<Compile Include="Bindable\FlatItem.cs" />
<Compile Include="Handlers\DroidRecyclerObservableKeyGroupCollectionHandler.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Softeq.XToolkit.Bindings\Softeq.XToolkit.Bindings.csproj">
<Project>{0F1F09A8-9CDB-4933-AA1B-898AB43D394C}</Project>
<Name>Softeq.XToolkit.Bindings</Name>
</ProjectReference>
<ProjectReference Include="..\Softeq.XToolkit.Common.Droid\Softeq.XToolkit.Common.Droid.csproj">
<Project>{18d3fdc1-b0a1-401e-87f2-1c43034e610c}</Project>
<Name>Softeq.XToolkit.Common.Droid</Name>
</ProjectReference>
<ProjectReference Include="..\Softeq.XToolkit.Common\Softeq.XToolkit.Common.csproj">
<Project>{24588814-B93D-4528-8917-9C2A3C4E85CA}</Project>
<Name>Softeq.XToolkit.Common</Name>
</ProjectReference>
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.2.1.5" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>

</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Nullable>disable</Nullable>
</PropertyGroup>

Expand Down
39 changes: 27 additions & 12 deletions Softeq.XToolkit.Bindings.iOS/AppleBindingFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Windows.Input;
using Softeq.XToolkit.Common.Disposables;
using UIKit;

namespace Softeq.XToolkit.Bindings.iOS
Expand Down Expand Up @@ -98,18 +99,20 @@ public override Binding<TSource, TTarget> CreateBinding<TSource, TTarget>(
}

/// <inheritdoc />
public override void HandleCommandCanExecute<T>(
public override IDisposable HandleCommandCanExecute<T>(
object element,
ICommand command,
Binding<T, T>? commandParameterBinding)
{
if (element is UIControl control)
{
HandleControlEnabled(control, command, commandParameterBinding);
return HandleControlEnabled(control, command, commandParameterBinding);
}

return Disposable.Create(() => { });
}

private static void HandleControlEnabled<T>(
private static IDisposable HandleControlEnabled<T>(
UIControl control,
ICommand command,
Binding<T, T>? commandParameterBinding)
Expand All @@ -122,20 +125,32 @@ private static void HandleControlEnabled<T>(
() => control.Enabled = command.CanExecute(commandParameter));

// set by CanExecute
command.CanExecuteChanged += (s, args) =>
{
control.BeginInvokeOnMainThread(
() => control.Enabled = command.CanExecute(commandParameter));
};
command.CanExecuteChanged += OnCommandCanExecuteChanged;

// set by bindable command parameter
if (commandParameterBinding != null)
{
commandParameterBinding.ValueChanged += (s, args) =>
commandParameterBinding.ValueChanged += OnCommandParameterBindingValueChanged;
}

return Disposable.Create(() =>
{
if (commandParameterBinding != null)
{
control.BeginInvokeOnMainThread(
() => control.Enabled = command.CanExecute(commandParameterBinding.Value));
};
commandParameterBinding.ValueChanged -= OnCommandParameterBindingValueChanged;
}

command.CanExecuteChanged -= OnCommandCanExecuteChanged;
});

void OnCommandCanExecuteChanged(object? s, EventArgs args)
{
control.BeginInvokeOnMainThread(() => control.Enabled = command.CanExecute(commandParameter));
}

void OnCommandParameterBindingValueChanged(object? s, EventArgs args)
{
control.BeginInvokeOnMainThread(() => control.Enabled = command.CanExecute(commandParameterBinding.Value));
}
}
}
Expand Down
Loading
Loading