Ejemplo n.º 1
0
                public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
                {
                    base.OnConfigurationChanged(newConfig);

                    // if we're entering landscape (wide or regular, we don't care)
                    if (newConfig.Orientation == Android.Content.Res.Orientation.Landscape)
                    {
                        // go fullscreen
                        ParentTask.NavbarFragment.EnableSpringboardRevealButton(false);
                        ParentTask.NavbarFragment.ToggleFullscreen(true);
                        ParentTask.NavbarFragment.NavToolbar.Reveal(false);
                    }
                    else
                    {
                        // if we're going portrait, turn off fullscreen
                        ParentTask.NavbarFragment.ToggleFullscreen(false);

                        // and if we're NOT in wide, enable the reveal button.
                        if (MainActivity.IsLandscapeWide( ) == false)
                        {
                            ParentTask.NavbarFragment.EnableSpringboardRevealButton(true);
                        }
                    }

                    ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                }
Ejemplo n.º 2
0
                public bool OnError(MediaPlayer mp, MediaError error, int extra)
                {
                    ProgressBar.Visibility = ViewStates.Gone;

                    // only show the resultView if we're active.
                    if (FragmentActive == true)
                    {
                        ResultView.Show(MessagesStrings.Error_Title,
                                        PrivateControlStylingConfig.Result_Symbol_Failed,
                                        MessagesStrings.Error_Watch_Playback,
                                        GeneralStrings.Retry);

                        ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));
                    }

                    if (mp != null)
                    {
                        mp.Stop( );
                        mp.Reset( );
                    }

                    MediaControllerPrepared = false;

                    PlayerState = MediaPlayerState.None;

                    //SyncUI( );

                    return(true);
                }
Ejemplo n.º 3
0
                public bool OnError(MediaPlayer mp, MediaError error, int extra)
                {
                    ProgressBar.Visibility = ViewStates.Gone;

                    ResultView.Show(MessagesStrings.Error_Title,
                                    PrivateControlStylingConfig.Result_Symbol_Failed,
                                    MessagesStrings.Error_Watch_Playback,
                                    GeneralStrings.Retry);

                    ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                    return(true);
                }
Ejemplo n.º 4
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    RelativeLayout view = new RelativeLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    view.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    view.SetBackgroundColor(Android.Graphics.Color.Black);
                    view.SetOnTouchListener(this);

                    ProgressBar = new ProgressBar(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ProgressBar.Indeterminate = true;
                    ProgressBar.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(0));
                    ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)ProgressBar.LayoutParameters).AddRule(LayoutRules.CenterInParent);
                    view.AddView(ProgressBar);

                    // setup our media controller for viewing the position of media
                    MediaController = new MediaController(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    MediaController.SetAnchorView(view);

                    ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                                  delegate
                    {
                        // we know we're bound, so now just retry.
                        ResultView.Hide( );
                        PlayerState = MediaPlayerState.Preparing;
                        StartAudio( );
                        SyncUI( );
                    });

                    return(view);
                }
Ejemplo n.º 5
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    MediaController = new MediaController(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    RelativeLayout view = new RelativeLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    view.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    view.SetBackgroundColor(Android.Graphics.Color.Black);
                    view.SetOnTouchListener(this);

                    VideoPlayer = new VideoView(Activity);
                    VideoPlayer.SetMediaController(MediaController);
                    VideoPlayer.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)VideoPlayer.LayoutParameters).AddRule(LayoutRules.CenterInParent);

                    ((view as RelativeLayout)).AddView(VideoPlayer);

                    VideoPlayer.SetOnPreparedListener(this);
                    VideoPlayer.SetOnErrorListener(this);

                    ProgressBar = new ProgressBar(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ProgressBar.Indeterminate = true;
                    ProgressBar.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(0));
                    ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)ProgressBar.LayoutParameters).AddRule(LayoutRules.CenterInParent);
                    view.AddView(ProgressBar);
                    ProgressBar.BringToFront();

                    ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), delegate { TryPlayMedia( ); });

                    return(view);
                }