Skip to content

Commit

Permalink
Merge pull request #2081 from unoplatform/dev/dr/miscsFixes
Browse files Browse the repository at this point in the history
fix: [MVUX] misc fixes
  • Loading branch information
dr1rrb authored Dec 4, 2023
2 parents cf96ace + 6d84e76 commit d640576
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build/ci/.azure-pipelines.Packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
msbuildLocationMethod: location
msbuildLocation: $(MSBUILDPATH)
msbuildArchitecture: x86
msbuildArguments: /r /m /v:m /p:Configuration=Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=%GITVERSION_FullSemVer%" "/p:InformationalVersion=%GITVERSION_InformationalVersion%" /detailedsummary /bl:$(build.artifactstagingdirectory)/uno-extensions.binlog
msbuildArguments: /r /m /v:m /p:Configuration=Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$(GitVersion.FullSemVer)" "/p:InformationalVersion=%GITVERSION_InformationalVersion%" /detailedsummary /bl:$(build.artifactstagingdirectory)/uno-extensions.binlog
clean: false
maximumCpuCount: true
restoreNugetPackages: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ internal class PaginationFacet : IDisposable

private readonly CancellationTokenSource _ct = new();
private readonly IPaginationService? _service;
private readonly IBindableCollectionViewSource _source;
private readonly CollectionChangedFacet _changed;
private readonly BindableCollectionExtendedProperties _properties;

public PaginationFacet(IBindableCollectionViewSource source, CollectionChangedFacet changed, BindableCollectionExtendedProperties properties)
{
_service = source.GetService(typeof(IPaginationService)) as IPaginationService;
_source = source;
_changed = changed;
_properties = properties;

Expand Down Expand Up @@ -59,7 +61,7 @@ private void OnServiceStateChanged(object? sender, EventArgs _)
{
_properties.HasMoreItems = HasMoreItems = svc.HasMoreItems;
_properties.IsLoadingMoreItems = svc.IsLoadingMoreItems;
_changed.PropertyChanged(nameof(HasMoreItems));
_source.Dispatcher?.TryEnqueue(() => _changed.PropertyChanged(nameof(HasMoreItems)));
}
else
{
Expand Down
15 changes: 10 additions & 5 deletions src/Uno.Extensions.Reactive.UI/View/FeedView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</VisualStateGroup>
<VisualStateGroup x:Name="ProgressGroup">
<VisualStateGroup.Transitions>
<VisualTransition To="Indeterminate">
<VisualTransition From="NoProgress" To="Indeterminate">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="ProgressRoot"
Expand All @@ -99,12 +99,17 @@
Duration="0:0:0.100" />
</Storyboard>
</VisualTransition>
<VisualTransition From="Indeterminate">
<VisualTransition From="Indeterminate" To="NoProgress">
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetName="ProgressRoot"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
<DiscreteObjectKeyFrame KeyTime="0:0:0.100" Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation
Storyboard.TargetName="ProgressPresenter"
Storyboard.TargetProperty="Opacity"
From="1"
To="0"
Duration="0:0:0.100" />
</Storyboard>
Expand All @@ -113,8 +118,8 @@
<VisualState x:Name="NoProgress" />
<VisualState x:Name="Indeterminate">
<VisualState.Setters>
<Setter Target="DataRoot.Visibility" Value="Collapsed" />
<Setter Target="ErrorRoot.Visibility" Value="Collapsed" />
<Setter Target="DataRoot.Opacity" Value="0" />
<Setter Target="ErrorRoot.Opacity" Value="0" />
<Setter Target="ProgressRoot.Visibility" Value="Visible" />
</VisualState.Setters>
</VisualState>
Expand Down
3 changes: 2 additions & 1 deletion src/Uno.Extensions.Reactive/Sources/PaginatedListFeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public IAsyncEnumerable<Message<IImmutableList<TItem>>> GetSource(SourceContext

async ValueTask Load(TokenSet<RefreshToken>? refresh, CancellationToken ct)
{
refreshRequests.MoveNext();

var cursor = _firstPage;
var pageInfo = new PaginationInfo { HasMoreItems = true };
var isFirstPage = true;
Expand Down Expand Up @@ -71,7 +73,6 @@ async ValueTask Load(TokenSet<RefreshToken>? refresh, CancellationToken ct)

// Prepare the next token we will process
pageRequests.MoveNext();
refreshRequests.MoveNext();
isFirstPage = false;
}
}
Expand Down

0 comments on commit d640576

Please sign in to comment.