CarouselView 2.3.0-pre2

BryanHunterXamBryanHunterXam USXamarin Team Xamurai
edited August 2016 in Xamarin.Forms Releases

Xamarin.Forms.CarouselView

News

CarouselView is now open source:
https://github.com/xamarin/Xamarin.Forms.CarouselView

2.3.0-pre2

bugs fixed

  • 41463 - "CarouselView Crashes with "Sequence Does not Contain a Matching Element'"
  • 40513 - "Adding views to CarouselView after rendered and swiping crashes Forms"

Other fixes

Reduced assemblies referenced per platform project from three to one so
that now each platform gets its own version of Xamarin.Forms.CarouselView
into which the portable library has been merged.

For example, Android used to referenced:
  Xamarin.Forms.CarouselView
  Xamarin.Forms.CarouselView.Platform
  Xamarin.Forms.CarouselView.Android

But now only references:
  Xamarin.Forms.CarouselView (android specific)

2.3.0-pre1

Nuget package

Notes

Creating this thread to collect all CarouselView feedback until it is merged back into the Xamarin.Forms package.
James Montemagno put together a post on CarouselView here

«1345

Posts

  • AndyBarajasAndyBarajas USMember ✭✭

    I found two things I consider bugs with CarouselView.

    1) Let's say we have two items in the carousel view and we are on the second view. On iOS, if we rotate the device the carousel view will show the first item. For Android, its consistent and stays on the second item.

    2) Sometimes on Android, I get a "Sequence contains more than one element" which switching between two views that have list views inside them. In the example project attached, give a scrolling and swiping motion at the same time(might take a few tries).

  • JonRobinsonLevyJonRobinsonLevy DKMember

    I also get the "Sequence contains more than one element" (System.InvalidOperationException) on Android; it seems to be rather consistent…

    Like AndyBarajas I have two items in the CarouselView, and they both contain a ListView.

    The call stack is:

    System.Linq.Enumerable.Single /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:1050,13
    Xamarin.Forms.Platform.CarouselViewRenderer.b__8_2
    Xamarin.Forms.Platform.CarouselViewRenderer.OnScrollListener.OnScrollStateChanged
    Android.Support.V7.Widget.RecyclerView.OnScrollListener.n_OnScrollStateChanged_Landroid_support_v7_widget_RecyclerView_I

  • RodrigoEliasRodrigoElias USMember
    edited June 2016

    Same here.

    CarouselView seems to be pretty buggy on Android.

    I've tried on Genymotion (API 18/19/21/23/...) with XF 2.2, 2.3-pre or 2.3 stable.

    There´s already an open ticket for this bug in the Bugzilla.
    https://bugzilla.xamarin.com/show_bug.cgi?id=41463

  • ahmedkhanahmedkhan USUniversity ✭✭
    edited June 2016

    I'm seeing the same issue on XF 2.3 with this bug - getting the same crash with "Sequence Contains More than one Elements" on Android

    System.InvalidOperationException: Sequence contains more than one element
    at System.Linq.Enumerable.Single[TSource] (IEnumerable`1 source) [0x0008e] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:1050
    at Xamarin.Forms.Platform.CarouselViewRenderer.b__8_2 () [0x00011] in :0
    at Xamarin.Forms.Platform.CarouselViewRenderer+OnScrollListener.OnScrollStateChanged (Android.Support.V7.Widget.RecyclerView recyclerView, Int32 newState) [0x0003d] in :0
    at Android.Support.V7.Widget.RecyclerView+OnScrollListener.n_OnScrollStateChanged_Landroid_support_v7_widget_RecyclerView_I (IntPtr jnienv, IntPtr native__this, IntPtr native_recyclerView, Int32 newState) [0x00011] in :0
    at at (wrapper dynamic-method) System.Object:c87531d3-2e54-404e-8172-adbf6c7fa16f (intptr,intptr,intptr,int)

  • OddbjornBakkeOddbjornBakke NOMember ✭✭

    It would be nice if it was possible to see a little of the one of the other ones.
    Something like this: http://stackoverflow.com/questions/37474552/react-native-card-carousel-view
    Also would be nice with possibilities for animations. Like a scaling effect on the carousel while moving it.

  • jim_seowjim_seow DEMember ✭✭

    [Following CarouselView instruction for UWP](xamarin-forms-carouselview setup for Windows (by James Montemagno June 15, 2016)/)

    I managed to see the expected result with UWP with local Window 10 desktop.
    However, when I deploy that to a Windows 10 Mobile device, the image hosted in the CaraouselView disappear.

  • OddbjornBakkeOddbjornBakke NOMember ✭✭

    A litte bit funny that the picture on the blog shows what I want, but it does not seem to work like this:
    image

    Is this possible to achieve, or is it single page only?

  • See demo gif

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Well done @ShawnCastrianni.5092 . Is it possible to skip the animation when you push one button?

  • I am not sure. The next and back buttons simple just increment or decrement the Position property of the CarouselView. The CarouselView is handling the animation. I didn't see a SetPosition(int position,bool isAnimated) type of method which would allow me to change the position but say NOT to do the animation.

  • JKayJKay USMember ✭✭✭

    @ShawnCastrianni.5092 In an ideal world using Mvvm we would just be binding to the SelectedItem property and changing that would go to that page. so wouldnt have access to SetPosition. So keeping that in mind I think the CarouselView needs a bindable DoesAnimate property

  • It's possible use CarouselView without Binding ItemsSource? I just need 2 Items (Pages)?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    I think you can but I haven't my Mac in front of me

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    mmmm maybe no

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    @ShawnCastrianni.5092 When I go from red page to yellow page, the carousel shows all the other pages in between. Do you know if it's possible to see only the yellow page slide in when the yellow button is tapped? In other words, only the page to be shown to the user should slide.

  • ISychev93ISychev93 RUMember ✭✭
    edited June 2016

    Very much freezes on real iPhone (4s - we support it too), when you go to next page or back twice (Index = Index - 2).
    As I understand only previous page is cached, so next page is rendered (calculated) in runtime - if I'm not mistaken, it is simply replaces DataContext of current page.

    Mb you create 3 pages under the hood(Previous - Current - Next pages )?

    P.S. if you change current page with Carousel View.Position property (previous-- or next++) it's looks like we just changed DataContext on page (rerendering page without left or right moving).

    P.S. We use ListView in our CarouselView content.

  • ISychev93ISychev93 RUMember ✭✭
    edited June 2016

    And one question more (may be therein lies the problem).

    Is there a difference between Release and AppStore build on real iPhone by performance?

  • @AdrianKnight Not that I know of. CarouselView would probably have to expose a way to set the position without animating or something else to support that.

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    @AdrianKnight said:
    @ShawnCastrianni.5092 When I go from red page to yellow page, the carousel shows all the other pages in between. Do you know if it's possible to see only the yellow page slide in when the yellow button is tapped? In other words, only the page to be shown to the user should slide.

    @BryanHunterXam It'd be great to have the above feature as well or just make it easy to implement such a feature. I saw this on Google+, and it was pretty neat.

  • bytebuilderbytebuilder USMember ✭✭

    Hi everyone,
    is there a way to show pages with the new carouselview? specifically i not only would like to see the circles indicating pages below the current item, but also a portion of the previous and next page items..
    Thanks!

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
  • ShawnCastrianni.5092ShawnCastrianni.5092 US ✭✭✭
    edited June 2016

    Obviously, I am biased, but I prefer my sliding tabs demo above to show which page I am on. It allows the user to jump to a specific page by name. But I can see use cases for both. I would use @AlessandroCaliaro dots for something like a tutorial screen.

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    I just mad my first experiments with CarouselView and encountered an Exception on the Simulator that said more the one Element in Collection Linq.Single any of you encountered this too? Also On the simulator I could swipe more than one page at once. This does not happen on the phone.

  • LesterMeeksLesterMeeks USMember ✭✭

    I am doing some testing in release mode and have a blank white page when I turn on SDK linking, debug and release modes seem to work great if you don't link, but in release mode i generally use SDK linking. Anyone else seen this? Have a workaround other than don't use linking?

  • seanydaseanyda GBMember ✭✭✭✭✭

    @LesterMeeks said:
    I am doing some testing in release mode and have a blank white page when I turn on SDK linking, debug and release modes seem to work great if you don't link, but in release mode i generally use SDK linking. Anyone else seen this? Have a workaround other than don't use linking?

    I have this issue too. I put my build into test flight and it was all broken.

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    you have to add the CarouselView assembly to the don't link list

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭
    edited June 2016

    Just saw that this bug is already reported but this doesn't make it better as no one has took care of it yet

    "System.InvalidOperationException: Sequence contains more than one element"

    at

    0x93 in System.Linq.Enumerable.Single at /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:1050,13 C#

    or at

    >   0x93 in System.Linq.Enumerable.Single<int> at /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:1050,13    C#
        0x12 in Android.Views.ViewGroup.RemoveAllViews at /Users/builder/data/lanes/3415/7db2aac3/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3894,5    C#
        0x10 in Xamarin.Forms.Platform.Android.Platform.SetPage at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:392,5 C#
        0x12 in Xamarin.Forms.Platform.Android.Platform.System.IDisposable.Dispose at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:157,4  C#
        0x35 in Xamarin.Forms.Platform.Android.FormsApplicationActivity.OnDestroy at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\FormsApplicationActivity.cs:150,5   C#
        0xA in Android.App.Activity.n_OnDestroy at /Users/builder/data/lanes/3415/7db2aac3/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.Activity.cs:2857,4  C#
    

    or at

    >   0x93 in System.Linq.Enumerable.Single<int> at /Users/builder/data/lanes/3415/7db2aac3/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:1050,13    C#
        0x3D in Android.Views.View.DispatchTouchEvent at /Users/builder/data/lanes/3415/7db2aac3/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.View.cs:12433,5 C#
        0x50 in Xamarin.Forms.Platform.Android.PlatformRenderer.DispatchTouchEvent at C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:35,4   C#
        0x13 in Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ at /Users/builder/data/lanes/3415/7db2aac3/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.View.cs:12420,4    C#
    

    @BryanHunterXam could you have a look at this? I'm just refactoring my App to the new CarouselView and now I'm not sure if I can rely on it.

  • MarianGrzesikMarianGrzesik DEUniversity ✭✭

    I created an example, which works on Android devices. I have also some problems in Hyper-V Android Simulator, like described above . But on iOS I get still only an exception:

    System.IO.FileNotFoundException: Could not load file or assembly 'Xamarin.Forms.CarouselView' or one of its dependencies

    I included the nuget packages to the iOS project!
    .

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    Just stumbled about the problem with sliding through all pages when setting Position. That's completely nonsense.
    There must be a property that let you disable this. If you have 400 entries in your Datasource and you want to jump inside this this is completely useless

  • Just a gut feeling, but I would think a datasource with 400 entries does not fit the intended purpose of a CarouselView. Of course, I could not be thinking of your specific use case.

    But I agree, it would be nice to jump to any item in the CarouselView without seeing all the items in between.

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    Why not? If I use a carouselview e.g. for a picture collecting it. Would make sense to have the possibility to jump to a desired month where pictures were taken.

    Even with 20entries and you want to jump from end to end it doesn't make sense.

  • I agreed with you above.

  • LesterMeeksLesterMeeks USMember ✭✭

    @ThomasBurkhart said:
    you have to add the CarouselView assembly to the don't link list

    I have tried that a bit with no luck, added what I thought the assembly name is to the mtouch args. Have any hints to make that work in Xamarin Studio?

  • SanGu.0696SanGu.0696 KRMember

    Hi, Can I get CarouselView with two or more views xaml examples? (not .cs example)

  • FrozengnuFrozengnu DKUniversity ✭✭
    edited June 2016

    @ThomasBurkhart said:
    Just stumbled about the problem with sliding through all pages when setting Position. That's completely nonsense.
    There must be a property that let you disable this. If you have 400 entries in your Datasource and you want to jump inside this this is completely useless

    if true, this also keeps us from using it to do infinite paging - tinder style

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    Yep, it's defenatly the case :-(

  • SamuelDebruynSamuelDebruyn BEMember

    Some feedback:

    • On Android I also get the Sequence contains more than one element exception.
    • On iOS, I can't set the Position property when I initialize my carousel.
    • I'd like to see the source code.
  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    Luckily Adam has saved an earlier version of the source code: https://xamarinhelp.com/wp-content/uploads/2016/05/CarouselView.zip

    I found the source of the Bug and it's easy to fix see the attached ScreenShow. Where the Single() call is are more than one Element in the Collection, likely because it's in between pages. If you replace this with First() everything is fine.

    I also found if you set the ItemSource=null you can set the position without having the view swiping through the pages:

            var itemsource = DayCarousel.ItemsSource;
            DayCarousel.ItemsSource = null;
            DayCarousel.Position = i;
            DayCarousel.ItemsSource = itemsource;
    

    Please comment on the Issue https://bugzilla.xamarin.com/show_bug.cgi?id=41463 to show your are also interested in fixing this.

    Unfortunately there is another problem in Android. If you place a vertical ListView inside the CarouselPage it's almost impossible to scroll it without triggering a scroll of the CarouselView.

    @BryanHunterXam Where are you?

«1345
Sign In or Register to comment.