public void ListCellClicked(CanvasListCell <SoundFile> listCell, SoundFile sf)
        {
            // !!! SoundFile binding OCCURS ON ConfirmButtonClicked()
            if (canvasDelegate == null)
            {
                return;
            }

            VoiceOver.main.StopPreview();
            //canvasDelegate.LoadSoundClipsExclusivelyForCurrentLayout(
            if (canvasDelegate.IsOnDemandActive())
            {
                canvasDelegate.RefreshLoadStateForSoundMarkers(
                    completion: () => {
                    if (sf.loadState == LoadState.Success && sf.clip != null)
                    {
                        return;
                    }
                    canvasDelegate.LoadClipInSoundFile(sf, completion: (SoundFile returnedSoundFile) => {
                        VoiceOver.main.PlayPreview(returnedSoundFile);
                        listCell.ReloadUI();
                    });
                });
            }
            else
            {
                // ON-DEMAND is NOT active
                VoiceOver.main.PlayPreview(sf);
                listCell.ReloadUI();
            }
        }
        public virtual void CellClicked(CanvasListCell <D> listCell, D datum)
        {
            // selectedCell = listCell;

            if (!_canSelectMultipleCells)
            {
                cellWasSelected(listCell);
            }
            else
            {
                if (listCell.isSelected)
                {
                    cellWasDeselected(listCell);
                }
                else
                {
                    cellWasSelected(listCell);
                }
            }

            if (canvasDelegate == null || datum == null)
            {
                return;
            }

            // Get the clicked cell info
            canvasDelegate.ListCellClicked(listCell, datum);
        }
        public override void CellClicked(CanvasListCell <SoundMarker> listCell, SoundMarker datum)
        {
            base.CellClicked(listCell, datum); // Changes the selection state

            // Select other cells that are also synchronised with this new cell
            if (_mode == Mode.SyncronisedMarkers && listCell.isSelected && canvasDelegate != null)
            {
                HashSet <string> syncedMarkerIDs = canvasDelegate.SynchronisedMarkerIDsWithMarkerID(datum.hotspot.id);
                if (syncedMarkerIDs != null)
                {
                    foreach (CanvasListCell <SoundMarker> cell in currentCells)
                    {
                        if (cell.isSelected)
                        {
                            continue;
                        }                                  // Cell is already selected regardless
                        if (cell.datum.hotspot.id == datum.hotspot.id)
                        {
                            continue;
                        }                                                            // This is the cell that was just clicked

                        if (syncedMarkerIDs.Contains(cell.datum.hotspot.id))
                        {
                            base.CellClicked(cell, cell.datum);
                        }
                    }
                }
            }

            updateTitleState();
            UpdateBTNStates();
        }
Ejemplo n.º 4
0
        public void RefreshCells()
        {
            ClearCells();

            if (data == null)
            {
                return;
            }
            // add a child cell for each item
            foreach (D datum in data)
            {
                CanvasListCell <D> listCell = Instantiate(cellPrefab, Vector3.zero, Quaternion.identity).GetComponent <CanvasListCell <D> >();
                listCell.SetDatum(datum);

                listCell.transform.SetParent(listView.transform);
                listCell.transform.localScale = Vector3.one;

                Button cellButton = listCell.GetComponentInChildren <Button>();
                cellButton.onClick.AddListener(() => { CellClicked(listCell, datum); });

                currentCells.Add(listCell);

                selectedCell = null;
            }
        }
        public override void CellClicked(CanvasListCell <SoundFile> listCell, SoundFile datum)
        {
            base.CellClicked(listCell, datum);

            confirmButton.interactable = (selectedCell != null);
            VoiceOver.main.PlayPreview(datum);
        }
Ejemplo n.º 6
0
        public override void CellClicked(CanvasListCell <SoundFile> listCell, SoundFile datum)
        {
            base.CellClicked(listCell, datum);

            confirmButton.interactable = (_selectedCells.Count > 0);

            // This will now be handled by CanvasController
            // VoiceOver.main.PlayPreview(datum);
        }
        protected void cellWasDeselected(CanvasListCell <D> oldCell)
        {
            if (oldCell == null || !_selectedCells.Contains(oldCell))
            {
                return;
            }                                                                     // Already NOT selected

            oldCell.CellWasDeselected(this);

            _selectedCells.Remove(oldCell);
        }
Ejemplo n.º 8
0
        public override void BackButtonClicked()
        {
            base.BackButtonClicked();
            selectedCell = null;

            if (canvasDelegate == null)
            {
                return;
            }
            canvasDelegate.BackButtonClicked(this.canvasID);
        }
Ejemplo n.º 9
0
        public virtual void CellClicked(CanvasListCell <D> listCell, D datum)
        {
            selectedCell = listCell;

            if (canvasDelegate == null || datum == null)
            {
                return;
            }

            // Get the clicked cell info
            canvasDelegate.ListCellClicked(listCell, datum);
        }
Ejemplo n.º 10
0
        protected void cellWasSelected(CanvasListCell <D> newCell)
        {
            if (newCell == null || _selectedCells.Contains(newCell))
            {
                return;
            }                                                                    // Already selected

            newCell.CellWasSelected(this);

            if (!_canSelectMultipleCells)
            {
                deselectAllCells();
            }
            _selectedCells.Add(newCell);
        }
        public override void CellClicked(CanvasListCell <SoundMarker> listCell, SoundMarker datum)
        {
            base.CellClicked(listCell, datum);

            UpdateBTNStates();
        }
Ejemplo n.º 12
0
 public void ConfirmButtonClicked(CanvasUIScreen fromScreen, CanvasListCell <SoundFile> currentSelectedCell)
 {
     canvasDelegate?.BindSoundFile(currentSelectedCell.datum);
     BackButtonClicked(CanvasUIScreen.SoundFileList);
 }
Ejemplo n.º 13
0
 protected void DeleteCell(CanvasListCell <D> cellToDelete)
 {
     currentCells.Remove(cellToDelete);
     Destroy(cellToDelete.gameObject);
 }
Ejemplo n.º 14
0
        public override void CellClicked(CanvasListCell <Layout> listCell, Layout datum)
        {
            base.CellClicked(listCell, datum);

            UpdateBTNStates();
        }
Ejemplo n.º 15
0
 public void ConfirmButtonClicked(CanvasUIScreen fromScreen, CanvasListCell <SoundMarker> currentSelectedCell)
 {
     canvasDelegate?.SelectSoundMarker(currentSelectedCell.datum);
 }
Ejemplo n.º 16
0
 public void ConfirmButtonClicked(CanvasUIScreen fromScreen, CanvasListCell <Layout> currentSelectedCell)
 {
     canvasDelegate?.LoadLayout(currentSelectedCell.datum);
     BackButtonClicked(CanvasUIScreen.LayoutList);
 }
Ejemplo n.º 17
0
 public void ListCellClicked(CanvasListCell <Layout> listCell, Layout layout)
 {
 }
Ejemplo n.º 18
0
 public void ListCellClicked(CanvasListCell <SoundMarker> listCell, SoundMarker sso)
 {
 }
Ejemplo n.º 19
0
 public void ListCellClicked(CanvasListCell <SoundFile> listCell, SoundFile sf)
 {
     // !!! OCCURS ON ConfirmButtonClicked()
 }