Esempio n. 1
0
        private void InitializeStyle()
        {
            BackgroundView.BarTintColor = Background;
            Separator.Color             = ThemeColors.HeaderBackground.GetDarker(0.4f);

            SortByLabel.Font      = Theme.OrgEventHeaderFont;
            SortByLabel.TextColor = Light;

            SortBySegments.SetTitleTextAttributes(
                new UITextAttributes {
                Font      = Theme.OrgEventHeaderFont,
                TextColor = Light
            },
                UIControlState.Highlighted);
            SortBySegments.SetTitleTextAttributes(
                new UITextAttributes {
                Font      = Theme.OrgEventHeaderFont,
                TextColor = Light
            },
                UIControlState.Normal);
            SortBySegments.TintColor = Light;

            FavoritesButton.Font = Theme.OrgEventHeaderFont;
            FavoritesButton.SetTitleColor(Light, UIControlState.Normal);
            FavoritesButton.SetImage(ThemeIcons.StarSmall, UIControlState.Normal);
            FavoritesButton.TintColor          = Light;
            FavoritesButton.Layer.BorderWidth  = 0.9f;
            FavoritesButton.Layer.CornerRadius = 4;
            FavoritesButton.Layer.BorderColor  = Light.CGColor;

            FavoritesButton.TouchDown += (sender, e) =>
                                         FavoritesButton.BackgroundColor = ThemeColors.ContentLightBackground.ColorWithAlpha(0.2f);
            FavoritesButton.TouchUpInside  += (sender, e) => UpdateFavoritesState();
            FavoritesButton.TouchUpOutside += (sender, e) => UpdateFavoritesState();
        }
Esempio n. 2
0
 private void UpdateFavoritesState()
 {
     UIView.Animate(UIConstants.AnimationDuration,
                    () =>
     {
         if (ShowOnlyFavotires)
         {
             FavoritesButton.SetTitleColor(Background, UIControlState.Normal);
             FavoritesButton.TintColor       = Background;
             FavoritesButton.BackgroundColor = Light;
         }
         else
         {
             FavoritesButton.SetTitleColor(Light, UIControlState.Normal);
             FavoritesButton.TintColor       = Light;
             FavoritesButton.BackgroundColor = UIColor.Clear;
         }
     });
 }