Exemplo n.º 1
0
        private async void LikeButton_Hold(object sender, bool e)
        {
            if (e)
            {
                if (App.BiliViewModel.CheckAccoutStatus())
                {
                    bool result = await _videoService.TripleVideoAsync(_detail.aid);

                    if (result)
                    {
                        LikeButton.IsCheck     = true;
                        CoinButton.IsCheck     = true;
                        FavoriteButton.IsCheck = true;
                        CoinButton.ShowBubble();
                        FavoriteButton.ShowBubble();
                        new TipPopup("已一键三连~").ShowMessage();
                        UpdateVideoInfo();
                    }
                    else
                    {
                        new TipPopup("一键三连失败QAQ").ShowError();
                    }
                }
            }
        }
Exemplo n.º 2
0
 private async void FavoriteButton_AnimationOnIsVisible(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "IsVisible" && FavoriteButton.IsVisible)
     {
         await FavoriteButton.Animate(new ShakeAnimation());
     }
 }
Exemplo n.º 3
0
        private void ChangeFavoriteBtnImageHandler(ChangeFavoriteBtnImageMessage obj)
        {
            var image = obj.IsRecipeFavorite
                ? UIImage.FromBundle("MiscellaneousImg/FavoriteBtnFilled")
                : UIImage.FromBundle("MiscellaneousImg/FavoriteBtn");

            FavoriteButton.SetImage(image, UIControlState.Normal);
        }
Exemplo n.º 4
0
        void ReleaseDesignerOutlets()
        {
            if (FavoriteButton != null)
            {
                FavoriteButton.Dispose();
                FavoriteButton = null;
            }

            if (RecipeImage != null)
            {
                RecipeImage.Dispose();
                RecipeImage = null;
            }
        }
 private void BindVotes()
 {
     if (GalleryItem == null)
     {
         return;
     }
     bindings.Add(this.SetBinding(() => GalleryItem.IsUpVoted)
                  .WhenSourceChanges(() => SetColor(GalleryItem.IsUpVoted, UpvoteButton, new global::Android.Graphics.Color(ContextCompat.GetColor(Activity, Resource.Color.Upvote)))));
     UpvoteButton.SetCommand("Click", GalleryItem.VoteCommand, "up");
     bindings.Add(this.SetBinding(() => GalleryItem.IsDownVoted)
                  .WhenSourceChanges(() => SetColor(GalleryItem.IsDownVoted, DownvoteButton, new global::Android.Graphics.Color(ContextCompat.GetColor(Activity, Resource.Color.Downvote)))));
     DownvoteButton.SetCommand("Click", GalleryItem.VoteCommand, "down");
     bindings.Add(this.SetBinding(() => GalleryItem.IsFavourited)
                  .WhenSourceChanges(() => SetColor(GalleryItem.IsFavourited, FavoriteButton, new global::Android.Graphics.Color(ContextCompat.GetColor(Activity, Resource.Color.Favorite)))));
     FavoriteButton.SetCommand("Click", GalleryItem.Favourite);
 }
Exemplo n.º 6
0
 public void ConfigureResourceDictionary(ResourceDictionary dictionary, string prefix)
 {
     Default.ConfigureResourceDictionary(dictionary, prefix);
     Highlight.ConfigureResourceDictionary(dictionary, prefix + "Highlight");
     KeyText.ConfigureResourceDictionary(dictionary, prefix + "KeyText");
     SubText.ConfigureResourceDictionary(dictionary, prefix + "SubText");
     HyperlinkText.ConfigureResourceDictionary(dictionary, prefix + "HyperlinkText");
     FavoriteCounter.ConfigureResourceDictionary(dictionary, prefix + "FavoriteCounter");
     RetweetCounter.ConfigureResourceDictionary(dictionary, prefix + "RetweetCounter");
     RetweetMarker.ConfigureResourceDictionary(dictionary, prefix + "RetweetMarker");
     FavoriteAndRetweetButton.ConfigureResourceDictionary(dictionary, prefix + "FavAndRtButton");
     FavoriteButton.ConfigureResourceDictionary(dictionary, prefix + "FavoriteButton");
     ColoredFavoriteButton.ConfigureResourceDictionary(dictionary, prefix + "ColoredFavoriteButton");
     RetweetButton.ConfigureResourceDictionary(dictionary, prefix + "RetweetButton");
     ColoredRetweetButton.ConfigureResourceDictionary(dictionary, prefix + "ColoredRetweetButton");
     MentionButton.ConfigureResourceDictionary(dictionary, prefix + "MentionButton");
     DeleteButton.ConfigureResourceDictionary(dictionary, prefix + "DeleteButton");
 }
Exemplo n.º 7
0
 bool ToggleFavorite()
 {
     if (FavoritesManager.IsFavorite(session.Key))
     {
         FavoriteButton.SetImage(new UIImage(AppDelegate.ImageNotFavorite), UIControlState.Normal);
         FavoritesManager.RemoveFavoriteSession(session.Key);
         return(false);
     }
     else
     {
         FavoriteButton.SetImage(new UIImage(AppDelegate.ImageIsFavorite), UIControlState.Normal);
         var fav = new Favorite {
             SessionID = session.ID, SessionKey = session.Key
         };
         FavoritesManager.AddFavoriteSession(fav);
         return(true);
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (LocationLabel != null)
            {
                LocationLabel.Dispose();
                LocationLabel = null;
            }

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }

            if (SpeakerLabel != null)
            {
                SpeakerLabel.Dispose();
                SpeakerLabel = null;
            }

            if (OverviewLabel != null)
            {
                OverviewLabel.Dispose();
                OverviewLabel = null;
            }

            if (FavoriteButton != null)
            {
                FavoriteButton.Dispose();
                FavoriteButton = null;
            }

            if (ScrollView != null)
            {
                ScrollView.Dispose();
                ScrollView = null;
            }
        }
Exemplo n.º 9
0
 public TweetTheme Clone()
 {
     return(new TweetTheme
     {
         Default = Default.Clone(),
         Highlight = Highlight.Clone(),
         KeyText = KeyText,
         SubText = SubText,
         HyperlinkText = HyperlinkText,
         FavoriteCounter = FavoriteCounter,
         RetweetCounter = RetweetCounter,
         RetweetMarker = RetweetMarker,
         FavoriteAndRetweetButton = FavoriteAndRetweetButton.Clone(),
         FavoriteButton = FavoriteButton.Clone(),
         ColoredFavoriteButton = ColoredFavoriteButton.Clone(),
         RetweetButton = RetweetButton.Clone(),
         ColoredRetweetButton = ColoredRetweetButton.Clone(),
         MentionButton = MentionButton.Clone(),
         DeleteButton = DeleteButton.Clone()
     });
 }
Exemplo n.º 10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            int width = 245;

            if (!UserInterfaceIdiomIsPhone)
            {
                width = 700;
            }

            session = BL.Managers.SessionManager.GetSession(sessionId);

            Title             = "Session Detail";
            TitleLabel.Text   = session.Title;
            SpeakerLabel.Text = session.SpeakerNames;
            TimeLabel.Text    = session.Start.ToString("dddd") + " " +
                                session.Start.ToString("H:mm") + " - " +
                                session.End.ToString("H:mm");
            LocationLabel.Text = session.Room;
            OverviewLabel.Text = session.Overview;

            SizeF titleSize = TitleLabel.StringSize(session.Title
                                                    , UIFont.FromName("Helvetica-Light", AppDelegate.Font16pt)
                                                    , new SizeF(245, 400), UILineBreakMode.WordWrap);

            TitleLabel.Font      = UIFont.FromName("Helvetica-Light", AppDelegate.Font16pt);
            TitleLabel.TextColor = UIColor.Black;
            TitleLabel.Frame     = new RectangleF(13, 15, width, titleSize.Height);
            TitleLabel.Lines     = 0;
            TitleLabel.Font      = UIFont.FromName("Helvetica-Light", AppDelegate.Font16pt);

            SizeF speakerSize = TitleLabel.StringSize(session.SpeakerNames
                                                      , UIFont.FromName("Helvetica-LightOblique", AppDelegate.Font10pt)
                                                      , new SizeF(245, 400), UILineBreakMode.WordWrap);

            SpeakerLabel.Font  = UIFont.FromName("Helvetica-LightOblique", AppDelegate.Font10pt);
            SpeakerLabel.Frame = new RectangleF(13
                                                , 15 + 13 + titleSize.Height
                                                , width, speakerSize.Height);
            TimeLabel.Font  = UIFont.FromName("Helvetica-Light", AppDelegate.Font7_5pt);
            TimeLabel.Frame = new RectangleF(13
                                             , 15 + titleSize.Height + 13 + speakerSize.Height + 5
                                             , width, 10);

            LocationLabel.Font  = UIFont.FromName("Helvetica-Light", AppDelegate.Font7_5pt);
            LocationLabel.Frame = new RectangleF(13
                                                 , 15 + titleSize.Height + 13 + speakerSize.Height + 7 + 12
                                                 , width, 10);

            float overviewLabelWidth  = 310;
            var   overviewLabelY      = 15 + titleSize.Height + 13 + speakerSize.Height + TimeLabel.Frame.Height + LocationLabel.Frame.Height + 20;
            float overviewLabelHeight = (UserInterfaceIdiomIsPhone?360:854) - overviewLabelY;

            OverviewLabel.Editable = false;
            OverviewLabel.Font     = UIFont.FromName("Helvetica-Light", AppDelegate.Font10_5pt);
            if (AppDelegate.IsPhone)
            {
                // going to scroll the whole thing!
                OverviewLabel.ScrollEnabled = false;

                SizeF overviewSize = OverviewLabel.StringSize(
                    session.Overview
                    , UIFont.FromName("Helvetica-Light", AppDelegate.Font10_5pt)
                    , new SizeF(overviewLabelWidth, 2500)                                             // just width wasn't working...
                    , UILineBreakMode.WordWrap);

                overviewLabelHeight = overviewSize.Height + 30;

                ScrollView.ContentSize = new SizeF(320, overviewLabelY + overviewLabelHeight + 10);
            }

            OverviewLabel.Frame = new RectangleF(5
                                                 , overviewLabelY
                                                 , UserInterfaceIdiomIsPhone?overviewLabelWidth:700
                                                 , overviewLabelHeight);


            FavoriteButton.TouchUpInside += (sender, e) => {
                ToggleFavorite();
            };

            if (FavoritesManager.IsFavorite(session.Key))
            {
                FavoriteButton.SetImage(new UIImage(AppDelegate.ImageIsFavorite), UIControlState.Normal);
            }
            else
            {
                FavoriteButton.SetImage(new UIImage(AppDelegate.ImageNotFavorite), UIControlState.Normal);
            }
        }