public void initListner()
        {
            sb_voice.ProgressChanged += ((sender, e) => {
                if (e.FromUser)
                {
                    setStreamVolume(e.Progress);
                }
            });
            sb_video.ProgressChanged += delegate(object sender, SeekBar.ProgressChangedEventArgs e) {
                if (e.FromUser)
                {
                    if (vv.IsPlaying)
                    {
                        vv.SeekTo(e.Progress);
                    }
                    else
                    {
                        vv.SeekTo(e.Progress);
                        btn_play.SetBackgroundResource(Resource.Drawable.selector_btn_play);
                    }
                }
            };
            //video buffer listener
            vv.BufferingUpdate += delegate(object sender, IO.Vov.Vitamio.MediaPlayer.BufferingUpdateEventArgs e) {
                updateSecondaryProgress(e);
            };
            //set buffered slow listener
            vv.Info += delegate(object sender, IO.Vov.Vitamio.MediaPlayer.InfoEventArgs e) {
                switch (e.P1)
                {
                //buffer started
                case (int)MediaInfo.BufferingStart:
                    ll_loading.Visibility = ViewStates.Visible;
                    break;

                //buffer end then play
                case (int)MediaInfo.BufferingEnd:
                    hideLoadingCtl();
                    break;

                default:
                    break;
                }
            };
            if (!screen.Type.Equals("audio-text-video"))
            {
                vv.Completion += delegate(object sender, IO.Vov.Vitamio.MediaPlayer.CompletionEventArgs e) {
                    vv.SeekTo(0);
                    tv_current_position.Text = Utils.formatMillis(0L);
                    var activity = Activity as ScreensActivity;
                    //set iswatched
                    editor.PutBoolean(screen.Id + "", true).Commit();
                    tv_loading.Text = "You have watched this video!";
                    activity.validateBtns();
                };
            }

            btn_voice.Click += delegate(object sender, EventArgs e) {
                toggleMute();
            };

            btn_exit.Click += delegate(object sender, EventArgs e) {
                DialogFactory.toastNegativePositiveDialog(Activity, "Return", "Are you sure to return to Lesson List?", Constants.RETURN_LIST_NEG);
            };

            btn_play.Click += delegate(object sender, EventArgs e) {
                play();
            };

            btn_share.Click += delegate(object sender, EventArgs e) {
                //todo:share function
            };
        }
Beispiel #2
0
 /// <summary>
 /// Submits the answers.
 /// </summary>
 private void submitAnswers()
 {
     updateAnswers();
     //toast a dialog
     DialogFactory.toastNegativePositiveDialog(this, "Submit", "Are you sure to submit the answers", Constants.SUBMIT_ANSWERS);
 }
Beispiel #3
0
 public override void OnBackPressed()
 {
     DialogFactory.toastNegativePositiveDialog(this, "Exit", "Are you sure to log out?", Constants.EXIT_CHOICE);
 }