Example #1
0
        public void OnSelection(MaterialDialog p0, View p1, int itemId, ICharSequence itemString)
        {
            try
            {
                if (OnClickActionFor == OnClickAction.Quality)
                {
                    Controller.VideoData.QualityVideoSelect = itemString.ToString();
                    QualityText.Text = Context.GetString(Resource.String.Lbl_Quality) + " - " + itemString.ToString();

                    var url = AppTools.GetLinkWithQuality(Controller.VideoData, itemString.ToString());
                    if (!string.IsNullOrEmpty(url))
                    {
                        Controller.PlayVideo(url, Controller.VideoData, VideoController.Player.CurrentPosition);
                    }
                }
                else if (OnClickActionFor == OnClickAction.PlaybackSpeed)
                {
                    PlaybackSpeedText.Text = Context.GetString(Resource.String.Lbl_Playback_Speed) + " - " + itemString.ToString();
                    var playbackParameters = new PlaybackParameters(AppTools.GetSpeed(itemString.ToString()));
                    Controller.ChangePlaybackSpeed(playbackParameters);
                }

                OnClickActionFor = OnClickAction.None;
                Dismiss();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #2
0
        public void ChildHotspotOpened(IHotspot childHotspot, OnClickAction childClickAction)
        {
            for (int i = 0; i < transform.childCount; i++)
            {
                var hotspot = transform.GetChild(i).GetComponent <IHotspot>();
                if (hotspot == childHotspot)
                {
                    continue;
                }
                if (hotspot != null)
                {
                    switch (childClickAction)
                    {
                    case OnClickAction.Disable:
                        hotspot.DisableInteractivity();
                        break;

                    case OnClickAction.Delete:
                    case OnClickAction.Hide:
                        transform.GetChild(i).gameObject.SetActive(false);
                        break;
                    }
                }
            }
        }
Example #3
0
    public void OnClickEvent(PointerEventData eventData)
    {
        if (false == eventData.dragging || (eventData.delta.magnitude < 1.1f && Vector2.Distance(eventData.pressPosition, eventData.position) < 12))
        {
            if (true == this.enabled)
            {
                if (true == _isClickAnimEnabled)
                {
                    PlayJumpAnim();
                }
            }
            if (null != _soundClick)
            {
                AudioManager.PlaySound(_soundClick);
            }

            if (null != _pageView)
            {
                _pageView.OnEndDrag(eventData);
            }
            SetBoxState(true);

            OnClickAction.Invoke(this);
        }
    }
 protected internal override void OnItemGUI(Rect rect, GUIStyle style)
 {
     if (UnityEngine.GUI.Button(rect, LabelContent, style))
     {
         OnClickAction?.Invoke();
     }
 }
Example #5
0
        private bool InvokeClickAction()
        {
            if (OnClick != null || OnClickAction != null)
            {
                bool allowed = true;
                if (!string.IsNullOrWhiteSpace(SubmitScope))
                {
                    allowed = CurrentContext.Validate(SubmitScope);
                }

                if (allowed)
                {
                    if (OnClick != null)
                    {
                        LogManager.Logger.Clicked(Id, OnClick.Expression);
                        CurrentContext.JokeProviderInternal.OnTap();
                        OnClick.Execute();
                        return(true);
                    }

                    if (OnClickAction != null)
                    {
                        LogManager.Logger.Clicked(Id, OnClickAction.Expression);
                        CurrentContext.JokeProviderInternal.OnTap();
                        OnClickAction.Execute();
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #6
0
        protected virtual bool InvokeClick()
        {
            if (OnClick != null || OnClickAction != null)
            {
                CloseModalWindows();
                EndEditing();
            }

            bool allowed = true;

            if (!string.IsNullOrWhiteSpace(SubmitScope))
            {
                allowed = CurrentContext.Validate(SubmitScope);
            }

            if (allowed)
            {
                if (OnClick != null)
                {
                    LogManager.Logger.Clicked(Id, OnClick.Expression, Text);
                    CurrentContext.JokeProviderInternal.OnTap();
                    OnClick.Execute();
                    return(true);
                }

                if (OnClickAction != null)
                {
                    LogManager.Logger.Clicked(Id, OnClickAction.Expression, Text);
                    CurrentContext.JokeProviderInternal.OnTap();
                    OnClickAction.Execute();
                    return(true);
                }
            }
            return(false);
        }
        protected internal override void OnItemGUI(Rect rect, GUIStyle style)
        {
            if (UnityEngine.GUI.Button(rect, IsSelected ? SelectedLabelContent : LabelContent))
            {
                if (!IsSelected)
                {
                    IsSelected = true;
                    OnClickAction?.Invoke();

                    OnSelectedAction?.Invoke(this);
                }
            }
        }
Example #8
0
        bool InvokeClickAction()
        {
            if (OnClick != null)
            {
                OnClick.Execute();
                return(true);
            }

            if (OnClickAction != null)
            {
                OnClickAction.Execute();
                return(true);
            }
            return(false);
        }
Example #9
0
        protected virtual bool InvokeClickAction()
        {
            if (OnClick != null)
            {
                _view.PlaySoundEffect(SoundEffects.Click);
                OnClick.Execute();
                return(true);
            }

            if (OnClickAction != null)
            {
                _view.PlaySoundEffect(SoundEffects.Click);
                OnClickAction.Execute();
                return(true);
            }
            return(false);
        }
Example #10
0
        // Playback Speed
        private void PlaybackSpeedOnClick(object sender, EventArgs e)
        {
            try
            {
                OnClickActionFor = OnClickAction.PlaybackSpeed;
                var dialogList = new MaterialDialog.Builder(Context).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);

                var playbackSpeeds = AppTools.GetListPlaybackSpeed();

                dialogList.Title(Context.GetString(Resource.String.Lbl_Playback_Speed));
                dialogList.Items(playbackSpeeds);
                dialogList.PositiveText(Context.GetText(Resource.String.Lbl_Close)).OnPositive(this);
                dialogList.AlwaysCallSingleChoiceCallback();
                dialogList.ItemsCallback(this).Build().Show();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Example #11
0
        // Quality Video
        private void QualityLayoutOnClick(object sender, EventArgs e)
        {
            try
            {
                OnClickActionFor = OnClickAction.Quality;
                var dialogList = new MaterialDialog.Builder(Context).Theme(AppSettings.SetTabDarkTheme ? AFollestad.MaterialDialogs.Theme.Dark : AFollestad.MaterialDialogs.Theme.Light);

                var arrayAdapter = AppTools.GetListQualityVideo(Controller.VideoData);

                dialogList.Title(Context.GetString(Resource.String.Lbl_Quality));
                dialogList.Items(arrayAdapter);
                dialogList.PositiveText(Context.GetText(Resource.String.Lbl_Close)).OnPositive(this);
                dialogList.AlwaysCallSingleChoiceCallback();
                dialogList.ItemsCallback(this).Build().Show();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Example #12
0
        protected virtual bool InvokeClick()
        {
            if (OnClick != null || OnClickAction != null)
            {
                CloseModalWindows();
                EndEditing();
            }

            if (OnClick != null)
            {
                OnClick.Execute();
                return(true);
            }

            if (OnClickAction != null)
            {
                OnClickAction.Execute();
                return(true);
            }
            return(false);
        }
Example #13
0
 private void ClickEvent(object sender, EventArgs e)
 {
     OnClickAction?.Invoke();
 }
 public ViewClickAction(OnClickAction action)
 {
     this.action = action;
 }