Ejemplo n.º 1
0
        public LoadingView(XOverLayControl details) : base(details)
        {
            DoLayout();

            // derive the center x and y
            var centerX = Frame.Width / 2;
            var centerY = Frame.Height / 2;

            // create the activity spinner, center it horizontall and put it 5 points above center x
            var transform = CoreGraphics.CGAffineTransform.MakeScale(1.5f, 1.5f);

            _activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray)
            {
                Transform = transform
            };

            _activitySpinner.Frame = new CGRect(
                centerX - (_activitySpinner.Frame.Width / 2),
                centerY - (_activitySpinner.Frame.Height / 2),
                _activitySpinner.Frame.Width,
                _activitySpinner.Frame.Height);
            _activitySpinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
            AddSubview(_activitySpinner);
            _activitySpinner.StartAnimating();
        }
Ejemplo n.º 2
0
        public static LoadingFragment NewInstance(XOverLayControl details)
        {
            var detailsFrag = new LoadingFragment
            {
                Arguments   = new Bundle(),
                ViewDetails = details
            };

            return(detailsFrag);
        }
Ejemplo n.º 3
0
 public void ShowLoadingScreen(XOverLayControl details)
 {
     if (IsActive(LoadingOverLay) == false)
     {
         var frag = LoadingFragment.NewInstance(details);
         using (var manager = Current.FragmentManager.BeginTransaction())
         {
             manager.Add(Android.Resource.Id.Content, frag, LoadingOverLay);
             HideAll(manager, LoadingOverLay);
             manager.Commit();
         }
     }
 }
Ejemplo n.º 4
0
 public void ShowLoadingScreen(XOverLayControl details)
 {
     if (IsActive(LoadingOverLay) == false)
     {
         WriteMessage("ShowLoadingScreen");
         var view = new LoadingView(details)
         {
             Tag   = LoadingOverLay,
             Alpha = details.Alpha
         };
         MainWindow.AddSubview(view);
         HideAll(LoadingOverLay);
     }
 }
Ejemplo n.º 5
0
 protected OverlayView(XOverLayControl details, bool xibView = false)
 {
     // configurable bits
     _viewDetails = details;
     //this.BackgroundColor = UIColor.Black;
     if (_viewDetails.HasNavigationBar == false)
     {
         // check NavigationBar
         _viewDetails.HasNavigationBar =
             UIApplication.SharedApplication.KeyWindow.Subviews.FirstOrDefaultFromMany(item => item.Subviews,
                                                                                       x => x is UINavigationBar) != null;
         NavigationBarHeightOther    = 0;
         NavigationBarHeightPortrait = 0;
     }
     if (xibView == false)
     {
         SetViewProperties(this);
     }
     RegisterForObserver();
 }
Ejemplo n.º 6
0
 public OverLayFragments(XOverLayControl details)
 {
     ViewDetails = details;
 }