This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable animation scrolling to initial position in CarouselView
- Loading branch information
1 parent
f35ae07
commit 030948a
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11081.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
32 changes: 32 additions & 0 deletions
32
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11081.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters