Esempio n. 1
0
        protected void LongPressMethod(UILongPressGestureRecognizer gestureRecognizer)
        {
            Console.Write("LongPress");

            if (gestureRecognizer.State == UIGestureRecognizerState.Began)
            {
                CGPoint     p         = gestureRecognizer.LocationInView(uiTableView);
                NSIndexPath indexPath = uiTableView.IndexPathForRowAtPoint(p);

                if (indexPath != null)
                {
                    uiListView.RaiseItemLongPressEvent(indexPath.Row);
                    uiTableView.SelectRow(indexPath, true, UITableViewScrollPosition.None);
                }
            }
        }
Esempio n. 2
0
        private void nativeListView_OnItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            uiListView.RaiseItemLongPressEvent(e.Position - 1);
            return;

            if (!IsSelectedMode())
            {
                // Code to execute on item long click
                //uiListView.RaiseItemLongPressEvent();
                uiListView.MarkItemAsSelected(e.Position - 1);

                mainToolbar = mainActivity.FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
                mainToolbar.SetBackgroundColor(Android.Graphics.Color.DarkGray);
                mainToolbar.InflateMenu(Resource.Menu.NotificationMenu);
                mainToolbar.SetNavigationOnClickListener(new OnNavigationClickToolbar(mainActivity));
                mainToolbar.MenuItemClick += Toolbar_MenuItemClick;
                //mainToolbar.NavigationClick += MainToolbar_NavigationClick;
                mainToolbar.Title = $"{uiListView.ItemsSelectedCount()} seleccionado";
            }
        }