public void OnItemLongClicked(LongClickableItem longClickedItem)
            {
                // Enter selection mode
                SetSelectionMode(true);
                RefreshSelectionStateForVisibleCells();
                UpdateSelectionActionButtons();

                if (_Params.autoSelectFirstOnSelectionMode)
                {
                    // Find the cell view holder that corresponds to the LongClickableItem parameter & mark it as toggled
                    int visibleCellCount = GetNumVisibleCells();
                    for (int i = 0; i < visibleCellCount; ++i)
                    {
                        var cellVH = GetCellViewsHolder(i);

                        if (cellVH.longClickableComponent == longClickedItem)
                        {
                            var model = _Data[cellVH.itemIndex];
                            model.isSelected = true;
                            UpdateSelectionState(cellVH, model);

                            break;
                        }
                    }
                }
            }
Example #2
0
        public void OnItemLongClicked(LongClickableItem longClickedItem)
        {
            // Enter selection mode
            SetSelectionMode(true);
            RefreshSelectionStateForVisibleCells();
            UpdateSelectionActionButtons();

            if (_Params.autoSelectFirstOnSelectionMode)
            {
                // Find the cell views holder that corresponds to the LongClickableItem parameter & mark it as toggled
                int numVisibleCells = GetNumVisibleCells();
                for (int i = 0; i < numVisibleCells; ++i)
                {
                    var cellVH = base.GetCellViewsHolder(i);

                    if (cellVH.longClickableComponent == longClickedItem)
                    {
                        var model = LazyData.GetOrCreate(cellVH.ItemIndex);
                        SelectModel(model);
                        UpdateSelectionState(cellVH, model);

                        break;
                    }
                }
            }
        }
            public override void CollectViews()
            {
                base.CollectViews();

                toggle = views.Find("Toggle").GetComponent <Toggle>();
                title  = views.Find("TitleText").GetComponent <Text>();
                longClickableComponent = views.Find("LongClickableArea").GetComponent <LongClickableItem>();
            }
Example #4
0
        /// <inheritdoc/>
        public override void CollectViews()
        {
            base.CollectViews();

            toggle = views.Find("Toggle").GetComponent <Toggle>();
            title  = views.Find("TitleText").GetComponent <Text>();
            longClickableComponent  = views.Find("LongClickableArea").GetComponent <LongClickableItem>();
            background              = views.GetComponent <Image>();
            expandCollapseComponent = views.GetComponent <ExpandCollapseOnClick>();
            expandCollapseComponent.nonExpandedSize = .001f;
            expandCollapseComponent.expandFactor    = 1 / expandCollapseComponent.nonExpandedSize;
            expandCollapseComponent.expanded        = true;
        }