Ejemplo n.º 1
0
        protected override void OnTouchClick(int x, int y)
        {
            foreach (var btn in buttons)
            {
                if (btn.Visible && btn.Rect.Contains(x, y))
                {
                    PlatformUtils.VibrateTick();
                    btn.Click();
                    return;
                }
            }

            if (popupRatio > 0.5f)
            {
                var rect = GetExpandedListRect();

                if (rect.Contains(x, y))
                {
                    var idx = (y - rect.Top + scrollY) / listItemSize;

                    if (idx >= 0 && idx < listItems.Length)
                    {
                        PlatformUtils.VibrateTick();
                        buttons[popupButtonIdx].ListItemClick?.Invoke(idx);
                        popupSelectedIdx = idx;
                    }
                }

                StartClosingList();
            }
        }
Ejemplo n.º 2
0
        protected void PlayPiano(int x, int y)
        {
            var note = GetPianoNote(x, y);

            if (note >= 0)
            {
                if (note != playAbsNote)
                {
                    playAbsNote = note;
                    App.PlayInstrumentNote(playAbsNote, true, true);
                    PlatformUtils.VibrateTick();
                    MarkDirty();
                }
            }
        }