andreimisiukevich / contextmenu Goto Github PK
View Code? Open in Web Editor NEWContextView for Xamarin.Forms
License: MIT License
ContextView for Xamarin.Forms
License: MIT License
Hi there,
I am trying to tap a MoveToActionCell item, with no success.
Is there any way to achieve this? I have tried to set InputTransparent to true, but it seems to not work properly.
Regards,
AMM.
Create new controls for using it outside of ListView
It would be very useful to be able to use a viewcell as main content.
When downloading your project, these resources are missing in the sample:
ContextMenuSample/ContextMenuSample.iOS/Resources/phila.png
ContextMenuSample/ContextMenuSample.iOS/Resources/nets.png
ContextMenuSample/ContextMenuSample.iOS/Resources/bulls.png
Same for Android drawable folder.
For some reason, they are located in this folder: C:\Users\Zure1\Downloads\ContextMenu-master\ContextMenu-master\files
Good Day sir, thank you for the amazing piece of work, I have one issue that i have encountered, once i add an activity indicator to the form, the list only shows if you tap the content, it's weird, have you heard of this issue? or experienced it?
setting up ContextMenu for a custom viewcell that has a scrollview inside works, however the scrollview has consumed the ViewCell's child scrollview itself.
There is no property to get current state (opened or closed) of context menu view or cell. Such events do exist, but I think having seperate properties is nice and more convenient to work with.
I have found one issue while swiping items in the listview, is that if there is one item is already swiped and other item is tried to be swiped then previous ones is not getting reset.
Previously swiped item should be reset when new item is getting selected or swiped.
Can you suggest me how to close or reset previously swiped item in the listview ?
Please check out this screenshot:
https://us.v-cdn.net/5019960/uploads/editor/22/auomq1fnp8bv.png
Did it possible "Long press" on an element?
Your ContextMenu it's great component. But I also need a "Long press" on the item, is it possible?
I wont do something on "Long press".
Hi @AndreiMisiukevich
could you translate your XAML example in CSHARP?
Thanks
Alessandro
Hi, I'm interesting if it is possible to use SwipeActionContextHolder within a ListView?
I did try your example with CollectionView - it works OK, but for my project I need swipe-to-delete functionality in a ListView. When I tried to implement such functionality I got an uncaught exception:
System.InvalidCastException
Message=Specified cast is not valid.
If it is not possible to use a ListView at all then I just wanna know why :) Or maybe any ideas how I could extend your project?
If it should be possible then you can look at the example code with the error here: https://github.com/Alexander-Alekseev/ContextMenu/blob/list_view_example/ContextMenuSample/ContextMenuSample/Pages/MoveToDeletePage.xaml.
Hi @AndreiMisiukevich I have downloaded your source and deploied to a Zebra TC51 device with Android 6.0.1
I have these problems:
if I swipe the first Item (0), the swipe remove items 0 and 1
then app crash
--------- beginning of crash
07-21 11:54:15.188 29038-29038/com.sourcesoft.ContextMenuSample E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sourcesoft.ContextMenuSample, PID: 29038
android.runtime.JavaProxyThrowable: System.InvalidCastException: Specified cast is not valid.
at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00007] in <7999cc4bd5664eca8a72469344172ca3>:0
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) [0x000c9] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0013a] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.VisualElementPackager.<.ctor>b__10_0 (System.Object sender, Xamarin.Forms.Platform.Android.VisualElementChangedEventArgs args) [0x0000d] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs
1[TElement] e) [0x00031] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.Platform+DefaultRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs1[TElement] e) [0x00000] in <7999cc4bd5664eca8a72469344172ca3>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x000dd] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.ViewCellRenderer+ViewCellContainer.Update (Xamarin.Forms.ViewCell cell) [0x00100] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.ViewCellRenderer.GetCellCore (Xamarin.Forms.Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context) [0x00027] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.CellRenderer.GetCell (Xamarin.Forms.Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context) [0x00075] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.CellFactory.GetCell (Xamarin.Forms.Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context, Xamarin.Forms.View view) [0x0001e] in <7999cc4bd5664eca8a72469344172ca3>:0
at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (System.Int32 position, Android.Views.View convertView, Android.Views.ViewGroup parent) [0x0020a] in <7999cc4bd5664eca8a72469344172ca3>:0
at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 position, System.IntPtr native_convertView, System.IntPtr native_parent) [0x00018] in <263adecfa58f4c449f1ff56156d886fd>:0
at (wrapper dynamic-method) System.Object.8eff9719-70dd-4293-b7b4-3bf2100ffdd8(intptr,intptr,int,intptr,intptr)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <7802aa64ad574c33adca332a3fa9706a>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0001f] in <7802aa64ad574c33adca332a3fa9706a>:0
at Android.Views.ViewGroup.Layout (System.Int32 l,
Hello, this is an incredible library.
While trying it out in my project I've found out that the converterParameter
on widthRequest
for the [context].View
has a bit impact on the functionality of the swiping.
I've copied the code from your MenuFitWidthConverter.cs
class in my project because it was throwing an error.
I am using Xamarin.Forms 3.4.0.1039999
I've copied your example from https://github.com/AndreiMisiukevich/ContextMenu/blob/master/ContextMenuSample/ContextMenuSample/Pages/MoveToDeletePage.xaml but i can see that some of my items in my listview do not swipe. The ones that are "stuck" it appears that they have a smaller height than the rest that are working.
Thank you in advance.
Please see gif attached and my code:
<ListView ItemsSource="{Binding Notifications}"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
HasUnevenRows="True"
SelectionMode="None"
SeparatorVisibility="None"
IsPullToRefreshEnabled="False"
RefreshCommand="{Binding RefreshNotificationsCommand}"
IsRefreshing="{Binding IsLoading}"
x:Name="NotificationItemsView"
>
<ListView.ItemTemplate>
<DataTemplate>
<!--Swipe to delete-->
<context:SwipeActionContextHolder MovedCommand="{Binding MarkAsReadCommand}">
<context:SwipeActionContextMenuView ForceCloseCommand="{Binding ForceCloseCommand}">
<context:SwipeActionContextMenuView.View>
<Frame BackgroundColor="#512DA8"
Margin="15,5"
Padding="20"
WidthRequest="{Binding Source={x:Reference NotificationItemsView},
Path=Width,
Converter={StaticResource MenuFitWidthConverter},
ConverterParameter='70'}"
CornerRadius="10"
>
<StackLayout Orientation="Horizontal"
HorizontalOptions="FillAndExpand"
Spacing="10">
<Label Text="Text text , blah blah" />
</StackLayout>
</Frame>
</context:SwipeActionContextMenuView.View>
<context:SwipeActionContextMenuView.ContextTemplate>
<DataTemplate>
<Frame Margin="15, 5"
IsClippedToBounds="true"
CornerRadius="10"
BackgroundColor="Red"
>
<StackLayout Padding="10, 0"
Margin="0, 5"
>
<Label Text="Dismiss"
TextColor="White"
FontAttributes="Bold"
VerticalOptions="CenterAndExpand"
HorizontalOptions="EndAndExpand"
/>
</StackLayout>
</Frame>
</DataTemplate>
</context:SwipeActionContextMenuView.ContextTemplate>
</context:SwipeActionContextMenuView>
</context:SwipeActionContextHolder>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Hello Andrei.
Great job, I really like this lib.
The function is the same as SwipeActionContextMenuView, but with the ability to swipe both sides and each side performing a different function, just like the ios email application.
Thanks
Hello Mate,
first of all, you really developed a great module... really it works very smooth and nice. I have integrated your code in to my project like added BaseActionViewCell.cs files in my project and its working fine. But the problem i am facing right now is that i have to write unit test cases for each .cs file. i have written for all the classes except swipe module(your code). Please help me its urgent .
Following is the error when contextmenu is used in release mode:
Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void ContextMenu.Droid.ContextMenuScrollViewRenderer/<>c__DisplayClass12_0::b__1()' in assembly: 'ContextMenu.Droid.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.V4.Widget.NestedScrollView::SmoothScrollTo(System.Int32,System.Int32)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() App4.Android
Hi. First of all thanks for the plugin =) I collected few problems I was facing. If something that I described is unclear please write.
SideActionBarSamplePage code doesn't work on iOS platform when I'm using using Nuget package.
https://streamable.com/yzlor
If I'm launching the sample project from GitHub, everything works.
First move - swiping few ListView items, second move - try to swap another item. As you can see in video, only one item returns to previous state. Other swiped items remain shifted.
https://streamable.com/4xdcd
When set "FlowDirection=RightToLeft", swipe functional become broken:
https://streamable.com/k0q4n
Getting
I/MonoDroid(12340): System.TypeLoadException: Could not resolve type with token 01000042 from typeref (expected class 'Android.Support.V4.Widget.NestedScrollView' in assembly 'Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null')
on load at my Android 7.1.2. Cant test with any other devices
Gooling about the exception i found that other people had a similar one with Plugin.SecureStorage, but none of their solutions have worked for me: cleaning project, "Droid Project -> Property -> Android Option-> Linker -> "SDK Assemblies Only", checking for different xamarin.forms versions, or running in release mode. Any ideas of what could be causing this?
Im a new to C# and Xamarin so maybe is just some really obvious step wich i missed :/
Tested on android device api 23
using the sample app.
When I delete a few items, and scroll the listview - some items get into a state where they can only be swiped about 1 or 2 pixels.
Your plugin great, please support UWP thank!
I just installed this from nuget and im having a problem making it work.
dose the source code differ from nuget?
I have this in listview, the first 5 items work and i could slide it and the button come out but after the 5 items i cant slide anything. and also the items stop beging visible.
Here is my xaml have a look
<controls:YListView x:Name="lstVideos" OnSelected="lstVideos_OnSelected">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<views:SideContextMenuView IsAutoCloseEnabled="true">
<views:SideContextMenuView.View>
<Frame BorderColor="Transparent" Style="{StaticResource FrameContainer}"
WidthRequest="{Binding Source={x:Reference lstVideos},
Path=Width, Converter={ StaticResource MenuFitWidth},
ConverterParameter='0'}">
<StackLayout Style="{StaticResource FormFloatLeft}">
<Image Aspect="Fill" HeightRequest="40" WidthRequest="50" Source="{ Binding Path=., Converter={StaticResource ImageSource}}" ></Image>
<StackLayout Orientation="Vertical">
<StackLayout Style="{StaticResource FormFloatLeft}">
<Label Text="{Binding Title}" VerticalOptions="Start" HorizontalOptions="Start" Style="{StaticResource Header}" />
</StackLayout>
</StackLayout>
</StackLayout>
</Frame>
</views:SideContextMenuView.View>
<views:SideContextMenuView.ContextTemplate>
<DataTemplate>
<Frame Style="{StaticResource FrameContainer}" BorderColor="Transparent" CornerRadius="10" IsClippedToBounds="true">
<StackLayout Style="{StaticResource FormFloatLeft}">
<controls:CustomButton
IsVisible="{Binding Playable, Converter={StaticResource Invert}}"
CommandParameter="{Binding Video_Id}"
Image="download.png"
Clicked="CustomButton_Clicked"
HorizontalOptions="EndAndExpand"
VerticalOptions="StartAndExpand"
Style="{StaticResource Icon}" />
<controls:CustomButton
x:Name="btnDelete"
CommandParameter="{Binding Video_Id}"
Image="cancel.png"
Clicked="BtnDelete_Clicked"
HorizontalOptions="EndAndExpand"
VerticalOptions="StartAndExpand"
Style="{StaticResource Icon}" />
</StackLayout>
</Frame>
</DataTemplate>
</views:SideContextMenuView.ContextTemplate>
</views:SideContextMenuView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</controls:YListView>```
It should be fantastic to have a swipe to delete functionality...
Can I use this Control inside for example ContentView, without ListView or CollectionView?
Hello,
when the users go in the page with the list of items (only the first time?),
would be nice to have a way to show a short and strategic self-moving of the cells,
to inform the users that is possible to slide the cells
Thanks for your work!
Add properties "OuterLeftContent" and "OuterRightContent" to BaseActionViewCell. Setting a view to one of this property adds this view to the left/right side of the cell. When swiping the cell, the OuterContent will not be swiped.
This is useful for example if one needs to add any kind of progress bar to the ListView which should not be swiped.
how to avoid swiping two listview items at once
Good afternoon,
Thank you for this control, is really useful but i have a question. I want show the menu when i swipe each item, but i also want open the menu when the user tap on a icon located in each item.There is any property like isopened or something like that to set when the user tap the icon and then open the menu? To do the same action than swiping the item?
Thank you so much
David
Great plugin! I'm trying to change the text of < and > before and after a swipe.
Is there anyway I can detect swiping so that I can bind that text to change between > and < ?
Hey,
As title says, in my application I need the view cell to have a smaller width than the list view's, and in this case the swipe doesn't work anymore. Is this a bug or intended? Is there a work around to achieve this?
Thanks in advance,
Andrei
As per my requirement i have to use it inside List view (Not in Collection View). But whenever i debug it its crashed on Android/iOS both platforms. is there any way to use swipe functionality from left inside List view. Please also mention if it 's possible to use swipe left right in one item. \
Hey, I'm having this issue on swipe... as you can see in my vid, some work just fine but other doesn't work, they move just a bit, I don't know the problem here, I'm using SideActionBarCell rigth now, but I wanted to implement the SwipeActionContextMenuView, but I got the same bug...
this is how I'm using
<ListView ItemsSource="{Binding Path=NotificationsTemp}"
HasUnevenRows="True"
IsPullToRefreshEnabled="True"
SelectionMode="None"
RefreshCommand="{Binding GetNotificationsCommand}"
IsRefreshing="{Binding IsRefreshing}"
x:Name="Notificationlst"
RefreshControlColor="{DynamicResource orange}"
SeparatorColor="{DynamicResource orange}">
<ListView.ItemTemplate>
<DataTemplate>
<!--<ViewCell>
<ViewCell.ContextActions>
<MenuItem Clicked="MenuItem_Clicked" CommandParameter="{Binding .}"
Text="{Binding ItemClickedText}"/>
</ViewCell.ContextActions>
<views:NotificationsItemView HeightRequest="100"/>
</ViewCell>-->
<context:SideActionBarCell>
<context:SideActionBarCell.Content>
<views:NotificationsItemView HeightRequest="100" WidthRequest="{Binding Source={x:Reference Notificationlst}, Path=Width}"/>
</context:SideActionBarCell.Content>
<context:SideActionBarCell.ContextTemplate>
<DataTemplate>
<StackLayout Orientation="Horizontal" IsEnabled="{Binding ItemClickedEnabled}">
<!--<Button Text="Apagar" TextColor="White" WidthRequest="100" Clicked="Delete_Clicked" CommandParameter="{Binding .}" BackgroundColor="#A1120C"></Button>-->
<Button Text="{Binding ItemClickedText}" TextColor="White"
Clicked="MenuItem_Clicked" CommandParameter="{Binding .}"
WidthRequest="90" BackgroundColor="{Binding ItemClickedColor}"></Button>
</StackLayout>
</DataTemplate>
</context:SideActionBarCell.ContextTemplate>
</context:SideActionBarCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
also tried with CollectionView, same thing
Hi Andrei,
Great job, I really enjoy your work.
Is it possible to have a combination of Context Menus? Something similar to mail app on ios, a combination of side menu and swipe to delete?
Thx
On iOS everything works great but on Android the "ItemSelected" of the ListView is not triggered anyway. The Context-Action work perfectly, but when I click on the Content, nothing happens. Do I do something wrong or is this a bug?
<ListView x:Name="SampleList" ItemsSource="{Binding Items}" VerticalOptions="FillAndExpand" HasUnevenRows="true" RefreshCommand="{Binding LoadItemsCommand}" IsPullToRefreshEnabled="true" IsRefreshing="{Binding IsBusy, Mode=OneWay}" CachingStrategy="RecycleElement" ItemSelected="OnItemSelectedAsync" Margin="0, 0, 0, 10">
<ListView.ItemTemplate>
<DataTemplate>
<contextmenu:SideActionBarCell>
<contextmenu:SideActionBarCell.Content>
<ContentView WidthRequest="{Binding Source={x:Reference SampleList}, Path=Width}">
<StackLayout Orientation="Horizontal" Padding="10, 0, 5, 0" HorizontalOptions="FillAndExpand">
<StackLayout Orientation="Vertical" Margin="10, 0, 0, 0" HorizontalOptions="FillAndExpand" VerticalOptions="Center">
<Label Text="{Binding Name}" LineBreakMode="WordWrap" FontSize="15" TextColor="{StaticResource Primary}" FontAttributes="Bold" />
<Label Text="{Binding Herkunft}" LineBreakMode="WordWrap" FontSize="13" TextColor="{StaticResource LightTextColor}" />
</StackLayout>
<Image Source="ic_arrow_right.png" VerticalOptions="Center"/>
</StackLayout>
</ContentView>
</contextmenu:SideActionBarCell.Content>
<contextmenu:SideActionBarCell.ContextTemplate>
<DataTemplate>
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="{StaticResource Primary}">
<ImageButton HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Source="ic_list_more.png" Clicked="OnMore" Margin="15, 0, 15, 0" BackgroundColor="{StaticResource Primary}"/>
</StackLayout>
</DataTemplate>
</contextmenu:SideActionBarCell.ContextTemplate>
</contextmenu:SideActionBarCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Currently, it's only possible to swipe from right to left to reveal a ContextMenu. There should be a possibility to swipe from left to right too and reveal a ContextMenu on the left side of the cell.
How can you simple select a item inside the collection by commanding (I am using MVVM)
For some reason you just can't select anything from this.
Hi
Why SelectionChanged is not working in CollectionView?
Thanks
I get the above error when navigating to the page containing the contextmenu items the second time. I am using COntextViewCell 2.0.0. Any ideas?
Hi Andrei, is there any possibility to add tap command?
In my project side context menu view are inside in view cell of ListView and it works fine, but i can't to tap on list view elements now, ListView tap command is working fine only when context menu has input transparent = true
Hello Andrei,
Is there any way to make list view item scroll to left as well and add one or two views at left corner . please reply asap.
any help will be really appreciate
Thanks
How we can start refresh operation like
ItemsListView.BeginRefresh()
ItemsListView.EndRefresh();
hi,
the ForceCloseCommand seems to be not creating the close effect on the first row on the ListView on iOS. works fine on all the other rows.
Using Listview with RecycleElement disabled (enabling it is causing none of the listview context menus to dismiss)
noticing something similar on android too
Hi @AndreiMisiukevich I I upgraded to Xamarin Forms 3.6.0.264807 and compiled an apk release and the following exception came out
03-20 22:13:33.680 12386 12386 I MonoDroid: UNHANDLED EXCEPTION:
03-20 22:13:33.720 12386 12386 I MonoDroid: Java.Lang.RuntimeException: int[] offset=0 length=4352 dst.length=1
03-20 22:13:33.720 12386 12386 I MonoDroid: at Java.Interop.JniEnvironment+Arrays.SetIntArrayRegion (Java.Interop.JniObjectReference array, System.Int32 start, System.Int32 length, System.Int32* buffer) [0x0003f] in <6ff1b57bf204413890283db4db9f885b>:0
03-20 22:13:33.720 12386 12386 I MonoDroid: at Android.Runtime.JNIEnv.CopyArray (System.Int32[] src, System.IntPtr dest) [0x0002d] in <031883663a0e408897a6f567fca5881a>:0
03-20 22:13:33.720 12386 12386 I MonoDroid: at Android.Runtime.JNIEnv.NewArray (System.Int32[] array) [0x0001a] in <031883663a0e408897a6f567fca5881a>:0
03-20 22:13:33.720 12386 12386 I MonoDroid: at Android.Support.V4.Widget.NestedScrollView.DispatchNestedPreScroll (System.Int32 dx, System.Int32 dy, System.Int32[] consumed, System.Int32[] offsetInWindow, System.Int32 type) [0x00000] in <33eeedd1164f4f24b77d150d7e62ecfb>:0
03-20 22:13:33.720 12386 12386 I MonoDroid: at ContextMenu.Droid.ContextMenuScrollViewRenderer+d__12.MoveNext () [0x00241] in :0
03-20 22:13:33.720 12386 12386 I MonoDroid: --- End of stack trace from previous location where exception was thrown ---
SideActionBar-consecutive swipes and clicks on listview items do not auto close listview items
Hi,
I am seeking for assistance regarding the nuget package
I have tried to apply your nuget package to enable swipe action in my ListView:
<StackLayout>
<ListView Grid.Row="2" IsVisible="{Binding NotificationDataModel.HasNotifications}"
ItemsSource="{Binding NotificationDataModel.Notifications}"
HasUnevenRows="True"
ItemTapped="ListView_ItemTapped"
SelectionMode="None"
CachingStrategy="RecycleElementAndDataTemplate"
SeparatorColor="{StaticResource BlackDividerColor}"
WidthRequest="78">
<ListView.Behaviors>
<scroll:InfiniteScrollBehavior />
</ListView.Behaviors>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<context:SideContextMenuView IsAutoCloseEnabled="true">
<context:SideContextMenuView.View>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0" VerticalOptions="Start" Padding="16, 8, 8, 0">
<ctr:FontAwesomeIcon Icon="Envelope" IconStyle="Solid" Style="{StaticResource TitleStyle}" />
</StackLayout>
<StackLayout Grid.Column="1" HorizontalOptions="Fill" Padding="8" Spacing="4">
<Label Text="{Binding Title}" Style="{StaticResource TitleStyle}" />
<Label LineBreakMode="TailTruncation" Text="{Binding Body}" Style="{StaticResource SubtitleStyle}" />
<StackLayout Orientation="Horizontal" Padding="0, 8">
<ctr:FontAwesomeIcon Icon="Clock" VerticalOptions="Center" />
<Label Text="{Binding NotificationCreationTime}" Style="{StaticResource SubtitleStyle}" />
</StackLayout>
</StackLayout>
<StackLayout Grid.Column="2" Padding="8, 0, 16, 0" HorizontalOptions="End">
<ctr:FontAwesomeIcon Icon="ChevronRight" IconStyle="Solid" VerticalTextAlignment="Center" VerticalOptions="CenterAndExpand" />
</StackLayout>
</Grid>
</context:SideContextMenuView.View>
<context:SideContextMenuView.ContextTemplate>
<DataTemplate>
<StackLayout VerticalOptions="Start" Padding="16, 8, 8, 0">
<ctr:FontAwesomeIcon Icon="Envelope" IconStyle="Solid" Style="{StaticResource TitleStyle}" />
</StackLayout>
</DataTemplate>
</context:SideContextMenuView.ContextTemplate>
</context:SideContextMenuView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
However, the output from my code is some items become like the screenshot below and i cant swipe some items in my ListView. Kindly assist on this matter.
I have multiple list items and I swipe the 1st item to open the contextMenu. If I then swipe a 2nd item, the 1st item remains open, resulting in 2 items showing contextMenu.
On Android the 1st item closes as soon as I swipe another item.
Also, iOS does not snap/animate when swiping. It will remain half opened if you let go too soon. Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.