Exemplo n.º 1
0
    private void SetState(State state)
    {
        _state = state;

        if (_state == State.Default)
        {
            _selectedNotesData.Clear();
            _selectedNoteData = null;
            _addAndEditScreen.SetActive(false);
            _deleteButton.SetActive(false);
            _addButton.SetActive(true);

            SmallList <EnhancedScrollerCellView> list = _scroller.GetActiveCellViews();
            for (int i = 0; i < list.Count; i++)
            {
                (list[i] as NoteUiItem).SetState(NoteUiItem.State.Normal);
            }
        }
        else if (_state == State.Selection)
        {
            _deleteButton.SetActive(true);
            _addButton.SetActive(false);
            SmallList <EnhancedScrollerCellView> list = _scroller.GetActiveCellViews();
            for (int i = 0; i < list.Count; i++)
            {
                (list[i] as NoteUiItem).SetState(NoteUiItem.State.Selection);
            }
        }
        else if (_state == State.Edit)
        {
            if (_selectedNoteData != null)
            {
                _editScrenTopBarTitle.text = _selectedNoteData.GetDate().ToString("d MMMM, yyyy");
                _noteInput.text            = _selectedNoteData.noteText;
            }
            else
            {
                _editScrenTopBarTitle.text = _targetDate.ToString("d MMMM, yyyy");
                _noteInput.text            = "";
            }

            _addAndEditScreen.SetActive(true);

            // activate input field and show mobile keyboard automatically
            _noteInput.ActivateInputField();
            _noteInput.MoveTextEnd(false);
        }
    }
Exemplo n.º 2
0
    public List <int> GetSelectedPhotosIndexes()
    {
        List <int> indexes = new List <int>();
        SmallList <EnhancedScrollerCellView> activeItems = scroller.GetActiveCellViews();

        PhotosUiItem[] items;
        for (int i = 0; i < activeItems.Count; i++)
        {
            PhotosBlockUiItem blockUiItem = activeItems[i].GetComponent <PhotosBlockUiItem>();
            items = blockUiItem.GetSelectedItems();

            for (int j = 0; j < items.Length; j++)
            {
                int index = _data.IndexOf(items[j].GetTexture());
                indexes.Add(index);
                Debug.Log($"Index added as selected photo index: {index}");
            }
        }

        return(indexes);
    }