Skip to content

Commit

Permalink
Change namespace for Android Resources / iOS some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kamu authored and kamu committed Oct 6, 2018
1 parent a374e5d commit 905fac0
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CollectionView.Droid/CollectionView.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectGuid>{32BC5FF4-81FB-46DD-98ED-3D33C5318933}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>AiForms.Renderers.Droid</RootNamespace>
<RootNamespace>CollectionView.Droid</RootNamespace>
<AssemblyName>CollectionView.Droid</AssemblyName>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
Expand Down
1 change: 1 addition & 0 deletions CollectionView.Droid/CollectionViewRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using Android.Content;
using Android.Support.V7.Widget;
using AiForms.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using AView = Android.Views.View;
Expand Down
7 changes: 1 addition & 6 deletions CollectionView.iOS/CollectionView.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<RootNamespace>AiForms.Renderers.iOS</RootNamespace>
<AssemblyName>CollectionView.iOS</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<ReleaseVersion>1.1.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -79,12 +80,6 @@
<Compile Include="GridCollectionViewSource.cs" />
<Compile Include="KeyboardInsetTracker.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CollectionView\CollectionView.csproj">
<Project>{6E8E8AAC-E482-4E9C-9759-27B03E4DC309}</Project>
<Name>CollectionView</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions CollectionView.iOS/CollectionViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform.iOS;
using System.Linq;

namespace AiForms.Renderers.iOS
{
Expand Down Expand Up @@ -231,15 +232,26 @@ protected virtual void UpdateItems(NotifyCollectionChangedEventArgs e, int secti
{
var exArgs = e as NotifyCollectionChangedEventArgsEx;
if (exArgs != null)
{
DataSource.Counts[section] = exArgs.Count;
}

// This means the UITableView hasn't rendered any cells yet
// so there's no need to synchronize the rows on the UITableView
if (Control.IndexPathsForVisibleItems == null && e.Action != NotifyCollectionChangedAction.Reset)
{
return;
}

var groupReset = (resetWhenGrouped && Element.IsGroupingEnabled) || forceReset;

// HACK: When an item is added for the first time, UICollectionView is sometimes crashed for some reason.
// So, in that case, ReloadData is called.
if (!Control.IndexPathsForVisibleItems.Any())
{
groupReset = true;
}

// We can't do this check on grouped lists because the index doesn't match the number of rows in a section.
// Likewise, we can't do this check on lists using RecycleElement because the number of rows in a section will remain constant because they are reused.
if (!groupReset && Element.CachingStrategy == ListViewCachingStrategy.RetainElement)
Expand Down
1 change: 1 addition & 0 deletions CollectionView/CollectionView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>AiForms.Renderers</RootNamespace>
<ReleaseVersion>1.1.2</ReleaseVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand Down
34 changes: 30 additions & 4 deletions Sample/Sample/ViewModels/DefaultValueTestViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
using System;
using System.Collections.Generic;
using Prism.Mvvm;
using Prism.Navigation;
using Reactive.Bindings;
using System.Threading.Tasks;


namespace Sample.ViewModels
{
public class DefaultValueTestViewModel
public class DefaultValueTestViewModel:BindableBase,INavigatedAware
{
public PhotoGroup ItemsSource { get; set; }
public ReactiveCollection<PhotoItem> ItemsSource { get; set; } = new ReactiveCollection<PhotoItem>();

public DefaultValueTestViewModel()
{
InitializeProperties();
}

void InitializeProperties()
Expand All @@ -27,7 +31,29 @@ void InitializeProperties()
}


ItemsSource = new PhotoGroup(list);
ItemsSource.AddRangeOnScheduler(list);
}

public void OnNavigatingTo(NavigationParameters parameters)
{
}

public void OnNavigatedFrom(NavigationParameters parameters)
{
}

public async void OnNavigatedTo(NavigationParameters parameters)
{
await Load();
}

internal async Task Load()
{
try
{
InitializeProperties();
}
finally {; }
}
}
}
6 changes: 3 additions & 3 deletions nuget/CollectionView_mac.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>AiForms.CollectionView</id>
<version>0.1.0-pre1</version>
<version>0.1.0-pre3</version>
<title>CollectionView for Xamarin.Forms</title>
<authors>kamu</authors>
<owners>kamu</owners>
Expand All @@ -14,9 +14,9 @@ This has two layouts (GridCollectionView, HorizontalCollectonView). HorizontalCo
</description>
<summary></summary>
<releaseNotes>
First Release.
Some bug fixes
</releaseNotes>
<tags>Xamarin.Forms ListView CollectionView Grid Infinite Circular Scroll UICollectionView RecyclerView FlowLayout WrapLayout</tags>
<tags>Xamarin.Forms ListView CollectionView Grid Infinite Circular Scroll UICollectionView RecyclerView FlowLayout WrapLayout HorizontalListView</tags>
<language>en-US</language>
<dependencies>
<group targetFramework="netstandard2.0">
Expand Down

0 comments on commit 905fac0

Please sign in to comment.