Giter VIP home page Giter VIP logo

carouselview's People

Contributors

alexrainman avatar davidstrickland0 avatar idontbyte avatar mogwai avatar piees avatar rotorgames avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carouselview's Issues

TypeLoadException

I'm getting this on CarouselViewRenderer.Init()

System.TypeLoadException: Could not load type 'CarouselView.FormsPlugin.Android.CarouselViewRenderer' from assembly 'CarouselView.FormsPlugin.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Xamarin.Forms version 2.3.2.127 (Latest stable)
CarouselView.FormsPlugin version 2.2.0

Crash in Android

Hi. Thank you for awesome plugin but I have a problem with it.

I have error in Android when I added CarouselView in layout.

Xamarin.VS 4.2.0.680
Xamarin.Forms to 2.3.2.127
Android 6.0

P.S. Crash is only if I use nuget package in my project. When I deploy your demo project that all working.

<abstractions:CarouselViewControl  Position="0" ItemsSource="{Binding MyList}" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
  <abstractions:CarouselViewControl.ItemTemplate>
    <DataTemplate>
      <Label Text="{Binding .}"/>
     </DataTemplate>
   </abstractions:CarouselViewControl.ItemTemplate>
</abstractions:CarouselViewControl>
Xamarin caused by: android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
CarouselView.FormsPlugin.Android.CarouselViewRenderer.PageAdapter.get_Count()<97300517a1ad4a16ac0373801a18c8e2>:0
Android.Support.V4.View.PagerAdapter.n_GetCount(IntPtr jnienv, IntPtr native__this)<27c17fe440cf491ba8255bcefade6e02>:0
at (wrapper dynamic-method) System.Object:06516622-6b02-4513-bdaa-c681ca0d2685 (intptr,intptr)
md5fa3be16b83ce3acd3be83265686c14de.CarouselViewRenderer_PageAdapter.n_getCount(Native Method)
md5fa3be16b83ce3acd3be83265686c14de.CarouselViewRenderer_PageAdapter.getCount()CarouselViewRenderer_PageAdapter.java:33
android.support.v4.view.ViewPager.setAdapter()ViewPager.java:495
mono.java.lang.RunnableImplementor.n_run(Native Method)
mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30
android.os.Handler.handleCallback()Handler.java:739
android.os.Handler.dispatchMessage()Handler.java:95
android.os.Looper.loop()Looper.java:148
android.app.ActivityThread.main()ActivityThread.java:5417
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:726
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:616

DisplayAlert doesn't work after installing this plugin

I see "DisplayAlert" throws the below error after installing this plugin. I am using .NET Standard 1.4.

To re-produce the issue download this sample project here then install the "CarouselView.FormsPlugin"plugin on to both main client & droid projects. After doing all the steps for the plugin try adding a "DisplayAlert" somewhere.

Unhandled Exception:

Java.Lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.setVisibility(int)' on a null object reference occurred

Android CarouselViewRenderer.OnElementChanged NullReferenceException

Hey @alexrainman , thanks again for useful plugin.

I am experiencing the following exception when using CarouselView 2.3.0. (didnt help updating to 2.3.2)

PS. I tried to create a sample project, downloading this repo and using the Demo project. But Demo.Droid is broken. Wasn't able to build.

Xamarin caused by: android.runtime.JavaProxyThrowable: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at CarouselView.FormsPlugin.Android.CarouselViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs1[TElement] e) [0x00110] in <78f2e2234165408294ce634a82101454>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000f4] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:190
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:126 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:289 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00023] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:74 at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00104] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:207 at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:58 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:334
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00111] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:193 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:126
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:289
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00023] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:74
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00104] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:207
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:58
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:334 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00111] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:193
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:126 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:289 at Xamarin.Forms.Platform.Android.AppCompat.Platform+ModalContainer..ctor (Android.Content.Context context, Xamarin.Forms.Page modal) [0x00038] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:335 at Xamarin.Forms.Platform.Android.AppCompat.Platform.PresentModal (Xamarin.Forms.Page modal, System.Boolean animated) [0x0000d] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:285 at Xamarin.Forms.Platform.Android.AppCompat.Platform+<Xamarin-Forms-INavigation-PushModalAsync>d__30.MoveNext () [0x0004a] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:150 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113 at Xamarin.Forms.Application+NavigationImpl+<OnPushModal>d__3.MoveNext () [0x0008d] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Application.cs:323 --- End of inner exception stack trace --- ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object. at CarouselView.FormsPlugin.Android.CarouselViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs1[TElement] e) [0x00110] in <78f2e2234165408294ce634a82101454>:0
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000f4] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:190 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:126
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:289
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00023] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:74
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00104] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:207
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:58
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:334 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00111] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:193
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:126 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:289 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00023] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:74 at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00104] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:207 at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:58 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:334
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00111] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:193 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:126
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:289
at Xamarin.Forms.Platform.Android.AppCompat.Platform+ModalContainer..ctor (Android.Content.Context context, Xamarin.Forms.Page modal) [0x00038] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:335
at Xamarin.Forms.Platform.Android.AppCompat.Platform.PresentModal (Xamarin.Forms.Page modal, System.Boolean animated) [0x0000d] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:285
at Xamarin.Forms.Platform.Android.AppCompat.Platform+d__30.MoveNext () [0x0004a] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:150
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113
at Xamarin.Forms.Application+NavigationImpl+d__3.MoveNext () [0x0008d] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Application.cs:323 <---

Pages don't render when paging using SetCurrentPage

I'm seeing a strange rendering issue. My instance of the CarouselViewControl has an ItemsSource filled with all of my view models. I allow the user to swipe through the carousel, but I also provide arrow buttons to make this more discoverable.

The arrow buttons have handlers that call SetCurrentPage on the carousel to move to the next and previous pages. After using these buttons a bit I always end up in a state where the current page doesn't render and I have to swipe to get the view to correct itself.

It seems that it is getting stuck displaying the space in between pages, except I set that spacing to 0 so there shouldn't actually be any space there.

This occurs on both iOS and Android.

How to call previous/next item from PCL

Hello,

I have the same architecture as your repo.

Each carousel item is linked with a description, and when the user tap on one item, the description is on the screen with left/right arrows.

My question is, how I can add an event that the control will raise, and the ios renderer can listen to change the carousel item ?

ATM, the only way to call AnimationEnding is sliding with hand/mouse. The positionSelected event doesn't work because the renderer don't have the knowledge of the description and I'm ok with that.

Could you help me ?

Android Crash when calling OnRestoreInstanceState

First of all thank you for providing this great control. It looks really good.

The problem:
The App (Android) crashes when OnRestoreInstanceState is called in the Android Activity with the following error :
"Java.Lang.RuntimeException: Parcel android.os.Parcel@XXXXXXX: Unmarshalling unknown type code XXXXXXX at offset XXX"

After some testing i found out that two properties are added to the Bundle that is supposed to be restored in the method call when using the CarouselView:

FragmentPager.SavedState
CirclePageIndicator_SavedState

These might be a good start to look.

Thank you for looking into this issue.

CarouselView Not appearing on Android

Carousel View works fine on IOS but not appearing on android.
I called CarouselViewRenderer.Init(); method on my droid project after Forms.Init(this, bundle);functions.
CVButton is not visible on IOS
It doesn't throw any Exceptions for above issues

Null reference exception in ItemsSourceChanged

I'm having a hard time tracking down a crash with CarouselView.

My model has an ObservableCollection called TaskGroup, which I bind to CarouselView's ItemsSource. When I change the TaskGroup to a different one, this is when the null reference exception occurs. The TaskGroup only changes when in the previous view, so CarouselView shouldn't even be active/loaded, right?

Another thing to note, is that when I select a TaskGroup for the first time, this works perfectly, so it's only when I go back and change it, that I get the exception.

I'm not sure if it's something in my logic that's wrong, or if there's an issue with CarouselView, but I can't seem to nail the issue down, no matter what I do.

EDIT: Actually, it's more complicated than this. I have a Target, which contains TaskGroups. The current TaskGroup is selected from this TaskGroups property, which works fine with CarouselView.
But, when I change the Target (and the TaskGroups property changes), this is where the null reference exception happens. I've checked my own properties, and they're not null, so I must need to release/set to null something in CarouselView, before changing the Target?

  at CarouselView.FormsPlugin.Android.CarouselViewRenderer.ItemsSourceChanged () [0x00006] in <a8ed3a980a50479884f0c7f00f23599e>:0 
  at CarouselView.FormsPlugin.Abstractions.CarouselViewControl.HandleItemsSourcePropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x0001b] in <e68570c0fb6045ebbf0c46d4165d0b98>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindableObject.cs:584 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0014b] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindableObject.cs:378 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x0020c] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindingExpression.cs:177 
  at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindingExpression.cs:55 
  at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__44_0 () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindingExpression.cs:475 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/3819/5a02b032/source/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Java.Lang.IRunnable.cs:81 
  at (wrapper dynamic-method) System.Object:c2b5947c-8bc7-412e-a468-1ae12de52363 (intptr,intptr)

NullReferenceException during creation if control is not visible.

In my situation the carousel view control is not visible until the user taps a button, this raises an exception during creation. The control is within a that has a bound IsVisible property.

Easy to replicate using the projects demo app my making the simple change to MainPage.xaml....

Error :

System.NullReferenceException: Object reference not set to an instance of an object.
at CarouselView.FormsPlugin.UWP.CarouselViewRenderer.ButtonHide(FlipView f, String name)
at CarouselView.FormsPlugin.UWP.CarouselViewRenderer.FlipView_Loaded(Object sender, RoutedEventArgs e)

CarouselView doesn't render with AbsoluteLayout on Android

We have successfully implemented the CarouselView in our application. When trying to put a few buttons for navigation on top of the CarouselView (background red), it got weird. We use AbsoluteLayout, because at one point we'll use a transparent background so the buttons will hover over the carousel content. However it won't render on Android, while it does work on iOS (see screenshot below).

The XAML looks like:

    <AbsoluteLayout BackgroundColor="Yellow" VerticalOptions="Fill">
        <StackLayout BackgroundColor="Blue" VerticalOptions="FillAndExpand">
            <controls:CarouselViewControl
                x:Name="IntroCarousel"
                ItemTemplate="{StaticResource myTemplateSelector}"
                ItemsSource="{Binding Pages}"
                Position="0" />
        </StackLayout>
        <StackLayout
			AbsoluteLayout.LayoutBounds="1,1,.5,1" 
			AbsoluteLayout.LayoutFlags="All"
            BackgroundColor="Red"
            Orientation="Horizontal"
            VerticalOptions="End">
            <Button
                x:Name="prevBtn"
                IsVisible="false"
                Style="{StaticResource IntroPreviousBtnStyle}"
                Text="Previous" />
            <Button
                x:Name="nextBtn"
                Style="{StaticResource IntroNextBtnStyle}"
                Text="Next" />
        </StackLayout>
    </AbsoluteLayout>

Current situation

Screenshot of our app on iOS (working):
ios

Screenshot of our app on Android (not working):
android

Expected situation

So we expected to see no yellow background and the first item of the CarouselView to be visible (purple).

Is this a bug with CarouselView?


XF 2.3.3.168
CarouselView 2.5.1

Error: System.InvalidCastException: Specified cast is not valid

Hi,

I´m getting an error "System.InvalidCastException: Specified cast is not valid" with a simple example in Android:

var imagesCarousel = new CarouselViewControl();
imagesCarousel.ItemsSource = imagesSource;
imagesCarousel.ItemTemplate = new DataTemplate (typeof(ImageCarouselCell));
imagesCarousel.Position = 0;
imagesCarousel.InterPageSpacing = 10;
imagesCarousel.Orientation = Orientation.Horizontal;

public class ImageCarouselCell : ViewCell
{
	public ImageCarouselCell()
	{
		var image = new Image()
		{
			HorizontalOptions = LayoutOptions.FillAndExpand,
			VerticalOptions = LayoutOptions.FillAndExpand
		};
		image.SetBinding(Image.SourceProperty, "img");
		View = image;
	}
}

Thanks!

iOS null exception, pushed as Modal page

Hey, I have a simple image gallery page that is modally pushed in a navigation page.
It works fine until I pop it, then I get a null exception.

I have tried to recreate the issue in source code and it seems that pageController is null when it is tried accessed. See screenshot. Note: Control is not null here, so pageController is never initialized.

EDIT: After further testing, it doesnt matter if it is pushed modally or not, the null exception occurs anyways when tried popped
.
image

Getting null exceptions after updating to v2.0

Hey @alexrainman

I finally upgraded to v2.0, thanks for the improvement but I am partially delighted because some of the improvements break our app.

The reasons are:

1. I am now getting a null exception when setting App.Current.MainPage = new Page();.
In your Demo project I can see that it is in the ExtendButtonRenderer, where Element is null.
screen shot 2016-07-30 at 18 12 18
screen shot 2016-07-30 at 18 11 57

2. Local renderers are overriden by the ones added in v2.0.
A major upset, because we have multiple local renderers for button, editor, entry, etc. that are used to customise the controls.

horizontal listview

I don't know if CarouselView can visualize an horizontal listview... It would be great if I have pages with small width so I could visualize more pages at the same time on the display....

ArgumentOutOfRangeException when ItemsSource is empty (iOS)

In my iOS project I am seeing a consistent repro when trying to display a CarouselViewControl bound to an ItemsSource that is empty, but not null.

I attached a simple test project. You can see that a null collection or a filled collection is fine, but an empty collection is bad. Since it is common for programmers to always ensure that bound collections are initialized to empty instead of defaulting to null, I think it would be great if the CarouselViewControl could handle an empty collection without crashing.

CarouselTest.zip

Failed to resolve assembly: 'CarouselViewControl.FormsPlugin.Abstractions, Culture=neutral, PublicKeyToken=null'

Hi, lastest stable version of Xamarin Studio, Xf version 2.3.2.127, I can't use CarouselViewControl in xaml page, I get

Failed to resolve assembly: 'CarouselViewControl.FormsPlugin.Abstractions, Culture=neutral, PublicKeyToken=null'

(if I use compiled xaml)

or

Could not load file or assembly 'CarouselViewControl.FormsPlugin.Abstractions' or one of its dependencies

(at runtime)

Bye,
Dottor Pagliaccius

SetCurrentPage doesn't work for "0"

Hello,

I am raising an event which is resetting the ItemSource of the CarouselView, each time I want to reset the CurrentPage to the first available (position 0), but I don't seem to be able to. An example of what I am doing is below.

I am not able to set the current page to 0 each time the item source changes, but I can set the current page to 1, which makes me think that this is a bug.

CarouselView.PageIndicators = false;

var data = (IList<MyObject>) sender;
CarouselView.ItemsSource = (IList) data;

CarouselView.PageIndicators = true;

if (CarouselView.ItemsSource.Count > 0)
{
        // can set to 1, but not to 0
        CarouselView.SetCurrentPage(0);
}

Thanks.

p.s. Nice library, it's been much easier to use than Xamarin's own CarouselView.

NullReferenceException, when Content = null

If Content = null is done on the OnDisappearing of the Page on which CarouselViewControl is located with ItemsSource set, "System.NullReferenceException: Object reference not set to an instance of an object." Will occur. (Check with Android)

Child view doesn't update on Screen rotation

Hey @alexrainman,

So I have this peculiar case where the child view of CarouselView isn't rotated when screen is rotated.

The wierd part is that it WORKS if the phone starts by being in landscape mode and then rotates to portrait and/or back to landscape.

But if the page containing the carouselView is opened portrait mode, then it doesn't work when I rotate the phone to landscape. Seems like the child view's size isn't updated.

So far I have only tested on iOS devices. I have installed the latest plugin version 2.2.0.

image

image

Code:
image

IllegalStateException on Android

The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 5, found: 0 Pager id: mybundleidremoved:id/pager Pager class: class android.support.v4.view.ViewPager Problematic adapter: class md5fa3be16b83ce3acd3be83265686c14de.CarouselViewRenderer_PageAdapter

This happens when my page dissappears and the itemssource has no items left.

Indicators square dots

hello!

At some times, we need a RectanglePageIndicator, so could you can make it ? thank you !

Cannot access a disposed object. Object name: 'Android.Views.GestureDetector'.

I get this error when sliding through pages.
Usually occurs when I slide to the last page (let's say 3rd one) and when I come back to first, it crashes:

Cannot access a disposed object. Object name: 'Android.Views.GestureDetector'.

Stack trace:
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Android.Views.GestureDetector'. at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00030] in /Users/builder/data/lanes/3511/0e59c362/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.cs:153 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00002] in /Users/builder/data/lanes/3511/0e59c362/source/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:57 at Android.Views.GestureDetector.OnTouchEvent (Android.Views.MotionEvent ev) [0x0002c] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.GestureDetector.cs:1546 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Android.Views.View.IOnTouchListener.OnTouch (Android.Views.View v, Android.Views.MotionEvent e) [0x0003f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:101
at Android.Views.View+IOnTouchListenerInvoker.n_OnTouch_Landroid_view_View_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v, System.IntPtr native_e) [0x00019] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.View.cs:3558
at at (wrapper dynamic-method) System.Object:cd46250c-b4db-48dc-abcb-5008209cadb4 (intptr,intptr,intptr,intptr)
`

Any idea?

Position not binding both ways

I'm trying to bind Position both ways, using Position="{Binding TaskIndex, Mode=TwoWay}", but it doesn't seem to be working.

CarouselView is binding to TaskIndex properly, but if I change TaskIndex, Position is not affected.

Is this by design, and if so, any way around it?

Label/Button Height

Why is the Label/Button HeightRequest required? It makes it very difficult to use the CarouselViews when you are required to manually set or calculate all the heights.

Page indicator doesn't work on iOS

With the same code as used in #38 we're not able to make page indicator visible on iOS, android is working fine. We have AbsoluteLayout with 2 StackLayouts, CarouselView is inside StackLayout, PageIndicators set to true however doesn't show up on iOS.

NullRefException on Android Only

Hi,

when I use this control it works perfectly on iOS but on Android i get this :

System.NullReferenceException: Object reference not set to an instance of an object. at CarouselView.FormsPlugin.Android.CirclePageIndicator.MeasureLong (Int32 measureSpec) [0x00038] in <filename unknown>:0 at CarouselView.FormsPlugin.Android.CirclePageIndicator.OnMeasure (Int32 widthMeasureSpec, Int32 heightMeasureSpec) [0x0000b] in <filename unknown>:0 at Android.Views.View.n_OnMeasure_II (IntPtr jnienv, IntPtr native__this, Int32 widthMeasureSpec, Int32 heightMeasureSpec) [0x00009] in <filename unknown>:0 at at (wrapper dynamic-method) System.Object:8bb25a89-3729-4ef0-a3dc-9dc45deab218 (intptr,intptr,int,int)

Only when i set the PageIndicators property to true.

Thanks.

ScrollView Inside Datatemplate not work

Hi, I have a label within a stacklayout,and and stacklayout inside scrollview with it is inside the datatemplate of carouselview control,this label holds a string that is bigger than the screen(vertically), therefore I need that scrollView,but the scrollview is not working. please can you provide any solution for this

thanks

Update on rotation

Is there a way to update the child views on rotation? Right now they seem to be stuck at the original size even if I rotate the device.

Spacing between items

Hey @alexrainman. I have a enhancement request.
I want a gap/spacing between my items in carouselview, just like in iOS gallery app or facebook gallery etc.
I can probably solve it by adding left/right padding in my itemtemplate, but then my image wouldnt fill the whole screen.

What do you think?

Thanks again for remarkable plugin.

Because right now my items seems like they are attached/appended to each other. The following screenshots is of the iOS Photos app:

image
image

Carousel Control within a Page

@alexrainman

Hi,
We have a requirement where we need to show images in a carousel view. that is, we don't want the entire page to slide in the carousel but only the individual image controls. Is it possible using the Xamarin CarouselView? Because, this is then same as the Carousel Page provided by the Xamarin forms..

iOS crash on swipe + SetCurrentPage(index)

Hello, first of all thx for this package!

I've developed an android version of my app where CarouselView works like a charm. Now I started testing the iOS version of the app.

Swiping works for like 10 swipes, then it fails with a crash like this:

Foundation.MonoTouchException: Objective-C exception thrown. Name: UIViewControllerHierarchyInconsistency Reason: A view can only be associated with at most one view controller at a time! View <Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer: 0x7ffb74874f50; frame = (0 0; 320 470); autoresize = LM+W+RM+TM+H+BM; layer = <CALayer: 0x608001626c40>> is associated with <CarouselView_FormsPlugin_iOS_ViewContainer: 0x7ffb74c7f310>. Clear this association before associating this view with <CarouselView_FormsPlugin_iOS_ViewContainer: 0x7ffb74b97730>.
Native stack trace:
0 CoreFoundation 0x000000010b12ed4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010b53021e objc_exception_throw + 48
2 CoreFoundation 0x000000010b1982b5 +[NSException raise:format:] + 197
3 UIKit 0x00000001091f345b -[UIView(Internal) _setViewDelegate:] + 231
4 UIKit 0x00000001092dda13 +[UIViewController setViewController:forView:] + 41
5 UIKit 0x00000001092d5292 -[UIViewController setView:] + 522
6 PpushiOS 0x0000000104ebdbfc xamarin_dyn_objc_msgSendSuper + 220
7 ??? 0x000000011e0e9f2c 0x0 + 4799242028
8 ??? 0x000000012271a4de 0x0 + 4872840414

at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:310
at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/runtime/Delegates.generated.cs:126
at at (wrapper native-to-managed) ObjCRuntime.Runtime:throw_ns_exception (intptr)
at at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_IntPtr (intptr,intptr,intptr)
at UIKit.UIViewController.set_View (UIKit.UIView value) [0x00040] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/src/build/ios/native/UIKit/UIViewController.g.cs:2729
at CarouselView.FormsPlugin.iOS.CarouselViewRenderer.CreateViewController (System.Int32 index) [0x00110] in <78d737c765134c5bafa5a0691d6978a8>:0
at CarouselView.FormsPlugin.iOS.CarouselViewRenderer.m__0 (UIKit.UIPageViewController pageViewController, UIKit.UIViewController referenceViewController) [0x00020] in <78d737c765134c5bafa5a0691d6978a8>:0
at UIKit.UIPageViewController+_UIPageViewControllerDataSource.GetPreviousViewController (UIKit.UIPageViewController pageViewController, UIKit.UIViewController referenceViewController) [0x0000d] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/src/build/ios/native/UIKit/UIPageViewController.g.cs:587
at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0003`

Same happens (but earlier) when using the SetCurrentPage method instead of swiping. The error is pretty much the same:

Foundation.MonoTouchException: Objective-C exception thrown. Name: UIViewControllerHierarchyInconsistency Reason: A view can only be associated with at most one view controller at a time! View <Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer: 0x7fe43c018e50; frame = (0 0; 320 470); autoresize = LM+W+RM+TM+H+BM; layer = <CALayer: 0x61800182e480>> is associated with <CarouselView_FormsPlugin_iOS_ViewContainer: 0x7fe43cd75950>. Clear this association before associating this view with <CarouselView_FormsPlugin_iOS_ViewContainer: 0x7fe43ca768a0>.
Native stack trace:
0 CoreFoundation 0x0000000113e79d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001144de21e objc_exception_throw + 48
2 CoreFoundation 0x0000000113ee32b5 +[NSException raise:format:] + 197
3 UIKit 0x00000001114e845b -[UIView(Internal) _setViewDelegate:] + 231
4 UIKit 0x00000001115d2a13 +[UIViewController setViewController:forView:] + 41
5 UIKit 0x00000001115ca292 -[UIViewController setView:] + 522
6 PpushiOS 0x000000010e16bbfc xamarin_dyn_objc_msgSendSuper + 220
7 ??? 0x0000000127397f2c 0x0 + 4953046828
8 ??? 0x000000012b8cd01f 0x0 + 5025615903

at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:310
at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/runtime/Delegates.generated.cs:126
at at (wrapper native-to-managed) ObjCRuntime.Runtime:throw_ns_exception (intptr)
at at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_IntPtr (intptr,intptr,intptr)
at UIKit.UIViewController.set_View (UIKit.UIView value) [0x00040] in /Users/builder/data/lanes/3985/4d858103/source/xamarin-macios/src/build/ios/native/UIKit/UIViewController.g.cs:2729
at CarouselView.FormsPlugin.iOS.CarouselViewRenderer.CreateViewController (System.Int32 index) [0x00110] in <78d737c765134c5bafa5a0691d6978a8>:0
at CarouselView.FormsPlugin.iOS.CarouselViewRenderer.SetCurrentController (System.Int32 position) [0x000b6] in <78d737c765134c5bafa5a0691d6978a8>:0
at CarouselView.FormsPlugin.Abstractions.CarouselViewControl.SetCurrentPage (System.Int32 position) [0x0000b] in <09d0125b14a645b5ba406d1198523a1c>:
[...]

The invoking function looks like this
if (index > -1 && index < Tabs.Count) { Carousel.SetCurrentPage(index); Update(); }
Nothing special

Thx in advance for any help

Android crash when swiping

It's a random issue, but easy to reproduce with NuGet v2.2.0.

The demo project in the github repo can also reproduce it.

When you swipe left to right or right to left between pages(>=3 pages) in CarouselView, the app will crash randomly, IOS has no such issue, only Android can reproduce it.

The exception looks like this:

09-27 17:46:02.868 I/InputReader( 933): Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.4543 ] when=507385318680000
09-27 17:46:02.878 I/InputDispatcher( 933): Delivering touch to (1187): action: 0x4, toolType: 1
09-27 17:46:02.878 I/InputDispatcher( 933): Delivering touch to (19593): action: 0x0, toolType: 1
09-27 17:46:02.878 V/BitmapFactory(19593): DecodeImagePath(decodeResourceStream3) : res/drawable-xxhdpi-v4/swing_i_q_mark_blurred.png
09-27 17:46:02.888 D/InputDispatcher( 933): Waiting for application to become ready for input: xxxx Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 29. Wait queue head age: 506.6ms.
09-27 17:46:02.918 D/AutomaticBrightnessController( 933): applyLightSensorMeasurementSEC : mIsLockZone = false
09-27 17:46:02.938 D/ViewRootImpl(19593): ViewPostImeInputStage ACTION_DOWN
09-27 17:46:02.948 D/Mono (19593): DllImport attempting to load: '/system/lib/liblog.so'.
09-27 17:46:02.948 D/Mono (19593): DllImport loaded library '/system/lib/liblog.so'.
09-27 17:46:02.948 D/Mono (19593): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
09-27 17:46:02.948 D/Mono (19593): Searching for '__android_log_print'.
09-27 17:46:02.948 D/Mono (19593): Probing '__android_log_print'.
09-27 17:46:02.948 D/Mono (19593): Found as '_android_log_print'.
09-27 17:46:02.948 I/MonoDroid(19593): UNHANDLED EXCEPTION:
09-27 17:46:02.978 I/MonoDroid(19593): System.ObjectDisposedException: Cannot access a disposed object.
09-27 17:46:02.978 I/MonoDroid(19593): Object name: 'Android.Views.GestureDetector'.
09-27 17:46:02.978 I/MonoDroid(19593): at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00030] in :0
09-27 17:46:02.978 I/MonoDroid(19593): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00001] in :0
09-27 17:46:02.978 I/MonoDroid(19593): at Android.Views.GestureDetector.OnTouchEvent (Android.Views.MotionEvent ev) [0x00036] in <2092df06fb0f41af8ef155ac7920eea4>:0
09-27 17:46:02.978 I/MonoDroid(19593): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Android.Views.View.IOnTouchListener.OnTouch (Android.Views.View v, Android.Views.MotionEvent e) [0x0004a] in <95895bcb439e42ebb8e7134a545f1acc>:0
09-27 17:46:02.978 I/MonoDroid(19593): at Android.Views.View+IOnTouchListenerInvoker.n_OnTouch_Landroid_view_View_Landroid_view_MotionEvent
(System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v, System.IntPtr native_e) [0x00019] in <2092df06fb0f41af8ef155ac7920eea4>:0
09-27 17:46:02.978 I/MonoDroid(19593): at (wrapper dynamic-method) System.Object:79304763-5567-4133-9faf-996d577d65b2 (intptr,intptr,intptr,intptr)
09-27 17:46:03.018 D/CrashlyticsCore(19593): Crashlytics is handling uncaught exception "java.lang.Throwable: Cannot access a disposed object.
09-27 17:46:03.018 D/CrashlyticsCore(19593): Object name: 'Android.Views.GestureDetector'." from thread main
09-27 17:46:03.018 D/Answers (19593): Logged crash
09-27 17:46:03.038 D/CrashlyticsCore(19593): No log data to include with this event.
0

ItemsSource changes from view

Hi.

First of all: thanks for your component. I think it's much needed in the Xamarin.Forms world. Much obliged.

Though i ran into some big problems resetting the ItemsSource and adding / removing items from it.

At the moment the View (Renderer) removes and adds items from the collection itself. In my opinion that's a design flaw. At first it seemed to me, that the component supported DataBinding, including reflecting changes to the itemssource (observablecollection / INotifyCollectionChanged), which unfortunately isn't the case.

I think the CarouselViewControl should listen to changes to the ItemsSource and the InsertPage and RemovePage should only remove the displayed Views and not touch the ItemsSource-collection.

I'm not sure, whether there are any platform specific contraints on the component and that's why it's implemented the way it is now - changing it on android wasn't a problem (at least doing it quick and dirty)

I might send a pull request some time in the future, but at the moment i don't have the time.

For now i just wanted to 'hint' that the current design is a bit misleading (providing a bindable ItemsSource, but not reflecting changes to the view and making the Renderer change the ItemsSource-collection)

(probably for a lot of cases the itemssource won't ever change and the component works great in these cases)

greetings

Vertical CarouselView

does vertical carousel view will be released at any point or it will be just horizontal?

Visualize more than one page at a time

Hi @alexrainman and thanks for this great works. Your Carousel works as "Xamarin" Carousel. If I swipe from right to left, the first page disappear and the second appears. Could be possible to add a property that does not made a "jump" from page1 to page2, but swipe can display part of page1 and part of page2 in the same time... hope to be clear...

Crash on adding an item to carouselView

hi @alexrainman
I used the plugin and created a simple test to see how it looks. I receive a crash as soon as adding an item

this is the message I receive in android using API 23

Java.Lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 0, found: 1 Pager id: []:id/pager Pager class: class android.support.v4.view.ViewPager Problematic adapter: class md5fa3be16b83ce3acd3be83265686c14de.CarouselViewRenderer_PageAdapter

am i doing anthing wrong?

here is the sample XAML

`<carousel:CarouselViewControl ItemsSource="{Binding MyImages}" Orientation="Horizontal"
ShowIndicators="True" PageIndicatorTintColor="White" InterPageSpacing="2" Position="0" CurrentPageIndicatorTintColor="Orange" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" >

    <carousel:CarouselViewControl.ItemTemplate>
      <DataTemplate>
        <Image  Aspect="AspectFill" Source="{Binding}"  />
      </DataTemplate>
    </carousel:CarouselViewControl.ItemTemplate>

</carousel:CarouselViewControl>`

error in TabbedPage

hello!
i found an error with ( CirclePageIndicator.OnDraw ),
this is Exception:
System.NullReferenceException: Object reference not set to an instance of an object.

and ScreenShot:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.