public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ImageView.Image = UIImageHelper.FromFileAuto("iTunesArtwork");
            CancelButton.SetBackgroundImage(Images.Buttons.GreyButton.CreateResizableImage(new UIEdgeInsets(18, 18, 18, 18)), UIControlState.Normal);
            CancelButton.TintColor           = UIColor.Black;
            CancelButton.Layer.ShadowColor   = UIColor.Black.CGColor;
            CancelButton.Layer.ShadowOffset  = new SizeF(0, 1);
            CancelButton.Layer.ShadowOpacity = 0.3f;
            CancelButton.TouchUpInside      += (sender, e) => DismissViewController(true, OnDismissed);

            EnableButton.SetBackgroundImage(Images.Buttons.BlackButton.CreateResizableImage(new UIEdgeInsets(18, 18, 18, 18)), UIControlState.Normal);
            EnableButton.TintColor           = UIColor.White;
            EnableButton.Layer.ShadowColor   = UIColor.Black.CGColor;
            EnableButton.Layer.ShadowOffset  = new SizeF(0, 1);
            EnableButton.Layer.ShadowOpacity = 0.3f;
            EnableButton.TouchUpInside      += EnablePushNotifications;

            var lbl = new UILabel();

            lbl.Frame               = new RectangleF(ImageView.Frame.Width - 25, -15, 40, 40);
            lbl.TextAlignment       = UITextAlignment.Center;
            lbl.Layer.CornerRadius  = lbl.Frame.Width / 2;
            lbl.Layer.MasksToBounds = true;
            lbl.BackgroundColor     = UIColor.Red;
            lbl.Text      = "12";
            lbl.Font      = UIFont.SystemFontOfSize(18f);
            lbl.TextColor = UIColor.White;

            ImageView.AddSubview(lbl);

            _hud = new Hud(View);
        }
 void ProgressHandler(uint receivedSize, long expectedSize)
 {
     if (activityIndicator == null)
     {
         activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
         ImageView.AddSubview(activityIndicator);
         activityIndicator.Center = ImageView.Center;
         activityIndicator.StartAnimating();
     }
 }
Example #3
0
 void ProgressHandler(nint receivedSize, nint expectedSize)
 {
     if (activityIndicator == null)
     {
         InvokeOnMainThread(() => {
             activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
             ImageView.AddSubview(activityIndicator);
             activityIndicator.Center = ImageView.Center;
             activityIndicator.StartAnimating();
         });
     }
 }
 public MutliImageMediaCellView()
 {
     Identifier = Key;
     Enumerable.Range(0, 4).ForEach(x =>
     {
         var imageView = new NSImageView {
             AlphaValue = 0, Frame = new CGRect(0, 0, ImageWidth / 2, ImageWidth / 2)
         };
         ImageViews[x] = imageView;
         ImageView.AddSubview(imageView);
     });
 }
Example #5
0
            async void SetValues(Song song)
            {
                if (song == null)
                {
                    return;
                }
                ShowOffline           = song.OfflineCount > 0;
                MediaTypeImage.Hidden = !song.HasVideo;
                SetText(song);
                var locaImage = await song.GetLocalImage(ImageWidth);

                if (locaImage != null)
                {
                    ImageView.Image = locaImage;
                }
                else
                {
                    var artUrl = await ArtworkManager.Shared.GetArtwork(song);

                    if (string.IsNullOrWhiteSpace(artUrl))
                    {
                        ImageView.Image = Images.GetDefaultSongImage(ImageWidth);
                    }
                    else
                    {
                        ImageView.SetImage(NSUrl.FromString(artUrl), Images.GetDefaultSongImage(ImageWidth));
                    }
                }

                if (song != null && song.Id == Settings.CurrentSong)
                {
                    ImageView.AddSubview(overlay);
                    ImageView.AddSubview(Meter);
                    Meter.AutoUpdate = true;
                    Meter.Frame      = ImageView.Bounds.Inset(5, 5);
                    overlay.Frame    = ImageView.Bounds;
                }
                else if (Meter.Superview == ImageView)
                {
                    Meter.RemoveFromSuperview();
                    overlay.RemoveFromSuperview();
                }
            }