2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Xamarin.Forms.CustomAttributes;
|
2016-04-26 18:20:55 +03:00
|
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
|
|
#if UITEST
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Xamarin.UITest;
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-11-17 00:07:30 +03:00
|
|
|
|
namespace Xamarin.Forms.Controls.Issues
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2018-11-21 14:48:05 +03:00
|
|
|
|
#if UITEST
|
|
|
|
|
[NUnit.Framework.Category(Core.UITests.UITestCategories.UwpIgnore)]
|
|
|
|
|
#endif
|
|
|
|
|
[Preserve(AllMembers = true)]
|
2018-02-20 03:00:53 +03:00
|
|
|
|
[Issue(IssueTracker.Github, 2411, "ListView.ScrollTo not working in TabbedPage", PlatformAffected.Android)]
|
|
|
|
|
public class Issue2411 : TestTabbedPage
|
|
|
|
|
{
|
|
|
|
|
protected override void Init()
|
|
|
|
|
{
|
|
|
|
|
Children.Add(new XamarinListViewScrollToBugPage1());
|
|
|
|
|
Children.Add(new XamarinListViewScrollToBugPage2());
|
|
|
|
|
Children.Add(new XamarinListViewScrollToBugPage3());
|
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
|
|
#if UITEST
|
2018-02-20 03:00:53 +03:00
|
|
|
|
[Test]
|
2016-03-22 23:02:25 +03:00
|
|
|
|
#if __ANDROID__
|
2018-02-20 03:00:53 +03:00
|
|
|
|
[Ignore("Appearing event is tied to virtualization in TabbedPage for Material")]
|
Add MacOS gallery and UITest (#721)
* [MacOS] Cleanup
* [Controls] Add Header support to ListView
* [MacOS] NSView reuse on NSTableView
* [MacOS] Some fix on layour order
* [MacOS] Add CarouselPageRenderer
* [MacOS] Implement EventTracker on PageRenderer
* [MacOS] Cleanup CarouselPageRenderer
* [MacOS] Add MasterDetailPage renderer
* [MacOS] MDP renderer don't allow drag of splitter
* [MacOS] Add TabbedPage renderer
* [MacOS] Initial sketch of NavigationPageRenderer
* [MacOS] Send disappearing of CurrentPage on Dispose on NavigationPageRenderer
* [MacOS] Add Gallery page for Mac
* [MacOS] Add MacOSExpressionSearch
* [MacOS] Fix ColorExtension
* [MacOS] Fix MDP renderer layout
* [MacOS] Implement native selection on ListViewRenderer
* [MacOS] Deselect a item on NSTableView
* [MacOS] Remove previous SplitViewItems
* [MacOS] Fix navigationpage height
* [MacOS] Add toolbar for NavigationPageRenderer
* [MacOS] Don't remove selection for now (crashing)
* [MacOS] Refactor page and back button title on NavigationPageRenderer
* [MacOS] Fix bug when native navigate back
* [MacOS] Hide layer when transition
* [MacOS] ListviewRenderer fix BbackgroundColor
* [MacOS] Fix background on ScrollViewRenderer
* [MacOS] Fix header measure on ListViewRenderer
* [MacOS] Add Mac twitter demo
* [Controls] Spaces for easy reading
* [MacOS] More xaml cleanup
* [Core] Add Mac as aTargetPlatform
* [MacOS] Add alerts and actionsheets
* [MacOS] Add GestureRecognizers
* [MacOS] Fix Layout issues when adding children, enable transformations
* [MacOS] Fix title on tab item, move to tabbed navigation based on segmented control
* [MacOS] Hide toolbar when not needed, this allows to work with tabbed page, cleanup
* [MacOS] Add NativeBindings and NativeViewWrapper
* [MacOS] Fix AssemblyInfo
* [MacOS] FIX NRE on SetBackgroundColor BoxView
* [MacOS] Fix NavigationPageRenderer
* [MacOS] Fix build
* [MacOS] Also update page when it resizes
* [MacOS] Add LayoutRenderer for handle items position when the bounds change.
* [MacOS] Refactor/Cleanup
* [MacOS] Add toolbar items support to NavigationPage
* [MacOS] Resize images for TabViewITems
* [MacOS] Fix TabbedPage resize issues , allow users to override some features when creating TVI
* [MacOS] Fix hide/show Navigation toolbar
* [MacOS] Redo CarouselPageRenderer with NSPageController
* [MacOS] Add support for Modal pages
* [MacOS] Refactor navigation from platform
* [Nuget] Add nuget for MacOS
* [Nuget]Fix nuspec
* [Nuget] Add variables for CI
* [Controls] Remove MainMenu from MacOS
* [MacOS] Add TableView renderer (no headers yet)
* [MacOS] Refactoring, marking extensions as internal
* [MacOS] Add group headers for TableViewRenderer
* [MacOS] Workaround for updates on listview collection
* [MacOS] Handle updates of rows in the ListViewRenderer properly
* [MacOS] Fix navigation animation
* Fix navigation header issues with modal pages
* [MacOS] Fix MDP issues with resizing
* [MacOS] Fix general dispose
* [MacOS] Add a ViewControllerWrapper for NSSplitView
* [MacOS] MDP renderer fix animation
* [MacOS] Fix ListView selection bug
* [MacOS] Fix rendering MDP Layout inside wrappers
* [MacOS] Re write the MainToolbar handler
* [MacOS] Don't use Sierra new extensions so we can run in stable channel
* [MacOS] Another way to hide the toolbar (smarter i think)
* [MacOS] Fix MDP bug and remove debug color
* [Controls] Add HanselForms sample
* [MacOS] Fix NRE WebviewRenderer
* [MacOS] Fix uneven rows on ListView renderer
* [MacOS] Fix NRE on load (can+t find the reason this happens)
* [MacOS] Fix uneven rows
* [MacOS] Fix header sizing on ListViewRenderer
* [Controls] More stuff on HanselForms
* [MacOS] Remove warning from ListViewRenderer
* [MacOS] Fix PageRenderer bug double init
* [MacOS] Don't calculate height if RowHeight is provided
* [Controls] More Hanselforms stuff
* [MacOS] Once again a new implementation for the NavigationBar, this time using a custom view to support BackgroundColor
* [MacOS] Fix build
* [MacOS] Refactoring AwesomeBar related controls
* Fix build
* [MacOS] NavigationBar update background and t test colors
* [MacOS] Fix when we remove navigation so it works when the NavigationRenderer wasn't removed from the parent controller like in a TabbedPage
* [MacOS] Add support for ListView grouping
* [MacOS] Fix image extension method.
* [MacOS] Add base Maps project
* [MacOS] Export MapRenderer
* [MacOS] Add pin click and geocoderbacked for Maps
* [MacOS] Add extra binding project for API not in stable.
* [MacOS] Add MacOS Maps lib
* [MacOS]Fix build on alpha
* [MacOS] Remove MacOS Maps extra binding
* [UITest] Basic macOS setup
* [UITest] Add MacOSApp wrapper implementation
* [MacOS] Set AutomationID
* [UITests] Add ActionSheetUITests to MacOS UITest
* [MacOS] Fix bug on Picker
* [UITests] Link basic uitest basefixture and related files
* [MacOS] Fix pickers reuse
* [UItests] Fix MacOS app path
* [UITest] Ignore UItest for appearing on macOS for now
* [UITest] Update macOS for 2.0.3
* [UITest] Refactor EnterText MacOS app
* [UITest]Fix ViewQuery on MacOS
* [UITest]Fix IsEnabled UItest on macOS
* [UITest] Implement Enter, mark some tests inconclusive fix others
* [MacOS] Implement Entry Completed event
* [UITests] Fix UITest for IsVisible, ignore ToolbarItem test for now
* [UITests] Fix ISVisible again add extra category
* [Controls] Cleanup macOS gallery
* [MacOS] Fix Assembly info
* [Docs] Fix docs
* Fix build
* [Nuget] Fix nuspec
* [Controls] Link files on MacOS
* [Core] Update Forms stack before firing a event saying page was removed, possible breaking change
* [MacOS] Implement RemovePage on NavigationPAgeRenderer
* [UItest] Ignore some , implement back on MacOS UITest app
* [MacOS] Add default back button name (needs to be translated)
* [MacOS] Fix dispose
* [UITest] Make 29257 work on MacOS
* [MacOS] Rename stuff
* [MacOS] More renaming and cleanup
* [MacOS] Share implementations for iOS
* [MacOS] Reuse more IOS extensions
* [MacOS] Reuse FontExtensions
* [MacOS] Share NativeViewWrapper related stuff
* [MAcOS] Share event args and ExportRenderer
* [MacOS] Share platform effect
* [MacOS] Fix build
* [Docs]Fixing docs
* [MacOS] Fix ViewCell reuse
* [Core] Support ListView CachingStrategy on MacOS
* [MacOS] Fix issues with TextCell and ImageCell (we can’t set null to a NSControl value)
* [MacOS] Fix MDP child sizing bug
[UITest] Query marked by id and text
* [MacOS] Comment test related with context actions
* [MacOS] Implement missing stuff on ticker
* [MacOS] Make sure VisualElemenTracker calls the ticker update
* [UITests]Ignore context actions and not possible to test
* [MacOS] Fix Grouping bug on Listview
* [MacOS] Fix selection on Listview when using grouping
* [MacOS] Update navbar when page is popped
* [MacOS] Cleanup NavigationBar
* [Controls] More info on exceptions
* [MacOS] Fix bug animation pop modal
* [MacOS] Bring back BackgroundColor of NavigationBar
* [MacOS] Fix UITest animation delay
* [MacOS] Treat warnings as errors
* [MacOS] Center title on toolbar
* [Core] Add Platform configuration specific for MacOS
* [MacOS] Implement TabbedPage platform specific to handle TabItems on NavigationPage bar
* [MacOS] Fix warning
* [MacOS] Fix bug on SearchBar color
* [MacOS]Fix build
* [MacOS] remove extra dll from maps
* [Docs] Update docs
* [MacOS]Cleanup and refactoring
* Revert "[MacOS] remove extra dll from maps"
This reverts commit 73b948937001fea3f28449a963d0b94943e07aa0.
* [MacOS] Fix wrong refactoring
* [MacOS] dix formatting
* [MacOS] Fix build
* [MacOS] Fix bug on TabbedPageRenderer no title
* [MacOS,UITest] Update packages
* [MacOS ,UITest] Add delay when tapping something, and focus with double click
* [MacOS,UITest] Ignore UITest, not possible to test with current version
* [MacOS,UITest] Ignore test that uses Frame, UITest doesn’t return it
* [MacOS] Fix bug when no title on toolbar items
* [MacOS] Remove FormsNSView
* [MacOS] Cleanup on dispose on MDP renderer
* [MacOS] Different way to test leak of MDP, need to look at this again after
* [MacOS] Update current page when source changes
* [MacOS] More cleanup
* [MacOS,UITest] Implement ClearText
* [MacOS,UITest] ClearText doesn’t work for now on MacOS uitest
* [MacOS] Make sure we show the previous page when popping a Modal
* [MacOS] Fix issue with sizing the Header and visibility, remove for now header renderer reuse
* [MacOS] Clean CustomNSTableView
* [MacOS] Share LabelRenderer with iOS
* [MacOS,UITest] Don’t try to scroll for the element
* [MacOS] Share ResourcesProvider with iOS
* [MAcoS] Share VisualElementPackager with iOS
* [MacOS] Share ViewRenderer with iOS
* [MacOS] Merge with VisualElementTracker from iOS
* [MacOS] Merge with EventTracker from iOS
* [MacOS] Merge with VisualElementRenderer of iOS
* [MacOS] Make sure we always have a layer
* [MacOS] Fix Tracker merge with iOS version
* [MacOS] Fix bug with tabbed page on modal without navigation
* [Core] Rever change on core
* [Controls] Add missing image
* [MacOS] Clear renderers before setting them MDP
* [MacOS] Update tabbedPage ContainerArea
* [Controls] Add Custom renderers tests
* [MacOS] Fix ListViewRenderer
* [MacOS,UITest] Refactoring, implement index
* [MacOS] Make sure we don’t pass null to TextField string value
* [MacOS] Support for multiple clicks in same selected item on NSTableView
* [MacOS, UITest] Fix bug on Back because of refactoring
* [MacOS,UITest] Ignore UITest because we’d-not have ScrollDownTo yet
* [MacOS] Support Focus on EntryRenderer
* [MacOS,UITest] Ignore more a couple of tests that we can’t test on UITest Desktop
* [MacOS,UITest] MacOSApp looks for StaticText fields too
* [MacOS, UITest] Fix EnterText for marked Entry
* [MacOS] Fix index bug on TablevIewDataSource
* [MacOS] Fix SelectedItem TableViewDataSource
* [Nuget] Add Mac to Maps nuspec
* [Nuget]Fix path
* [Controls] Add basic FormsGallery sample
* [macOS] Fixed Tab NSImage crash in TabbedPageRenderer (#705)
* [macOS] Fixed Tab NSImage crash in TabbedPageRenderer
* Coding Style
* Coding Style
* [MacOS] Fix previous merge with master
* [MacOS] Possible simple fix for click on views overlapping
* [UItest] Ignore this part of the test we can’t click on NSViews yet
* [MacOS] Rename to IsOnViewCell
* fix docs
* [MacOS] Cleanup, Address feedback from Samantha’s review
* [MacOS] Add ContextActions
* [Controls] Remove FormsGalery for now
* [Docs] Update docs
* [MacOS] Implement ContextActions
* [MacOS,UITests] Enable and support UITests of ContextActions
2017-01-27 15:52:38 +03:00
|
|
|
|
#endif
|
|
|
|
|
#if __MACOS__
|
2018-02-20 03:00:53 +03:00
|
|
|
|
[Ignore("ScrollTo not implemented on MacOS")]
|
2016-03-22 23:02:25 +03:00
|
|
|
|
#endif
|
2018-02-20 03:00:53 +03:00
|
|
|
|
[Issue(IssueTracker.Github, 2411, "ScrollToPosition.MakeVisible not called every time TabbedPage", PlatformAffected.Android)]
|
|
|
|
|
public void Issue2411ScrollToPositionMakeVisible()
|
|
|
|
|
{
|
|
|
|
|
RunningApp.WaitForElement(q => q.Marked("99 99 99 99 99 99"));
|
|
|
|
|
RunningApp.Screenshot("ScrollTo working correctly");
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Crash in ScrollToPosition.End"));
|
|
|
|
|
RunningApp.Screenshot("On Second Tab");
|
|
|
|
|
RunningApp.WaitForElement(q => q.Marked("2 0 0 0 0 0 0"));
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Scroll To in OnAppearing"));
|
|
|
|
|
RunningApp.Screenshot("On First Tab");
|
|
|
|
|
RunningApp.WaitForElement(q => q.Marked("99 99 99 99 99 99"));
|
|
|
|
|
|
|
|
|
|
var listViewBound = RunningApp.Query(q => q.Marked("listView"))[0].Rect;
|
|
|
|
|
Xamarin.Forms.Core.UITests.Gestures.ScrollForElement(RunningApp, "* marked:'0 0 0 0 0 0'", new Xamarin.Forms.Core.UITests.Drag(listViewBound, Xamarin.Forms.Core.UITests.Drag.Direction.TopToBottom, Xamarin.Forms.Core.UITests.Drag.DragLength.Long));
|
|
|
|
|
RunningApp.Screenshot("Scrolled to Top");
|
|
|
|
|
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Crash in ScrollToPosition.End"));
|
|
|
|
|
RunningApp.Screenshot("On Second Tab");
|
|
|
|
|
RunningApp.WaitForElement(q => q.Marked("2 0 0 0 0 0 0"));
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Scroll To in OnAppearing"));
|
|
|
|
|
RunningApp.Screenshot("On First Tab");
|
|
|
|
|
RunningApp.WaitForElement(q => q.Marked("99 99 99 99 99 99"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
[Issue(IssueTracker.Github, 2411, "ScrollToPosition.End crashing in TabbedPage", PlatformAffected.Android)]
|
Add MacOS gallery and UITest (#721)
* [MacOS] Cleanup
* [Controls] Add Header support to ListView
* [MacOS] NSView reuse on NSTableView
* [MacOS] Some fix on layour order
* [MacOS] Add CarouselPageRenderer
* [MacOS] Implement EventTracker on PageRenderer
* [MacOS] Cleanup CarouselPageRenderer
* [MacOS] Add MasterDetailPage renderer
* [MacOS] MDP renderer don't allow drag of splitter
* [MacOS] Add TabbedPage renderer
* [MacOS] Initial sketch of NavigationPageRenderer
* [MacOS] Send disappearing of CurrentPage on Dispose on NavigationPageRenderer
* [MacOS] Add Gallery page for Mac
* [MacOS] Add MacOSExpressionSearch
* [MacOS] Fix ColorExtension
* [MacOS] Fix MDP renderer layout
* [MacOS] Implement native selection on ListViewRenderer
* [MacOS] Deselect a item on NSTableView
* [MacOS] Remove previous SplitViewItems
* [MacOS] Fix navigationpage height
* [MacOS] Add toolbar for NavigationPageRenderer
* [MacOS] Don't remove selection for now (crashing)
* [MacOS] Refactor page and back button title on NavigationPageRenderer
* [MacOS] Fix bug when native navigate back
* [MacOS] Hide layer when transition
* [MacOS] ListviewRenderer fix BbackgroundColor
* [MacOS] Fix background on ScrollViewRenderer
* [MacOS] Fix header measure on ListViewRenderer
* [MacOS] Add Mac twitter demo
* [Controls] Spaces for easy reading
* [MacOS] More xaml cleanup
* [Core] Add Mac as aTargetPlatform
* [MacOS] Add alerts and actionsheets
* [MacOS] Add GestureRecognizers
* [MacOS] Fix Layout issues when adding children, enable transformations
* [MacOS] Fix title on tab item, move to tabbed navigation based on segmented control
* [MacOS] Hide toolbar when not needed, this allows to work with tabbed page, cleanup
* [MacOS] Add NativeBindings and NativeViewWrapper
* [MacOS] Fix AssemblyInfo
* [MacOS] FIX NRE on SetBackgroundColor BoxView
* [MacOS] Fix NavigationPageRenderer
* [MacOS] Fix build
* [MacOS] Also update page when it resizes
* [MacOS] Add LayoutRenderer for handle items position when the bounds change.
* [MacOS] Refactor/Cleanup
* [MacOS] Add toolbar items support to NavigationPage
* [MacOS] Resize images for TabViewITems
* [MacOS] Fix TabbedPage resize issues , allow users to override some features when creating TVI
* [MacOS] Fix hide/show Navigation toolbar
* [MacOS] Redo CarouselPageRenderer with NSPageController
* [MacOS] Add support for Modal pages
* [MacOS] Refactor navigation from platform
* [Nuget] Add nuget for MacOS
* [Nuget]Fix nuspec
* [Nuget] Add variables for CI
* [Controls] Remove MainMenu from MacOS
* [MacOS] Add TableView renderer (no headers yet)
* [MacOS] Refactoring, marking extensions as internal
* [MacOS] Add group headers for TableViewRenderer
* [MacOS] Workaround for updates on listview collection
* [MacOS] Handle updates of rows in the ListViewRenderer properly
* [MacOS] Fix navigation animation
* Fix navigation header issues with modal pages
* [MacOS] Fix MDP issues with resizing
* [MacOS] Fix general dispose
* [MacOS] Add a ViewControllerWrapper for NSSplitView
* [MacOS] MDP renderer fix animation
* [MacOS] Fix ListView selection bug
* [MacOS] Fix rendering MDP Layout inside wrappers
* [MacOS] Re write the MainToolbar handler
* [MacOS] Don't use Sierra new extensions so we can run in stable channel
* [MacOS] Another way to hide the toolbar (smarter i think)
* [MacOS] Fix MDP bug and remove debug color
* [Controls] Add HanselForms sample
* [MacOS] Fix NRE WebviewRenderer
* [MacOS] Fix uneven rows on ListView renderer
* [MacOS] Fix NRE on load (can+t find the reason this happens)
* [MacOS] Fix uneven rows
* [MacOS] Fix header sizing on ListViewRenderer
* [Controls] More stuff on HanselForms
* [MacOS] Remove warning from ListViewRenderer
* [MacOS] Fix PageRenderer bug double init
* [MacOS] Don't calculate height if RowHeight is provided
* [Controls] More Hanselforms stuff
* [MacOS] Once again a new implementation for the NavigationBar, this time using a custom view to support BackgroundColor
* [MacOS] Fix build
* [MacOS] Refactoring AwesomeBar related controls
* Fix build
* [MacOS] NavigationBar update background and t test colors
* [MacOS] Fix when we remove navigation so it works when the NavigationRenderer wasn't removed from the parent controller like in a TabbedPage
* [MacOS] Add support for ListView grouping
* [MacOS] Fix image extension method.
* [MacOS] Add base Maps project
* [MacOS] Export MapRenderer
* [MacOS] Add pin click and geocoderbacked for Maps
* [MacOS] Add extra binding project for API not in stable.
* [MacOS] Add MacOS Maps lib
* [MacOS]Fix build on alpha
* [MacOS] Remove MacOS Maps extra binding
* [UITest] Basic macOS setup
* [UITest] Add MacOSApp wrapper implementation
* [MacOS] Set AutomationID
* [UITests] Add ActionSheetUITests to MacOS UITest
* [MacOS] Fix bug on Picker
* [UITests] Link basic uitest basefixture and related files
* [MacOS] Fix pickers reuse
* [UItests] Fix MacOS app path
* [UITest] Ignore UItest for appearing on macOS for now
* [UITest] Update macOS for 2.0.3
* [UITest] Refactor EnterText MacOS app
* [UITest]Fix ViewQuery on MacOS
* [UITest]Fix IsEnabled UItest on macOS
* [UITest] Implement Enter, mark some tests inconclusive fix others
* [MacOS] Implement Entry Completed event
* [UITests] Fix UITest for IsVisible, ignore ToolbarItem test for now
* [UITests] Fix ISVisible again add extra category
* [Controls] Cleanup macOS gallery
* [MacOS] Fix Assembly info
* [Docs] Fix docs
* Fix build
* [Nuget] Fix nuspec
* [Controls] Link files on MacOS
* [Core] Update Forms stack before firing a event saying page was removed, possible breaking change
* [MacOS] Implement RemovePage on NavigationPAgeRenderer
* [UItest] Ignore some , implement back on MacOS UITest app
* [MacOS] Add default back button name (needs to be translated)
* [MacOS] Fix dispose
* [UITest] Make 29257 work on MacOS
* [MacOS] Rename stuff
* [MacOS] More renaming and cleanup
* [MacOS] Share implementations for iOS
* [MacOS] Reuse more IOS extensions
* [MacOS] Reuse FontExtensions
* [MacOS] Share NativeViewWrapper related stuff
* [MAcOS] Share event args and ExportRenderer
* [MacOS] Share platform effect
* [MacOS] Fix build
* [Docs]Fixing docs
* [MacOS] Fix ViewCell reuse
* [Core] Support ListView CachingStrategy on MacOS
* [MacOS] Fix issues with TextCell and ImageCell (we can’t set null to a NSControl value)
* [MacOS] Fix MDP child sizing bug
[UITest] Query marked by id and text
* [MacOS] Comment test related with context actions
* [MacOS] Implement missing stuff on ticker
* [MacOS] Make sure VisualElemenTracker calls the ticker update
* [UITests]Ignore context actions and not possible to test
* [MacOS] Fix Grouping bug on Listview
* [MacOS] Fix selection on Listview when using grouping
* [MacOS] Update navbar when page is popped
* [MacOS] Cleanup NavigationBar
* [Controls] More info on exceptions
* [MacOS] Fix bug animation pop modal
* [MacOS] Bring back BackgroundColor of NavigationBar
* [MacOS] Fix UITest animation delay
* [MacOS] Treat warnings as errors
* [MacOS] Center title on toolbar
* [Core] Add Platform configuration specific for MacOS
* [MacOS] Implement TabbedPage platform specific to handle TabItems on NavigationPage bar
* [MacOS] Fix warning
* [MacOS] Fix bug on SearchBar color
* [MacOS]Fix build
* [MacOS] remove extra dll from maps
* [Docs] Update docs
* [MacOS]Cleanup and refactoring
* Revert "[MacOS] remove extra dll from maps"
This reverts commit 73b948937001fea3f28449a963d0b94943e07aa0.
* [MacOS] Fix wrong refactoring
* [MacOS] dix formatting
* [MacOS] Fix build
* [MacOS] Fix bug on TabbedPageRenderer no title
* [MacOS,UITest] Update packages
* [MacOS ,UITest] Add delay when tapping something, and focus with double click
* [MacOS,UITest] Ignore UITest, not possible to test with current version
* [MacOS,UITest] Ignore test that uses Frame, UITest doesn’t return it
* [MacOS] Fix bug when no title on toolbar items
* [MacOS] Remove FormsNSView
* [MacOS] Cleanup on dispose on MDP renderer
* [MacOS] Different way to test leak of MDP, need to look at this again after
* [MacOS] Update current page when source changes
* [MacOS] More cleanup
* [MacOS,UITest] Implement ClearText
* [MacOS,UITest] ClearText doesn’t work for now on MacOS uitest
* [MacOS] Make sure we show the previous page when popping a Modal
* [MacOS] Fix issue with sizing the Header and visibility, remove for now header renderer reuse
* [MacOS] Clean CustomNSTableView
* [MacOS] Share LabelRenderer with iOS
* [MacOS,UITest] Don’t try to scroll for the element
* [MacOS] Share ResourcesProvider with iOS
* [MAcoS] Share VisualElementPackager with iOS
* [MacOS] Share ViewRenderer with iOS
* [MacOS] Merge with VisualElementTracker from iOS
* [MacOS] Merge with EventTracker from iOS
* [MacOS] Merge with VisualElementRenderer of iOS
* [MacOS] Make sure we always have a layer
* [MacOS] Fix Tracker merge with iOS version
* [MacOS] Fix bug with tabbed page on modal without navigation
* [Core] Rever change on core
* [Controls] Add missing image
* [MacOS] Clear renderers before setting them MDP
* [MacOS] Update tabbedPage ContainerArea
* [Controls] Add Custom renderers tests
* [MacOS] Fix ListViewRenderer
* [MacOS,UITest] Refactoring, implement index
* [MacOS] Make sure we don’t pass null to TextField string value
* [MacOS] Support for multiple clicks in same selected item on NSTableView
* [MacOS, UITest] Fix bug on Back because of refactoring
* [MacOS,UITest] Ignore UITest because we’d-not have ScrollDownTo yet
* [MacOS] Support Focus on EntryRenderer
* [MacOS,UITest] Ignore more a couple of tests that we can’t test on UITest Desktop
* [MacOS,UITest] MacOSApp looks for StaticText fields too
* [MacOS, UITest] Fix EnterText for marked Entry
* [MacOS] Fix index bug on TablevIewDataSource
* [MacOS] Fix SelectedItem TableViewDataSource
* [Nuget] Add Mac to Maps nuspec
* [Nuget]Fix path
* [Controls] Add basic FormsGallery sample
* [macOS] Fixed Tab NSImage crash in TabbedPageRenderer (#705)
* [macOS] Fixed Tab NSImage crash in TabbedPageRenderer
* Coding Style
* Coding Style
* [MacOS] Fix previous merge with master
* [MacOS] Possible simple fix for click on views overlapping
* [UItest] Ignore this part of the test we can’t click on NSViews yet
* [MacOS] Rename to IsOnViewCell
* fix docs
* [MacOS] Cleanup, Address feedback from Samantha’s review
* [MacOS] Add ContextActions
* [Controls] Remove FormsGalery for now
* [Docs] Update docs
* [MacOS] Implement ContextActions
* [MacOS,UITests] Enable and support UITests of ContextActions
2017-01-27 15:52:38 +03:00
|
|
|
|
#if __MACOS__
|
2018-02-20 03:00:53 +03:00
|
|
|
|
[Ignore("ScrollTo not implemented on MacOS")]
|
Add MacOS gallery and UITest (#721)
* [MacOS] Cleanup
* [Controls] Add Header support to ListView
* [MacOS] NSView reuse on NSTableView
* [MacOS] Some fix on layour order
* [MacOS] Add CarouselPageRenderer
* [MacOS] Implement EventTracker on PageRenderer
* [MacOS] Cleanup CarouselPageRenderer
* [MacOS] Add MasterDetailPage renderer
* [MacOS] MDP renderer don't allow drag of splitter
* [MacOS] Add TabbedPage renderer
* [MacOS] Initial sketch of NavigationPageRenderer
* [MacOS] Send disappearing of CurrentPage on Dispose on NavigationPageRenderer
* [MacOS] Add Gallery page for Mac
* [MacOS] Add MacOSExpressionSearch
* [MacOS] Fix ColorExtension
* [MacOS] Fix MDP renderer layout
* [MacOS] Implement native selection on ListViewRenderer
* [MacOS] Deselect a item on NSTableView
* [MacOS] Remove previous SplitViewItems
* [MacOS] Fix navigationpage height
* [MacOS] Add toolbar for NavigationPageRenderer
* [MacOS] Don't remove selection for now (crashing)
* [MacOS] Refactor page and back button title on NavigationPageRenderer
* [MacOS] Fix bug when native navigate back
* [MacOS] Hide layer when transition
* [MacOS] ListviewRenderer fix BbackgroundColor
* [MacOS] Fix background on ScrollViewRenderer
* [MacOS] Fix header measure on ListViewRenderer
* [MacOS] Add Mac twitter demo
* [Controls] Spaces for easy reading
* [MacOS] More xaml cleanup
* [Core] Add Mac as aTargetPlatform
* [MacOS] Add alerts and actionsheets
* [MacOS] Add GestureRecognizers
* [MacOS] Fix Layout issues when adding children, enable transformations
* [MacOS] Fix title on tab item, move to tabbed navigation based on segmented control
* [MacOS] Hide toolbar when not needed, this allows to work with tabbed page, cleanup
* [MacOS] Add NativeBindings and NativeViewWrapper
* [MacOS] Fix AssemblyInfo
* [MacOS] FIX NRE on SetBackgroundColor BoxView
* [MacOS] Fix NavigationPageRenderer
* [MacOS] Fix build
* [MacOS] Also update page when it resizes
* [MacOS] Add LayoutRenderer for handle items position when the bounds change.
* [MacOS] Refactor/Cleanup
* [MacOS] Add toolbar items support to NavigationPage
* [MacOS] Resize images for TabViewITems
* [MacOS] Fix TabbedPage resize issues , allow users to override some features when creating TVI
* [MacOS] Fix hide/show Navigation toolbar
* [MacOS] Redo CarouselPageRenderer with NSPageController
* [MacOS] Add support for Modal pages
* [MacOS] Refactor navigation from platform
* [Nuget] Add nuget for MacOS
* [Nuget]Fix nuspec
* [Nuget] Add variables for CI
* [Controls] Remove MainMenu from MacOS
* [MacOS] Add TableView renderer (no headers yet)
* [MacOS] Refactoring, marking extensions as internal
* [MacOS] Add group headers for TableViewRenderer
* [MacOS] Workaround for updates on listview collection
* [MacOS] Handle updates of rows in the ListViewRenderer properly
* [MacOS] Fix navigation animation
* Fix navigation header issues with modal pages
* [MacOS] Fix MDP issues with resizing
* [MacOS] Fix general dispose
* [MacOS] Add a ViewControllerWrapper for NSSplitView
* [MacOS] MDP renderer fix animation
* [MacOS] Fix ListView selection bug
* [MacOS] Fix rendering MDP Layout inside wrappers
* [MacOS] Re write the MainToolbar handler
* [MacOS] Don't use Sierra new extensions so we can run in stable channel
* [MacOS] Another way to hide the toolbar (smarter i think)
* [MacOS] Fix MDP bug and remove debug color
* [Controls] Add HanselForms sample
* [MacOS] Fix NRE WebviewRenderer
* [MacOS] Fix uneven rows on ListView renderer
* [MacOS] Fix NRE on load (can+t find the reason this happens)
* [MacOS] Fix uneven rows
* [MacOS] Fix header sizing on ListViewRenderer
* [Controls] More stuff on HanselForms
* [MacOS] Remove warning from ListViewRenderer
* [MacOS] Fix PageRenderer bug double init
* [MacOS] Don't calculate height if RowHeight is provided
* [Controls] More Hanselforms stuff
* [MacOS] Once again a new implementation for the NavigationBar, this time using a custom view to support BackgroundColor
* [MacOS] Fix build
* [MacOS] Refactoring AwesomeBar related controls
* Fix build
* [MacOS] NavigationBar update background and t test colors
* [MacOS] Fix when we remove navigation so it works when the NavigationRenderer wasn't removed from the parent controller like in a TabbedPage
* [MacOS] Add support for ListView grouping
* [MacOS] Fix image extension method.
* [MacOS] Add base Maps project
* [MacOS] Export MapRenderer
* [MacOS] Add pin click and geocoderbacked for Maps
* [MacOS] Add extra binding project for API not in stable.
* [MacOS] Add MacOS Maps lib
* [MacOS]Fix build on alpha
* [MacOS] Remove MacOS Maps extra binding
* [UITest] Basic macOS setup
* [UITest] Add MacOSApp wrapper implementation
* [MacOS] Set AutomationID
* [UITests] Add ActionSheetUITests to MacOS UITest
* [MacOS] Fix bug on Picker
* [UITests] Link basic uitest basefixture and related files
* [MacOS] Fix pickers reuse
* [UItests] Fix MacOS app path
* [UITest] Ignore UItest for appearing on macOS for now
* [UITest] Update macOS for 2.0.3
* [UITest] Refactor EnterText MacOS app
* [UITest]Fix ViewQuery on MacOS
* [UITest]Fix IsEnabled UItest on macOS
* [UITest] Implement Enter, mark some tests inconclusive fix others
* [MacOS] Implement Entry Completed event
* [UITests] Fix UITest for IsVisible, ignore ToolbarItem test for now
* [UITests] Fix ISVisible again add extra category
* [Controls] Cleanup macOS gallery
* [MacOS] Fix Assembly info
* [Docs] Fix docs
* Fix build
* [Nuget] Fix nuspec
* [Controls] Link files on MacOS
* [Core] Update Forms stack before firing a event saying page was removed, possible breaking change
* [MacOS] Implement RemovePage on NavigationPAgeRenderer
* [UItest] Ignore some , implement back on MacOS UITest app
* [MacOS] Add default back button name (needs to be translated)
* [MacOS] Fix dispose
* [UITest] Make 29257 work on MacOS
* [MacOS] Rename stuff
* [MacOS] More renaming and cleanup
* [MacOS] Share implementations for iOS
* [MacOS] Reuse more IOS extensions
* [MacOS] Reuse FontExtensions
* [MacOS] Share NativeViewWrapper related stuff
* [MAcOS] Share event args and ExportRenderer
* [MacOS] Share platform effect
* [MacOS] Fix build
* [Docs]Fixing docs
* [MacOS] Fix ViewCell reuse
* [Core] Support ListView CachingStrategy on MacOS
* [MacOS] Fix issues with TextCell and ImageCell (we can’t set null to a NSControl value)
* [MacOS] Fix MDP child sizing bug
[UITest] Query marked by id and text
* [MacOS] Comment test related with context actions
* [MacOS] Implement missing stuff on ticker
* [MacOS] Make sure VisualElemenTracker calls the ticker update
* [UITests]Ignore context actions and not possible to test
* [MacOS] Fix Grouping bug on Listview
* [MacOS] Fix selection on Listview when using grouping
* [MacOS] Update navbar when page is popped
* [MacOS] Cleanup NavigationBar
* [Controls] More info on exceptions
* [MacOS] Fix bug animation pop modal
* [MacOS] Bring back BackgroundColor of NavigationBar
* [MacOS] Fix UITest animation delay
* [MacOS] Treat warnings as errors
* [MacOS] Center title on toolbar
* [Core] Add Platform configuration specific for MacOS
* [MacOS] Implement TabbedPage platform specific to handle TabItems on NavigationPage bar
* [MacOS] Fix warning
* [MacOS] Fix bug on SearchBar color
* [MacOS]Fix build
* [MacOS] remove extra dll from maps
* [Docs] Update docs
* [MacOS]Cleanup and refactoring
* Revert "[MacOS] remove extra dll from maps"
This reverts commit 73b948937001fea3f28449a963d0b94943e07aa0.
* [MacOS] Fix wrong refactoring
* [MacOS] dix formatting
* [MacOS] Fix build
* [MacOS] Fix bug on TabbedPageRenderer no title
* [MacOS,UITest] Update packages
* [MacOS ,UITest] Add delay when tapping something, and focus with double click
* [MacOS,UITest] Ignore UITest, not possible to test with current version
* [MacOS,UITest] Ignore test that uses Frame, UITest doesn’t return it
* [MacOS] Fix bug when no title on toolbar items
* [MacOS] Remove FormsNSView
* [MacOS] Cleanup on dispose on MDP renderer
* [MacOS] Different way to test leak of MDP, need to look at this again after
* [MacOS] Update current page when source changes
* [MacOS] More cleanup
* [MacOS,UITest] Implement ClearText
* [MacOS,UITest] ClearText doesn’t work for now on MacOS uitest
* [MacOS] Make sure we show the previous page when popping a Modal
* [MacOS] Fix issue with sizing the Header and visibility, remove for now header renderer reuse
* [MacOS] Clean CustomNSTableView
* [MacOS] Share LabelRenderer with iOS
* [MacOS,UITest] Don’t try to scroll for the element
* [MacOS] Share ResourcesProvider with iOS
* [MAcoS] Share VisualElementPackager with iOS
* [MacOS] Share ViewRenderer with iOS
* [MacOS] Merge with VisualElementTracker from iOS
* [MacOS] Merge with EventTracker from iOS
* [MacOS] Merge with VisualElementRenderer of iOS
* [MacOS] Make sure we always have a layer
* [MacOS] Fix Tracker merge with iOS version
* [MacOS] Fix bug with tabbed page on modal without navigation
* [Core] Rever change on core
* [Controls] Add missing image
* [MacOS] Clear renderers before setting them MDP
* [MacOS] Update tabbedPage ContainerArea
* [Controls] Add Custom renderers tests
* [MacOS] Fix ListViewRenderer
* [MacOS,UITest] Refactoring, implement index
* [MacOS] Make sure we don’t pass null to TextField string value
* [MacOS] Support for multiple clicks in same selected item on NSTableView
* [MacOS, UITest] Fix bug on Back because of refactoring
* [MacOS,UITest] Ignore UITest because we’d-not have ScrollDownTo yet
* [MacOS] Support Focus on EntryRenderer
* [MacOS,UITest] Ignore more a couple of tests that we can’t test on UITest Desktop
* [MacOS,UITest] MacOSApp looks for StaticText fields too
* [MacOS, UITest] Fix EnterText for marked Entry
* [MacOS] Fix index bug on TablevIewDataSource
* [MacOS] Fix SelectedItem TableViewDataSource
* [Nuget] Add Mac to Maps nuspec
* [Nuget]Fix path
* [Controls] Add basic FormsGallery sample
* [macOS] Fixed Tab NSImage crash in TabbedPageRenderer (#705)
* [macOS] Fixed Tab NSImage crash in TabbedPageRenderer
* Coding Style
* Coding Style
* [MacOS] Fix previous merge with master
* [MacOS] Possible simple fix for click on views overlapping
* [UItest] Ignore this part of the test we can’t click on NSViews yet
* [MacOS] Rename to IsOnViewCell
* fix docs
* [MacOS] Cleanup, Address feedback from Samantha’s review
* [MacOS] Add ContextActions
* [Controls] Remove FormsGalery for now
* [Docs] Update docs
* [MacOS] Implement ContextActions
* [MacOS,UITests] Enable and support UITests of ContextActions
2017-01-27 15:52:38 +03:00
|
|
|
|
#endif
|
2018-02-20 03:00:53 +03:00
|
|
|
|
public void Issue2411ScrollToPositionEndCrash()
|
|
|
|
|
{
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Crash in ScrollToPosition.End"));
|
|
|
|
|
RunningApp.Screenshot("On Second Tab");
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Scroll To in OnAppearing"));
|
|
|
|
|
RunningApp.Screenshot("On First Tab");
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Crash in ScrollToPosition.End"));
|
|
|
|
|
RunningApp.Screenshot("On Second Tab Again");
|
|
|
|
|
RunningApp.Tap(q => q.Marked("ScrollToPosition.End End - Not animated"));
|
|
|
|
|
RunningApp.WaitForElement(q => q.Marked("2 99 99 99 99 99 99"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
[Issue(IssueTracker.Github, 2411, "ScrollToPositon.End crashing in TabbedPage", PlatformAffected.Android)]
|
|
|
|
|
public void Issue2411ScrollToPositionWrongOnUneven()
|
|
|
|
|
{
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Crash in ScrollToPosition.End"));
|
|
|
|
|
RunningApp.Tap(q => q.Marked("Scroll To in OnAppearing Uneven"));
|
|
|
|
|
|
|
|
|
|
var dontRun = RunningApp.Query(q => q.Marked(XamarinListViewScrollToBugPage3.DontRun));
|
|
|
|
|
if (dontRun.Length > 0)
|
|
|
|
|
Assert.Inconclusive("Ignored on iOS < 9 until Bugzilla 28277 is resolved.");
|
|
|
|
|
|
|
|
|
|
RunningApp.Screenshot("On Third Tab");
|
|
|
|
|
RunningApp.WaitForElement(q => q.Marked("99 99 99 99 99 99"));
|
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
|
#endif
|
2018-02-20 03:00:53 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Preserve(AllMembers = true)]
|
|
|
|
|
internal class ListObj
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Preserve(AllMembers = true)]
|
|
|
|
|
public class CellTemplateScrollTo : ViewCell
|
|
|
|
|
{
|
|
|
|
|
public CellTemplateScrollTo()
|
|
|
|
|
{
|
|
|
|
|
Label cellLabel = new Label()
|
|
|
|
|
{
|
|
|
|
|
HorizontalOptions = LayoutOptions.FillAndExpand,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cellLabel.SetBinding(Label.TextProperty, new Binding("Name", BindingMode.OneWay));
|
|
|
|
|
|
|
|
|
|
StackLayout root = new StackLayout()
|
|
|
|
|
{
|
|
|
|
|
Children = {
|
|
|
|
|
cellLabel
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
View = root;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Preserve(AllMembers = true)]
|
|
|
|
|
public class CellTemplateScrollToUneven : CellTemplateScrollTo
|
|
|
|
|
{
|
|
|
|
|
public CellTemplateScrollToUneven()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Height = 60 + new Random().Next(10, 100);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Preserve(AllMembers = true)]
|
|
|
|
|
public class XamarinListViewScrollToBugPage1 : ContentPage
|
|
|
|
|
{
|
|
|
|
|
ListView _listView;
|
|
|
|
|
ObservableCollection<ListObj> _collection = new ObservableCollection<ListObj>();
|
|
|
|
|
|
|
|
|
|
public XamarinListViewScrollToBugPage1()
|
|
|
|
|
{
|
|
|
|
|
Title = "Scroll To in OnAppearing";
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 100; i++)
|
|
|
|
|
{
|
|
|
|
|
var item = new ListObj { Name = string.Format("{0} {0} {0} {0} {0} {0}", i) };
|
|
|
|
|
_collection.Add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_listView = new ListView
|
|
|
|
|
{
|
|
|
|
|
ItemsSource = _collection,
|
|
|
|
|
ItemTemplate = new DataTemplate(typeof(CellTemplateScrollTo))
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_listView.AutomationId = "listView";
|
|
|
|
|
|
|
|
|
|
Content = new StackLayout
|
|
|
|
|
{
|
|
|
|
|
Children = {
|
|
|
|
|
_listView
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnAppearing()
|
|
|
|
|
{
|
|
|
|
|
base.OnAppearing();
|
|
|
|
|
_listView.ScrollTo(_collection.Last(), ScrollToPosition.MakeVisible, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Preserve(AllMembers = true)]
|
|
|
|
|
public class XamarinListViewScrollToBugPage2 : ContentPage
|
|
|
|
|
{
|
|
|
|
|
ListView _listView;
|
|
|
|
|
ObservableCollection<ListObj> _collection = new ObservableCollection<ListObj>();
|
|
|
|
|
|
|
|
|
|
public XamarinListViewScrollToBugPage2()
|
|
|
|
|
{
|
|
|
|
|
Padding = new Thickness(10, 50, 10, 0);
|
|
|
|
|
Title = "Crash in ScrollToPosition.End";
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 100; i++)
|
|
|
|
|
{
|
|
|
|
|
var item = new ListObj { Name = string.Format("2 {0} {0} {0} {0} {0} {0}", i) };
|
|
|
|
|
_collection.Add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_listView = new ListView
|
|
|
|
|
{
|
|
|
|
|
ItemsSource = _collection,
|
|
|
|
|
ItemTemplate = new DataTemplate(typeof(CellTemplateScrollTo))
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var endButton = new Button
|
|
|
|
|
{
|
|
|
|
|
Text = "ScrollToPosition.End End - Not animated",
|
|
|
|
|
Command = new Command(() =>
|
|
|
|
|
{
|
|
|
|
|
_listView.ScrollTo(_collection.Last(), ScrollToPosition.End, false);
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var endButtonAnimated = new Button
|
|
|
|
|
{
|
|
|
|
|
Text = "ScrollToPosition.MakeVisible End - Animated",
|
|
|
|
|
Command = new Command(() =>
|
|
|
|
|
{
|
|
|
|
|
_listView.ScrollTo(_collection.Last(), ScrollToPosition.MakeVisible, true);
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Content = new StackLayout
|
|
|
|
|
{
|
|
|
|
|
Children = {
|
|
|
|
|
endButton,
|
|
|
|
|
endButtonAnimated,
|
|
|
|
|
_listView
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class XamarinListViewScrollToBugPage3 : ContentPage
|
|
|
|
|
{
|
|
|
|
|
ListView _listView;
|
|
|
|
|
ObservableCollection<ListObj> _collection = new ObservableCollection<ListObj>();
|
|
|
|
|
int _i = 0;
|
|
|
|
|
public const string DontRun = "Don't run";
|
|
|
|
|
public XamarinListViewScrollToBugPage3()
|
|
|
|
|
{
|
|
|
|
|
Title = "Scroll To in OnAppearing Uneven";
|
|
|
|
|
|
|
|
|
|
bool runTest = true;
|
|
|
|
|
// This test will fail in iOS < 9 because using ScrollTo with UnevenRows with estimation is currently not working.
|
|
|
|
|
// It did not previously fail because this test used `TakePerformanceHit` to turn off row estimation. However, as
|
|
|
|
|
// that was never a public feature, it was never a valid fix for the test.
|
|
|
|
|
// https://bugzilla.xamarin.com/show_bug.cgi?id=28277
|
2016-06-17 13:10:18 +03:00
|
|
|
|
#if !UITEST
|
2018-02-20 03:00:53 +03:00
|
|
|
|
if (App.IOSVersion < 9)
|
|
|
|
|
runTest = false;
|
2016-06-17 13:10:18 +03:00
|
|
|
|
#endif
|
|
|
|
|
|
2018-02-20 03:00:53 +03:00
|
|
|
|
if (!runTest)
|
|
|
|
|
_collection.Add(new ListObj { Name = DontRun });
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (_i = 0; _i < 100; _i++)
|
|
|
|
|
{
|
|
|
|
|
var item = new ListObj { Name = string.Format("{0} {0} {0} {0} {0} {0}", _i) };
|
|
|
|
|
_collection.Add(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var btnAdd = new Button
|
|
|
|
|
{
|
|
|
|
|
Text = "Add item",
|
|
|
|
|
WidthRequest = 100
|
|
|
|
|
};
|
|
|
|
|
btnAdd.Clicked += BtnAddOnClicked;
|
|
|
|
|
|
|
|
|
|
var btnBottom = new Button
|
|
|
|
|
{
|
|
|
|
|
Text = "Scroll to end",
|
|
|
|
|
WidthRequest = 100
|
|
|
|
|
};
|
|
|
|
|
btnBottom.Clicked += BtnBottomOnClicked;
|
|
|
|
|
|
|
|
|
|
var btnPanel = new StackLayout
|
|
|
|
|
{
|
|
|
|
|
Orientation = StackOrientation.Horizontal,
|
|
|
|
|
HorizontalOptions = LayoutOptions.Center,
|
|
|
|
|
Children = {
|
|
|
|
|
btnAdd,
|
|
|
|
|
btnBottom
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_listView = new ListView
|
|
|
|
|
{
|
|
|
|
|
ItemsSource = _collection,
|
|
|
|
|
BackgroundColor = Color.Transparent,
|
|
|
|
|
VerticalOptions = LayoutOptions.FillAndExpand,
|
|
|
|
|
HasUnevenRows = true,
|
|
|
|
|
ItemTemplate = new DataTemplate(typeof(CellTemplateScrollToUneven))
|
|
|
|
|
};
|
|
|
|
|
_listView.ItemTapped += (sender, e) => ((ListView)sender).SelectedItem = null;
|
|
|
|
|
|
|
|
|
|
_listView.AutomationId = "listView";
|
|
|
|
|
|
|
|
|
|
Content = new StackLayout
|
|
|
|
|
{
|
|
|
|
|
Children = {
|
|
|
|
|
btnPanel,
|
|
|
|
|
_listView
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnAppearing()
|
|
|
|
|
{
|
|
|
|
|
base.OnAppearing();
|
|
|
|
|
_listView.ScrollTo(_collection.Last(), ScrollToPosition.MakeVisible, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BtnBottomOnClicked(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var item = _collection.Last();
|
|
|
|
|
_listView.ScrollTo(item, ScrollToPosition.End, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BtnAddOnClicked(object sender, EventArgs eventArgs)
|
|
|
|
|
{
|
|
|
|
|
var str = string.Format("Item {0}", _i++);
|
|
|
|
|
var item = new ListObj { Name = string.Format("{0} {0} {0} {0} {0} {0}", _i) };
|
|
|
|
|
_collection.Add(item);
|
|
|
|
|
|
|
|
|
|
_listView.ScrollTo(item, ScrollToPosition.End, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
|
}
|