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

Commit

Permalink
Disable animation scrolling to initial position in CarouselView
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuarezruiz committed Sep 17, 2020
1 parent f35ae07 commit 030948a
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<controls:TestContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
xmlns:issues="clr-namespace:Xamarin.Forms.Controls.Issues"
x:Class="Xamarin.Forms.Controls.Issues.Issue11081"
Title="Issue 11081">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label
Padding="12"
BackgroundColor="Black"
TextColor="White"
Text="If the selected Item is the Item 2, directly without animations, the test has passed."/>
<!-- AnimateInitialPosition is False by default-->
<CarouselView
Grid.Row="1"
Position="1">
<CarouselView.ItemTemplate>
<DataTemplate>
<Label
Text="{Binding}"
FontSize="Large"
HorizontalOptions="CenterAndExpand"/>
</DataTemplate>
</CarouselView.ItemTemplate>
<CarouselView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
<x:String>Item 3</x:String>
<x:String>Item 4</x:String>
<x:String>Item 5</x:String>
</x:Array>
</CarouselView.ItemsSource>
</CarouselView>
</Grid>
</controls:TestContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
#endif

namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 11081, "[Bug] CarouselView should not animate an initial Position on Android",
PlatformAffected.Android)]
#if UITEST
[Category(UITestCategories.CarouselView)]
#endif
public sealed partial class Issue11081 : TestContentPage
{
public Issue11081()
{
#if APP
this.InitializeComponent();
#endif
}

protected override void Init()
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Issue11723.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue11496.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue11209.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue11081.xaml.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Bugzilla22229.xaml">
Expand Down Expand Up @@ -1802,6 +1803,9 @@
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue11209.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue11081.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Bugzilla27417Xaml.xaml">
Expand Down

0 comments on commit 030948a

Please sign in to comment.