Esempio n. 1
0
        /// <summary>Callback from UI Button. Parses the text in <see cref="countText"/> as an int and sets it as the new item count, refreshing all the views</summary>
        public void UpdateItems()
        {
            int newCount;

            int.TryParse(gridParams.countText.text, out newCount);

            // Generating some random models
            var models = new BasicModel[newCount];

            for (int i = 0; i < newCount; ++i)
            {
                models[i]       = new BasicModel();
                models[i].title = "Item " + i;
            }
            _GridAdapter.ChangeModels(models);
        }
Esempio n. 2
0
 void UpdateSelectionState(MyCellViewsHolder viewHolder, BasicModel model)
 {
     viewHolder.longClickableComponent.gameObject.SetActive(!_SelectionMode); // can be long-clicked only if selection mode is off
     viewHolder.toggle.gameObject.SetActive(_SelectionMode);                  // can be selected only if selection mode is on
     viewHolder.toggle.isOn = model.isSelected;
 }
 public void UpdateViews(BasicModel model)
 {
     title.text       = "#" + ItemIndex + " [id:" + model.id + "]";
     background.color = model.color;
 }
Esempio n. 4
0
 void HandleItemDeletion(BasicModel model)
 {
     Debug.Log("Deleted: " + model.title);
 }
 void HandleItemDeletion(BasicModel model)
 {
     Debug.Log("Deleted with id: " + model.id);
 }