Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redoing Traveler sample with CarouselView #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sthewissen
Copy link

Submission description

I decided to remake a sample I've done a while ago called Traveler, which could really benefit from using CarouselView. The screenshot below shows the original (left) and the CarouselView version (right). A few differences can be seen which I'll describe in "What didn't go well".

image

What went well

Setting up the basics. It was pretty much a drop-in replacement for the existing stuff. Simply removing some existing properties did the job.

What didn't go well

It has a similar issue as CollectionView where the root element of the DataTemplate has to be a specific type. In my case it's my own control, which has a margin but that margin gets completely ignored. Wrapping it in a StackLayout and applying the margin to that does work, however. Is this something I need to do work for on my control's end to support this or is this a Xamarin.Forms thing?

<CarouselView HorizontalScrollBarVisibility="Never" ItemsSource="{Binding Categories}" PeekAreaInsets="20,0,40,0" HeightRequest="120">
   <CarouselView.ItemTemplate>
      <DataTemplate>
         <custom:PancakeView Margin="0,0,10,0" BackgroundColor="{Binding Color}" VerticalOptions="Center" HeightRequest="60" WidthRequest="100" CornerRadius="12">
            ...
         </custom:PancakeView>
      </DataTemplate>
   </CarouselView.ItemTemplate>
</CarouselView>

I also noticed that even though I have two different sizes specified for the items in the top and bottom carousel they are sized equally. The bottom carousel itself has the same height as the top one, but the item within it doesn't and should actually be centered vertically within it. The WidthRequest seems to be completely ignored, even though it's different from the top one.

Missing or desired things

  • Snapping - Not sure if it's in, to be honest, but a quick glance over the properties didn't really reveal it. To me, snapping is something that helps the user in selecting the item they want to select instead of accidentally scrolling past it since the carousel itself doesn't really stop on a per-item basis.

Anything else

I'm always up for some wearable swag! 😄

Take out a survey for some goodies

Please visit this link to take a survey. If you provide your contact information, we'll send you some swag!

Ok!

@sthewissen sthewissen mentioned this pull request Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant