Beispiel #1
0
 public void SetSaveButtonTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _saveButton.SetTheme(theme);
     });
 }
 public void SetUserAgreementTheme(IButtonTheme mainThemeName, string mainText, IButtonTheme attrThemeName, string attrText, int position)
 {
     InvokeOnMainThread(() =>
     {
         _userAgreementLink.SetTheme(mainThemeName, mainText, attrThemeName, attrText, position);
     });
 }
 public void SetSkipButtonTheme(IButtonTheme themeName)
 {
     InvokeOnMainThread(() =>
     {
         _skipButton.SetTheme(themeName);
     });
 }
Beispiel #4
0
 public void SetForgetPassTheme(IButtonTheme theme)
 {
     (Context as Activity)?.RunOnUiThread(() =>
     {
         _holder.ForgotPassTextView.SetTheme((ITextViewTheme)theme);
     });
 }
 public void SetNextButtonTheme(IButtonTheme themeName)
 {
     InvokeOnMainThread(() =>
     {
         _nextButton.SetTheme(themeName);
     });
 }
Beispiel #6
0
 public void SetLogInButtonTheme(IButtonTheme theme)
 {
     (Context as Activity)?.RunOnUiThread(() =>
     {
         _holder.AuthButton.SetTheme(theme);
     });
 }
Beispiel #7
0
 public void SetFacebookButtonTheme(IButtonTheme theme)
 {
     (Context as Activity)?.RunOnUiThread(() =>
     {
         _holder.NewFacebookImageButton.SetTheme(theme);
     });
 }
Beispiel #8
0
 public void SetForgetPassTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _forgetPassButton.SetTheme(theme);
     });
 }
Beispiel #9
0
 public void SetFacebookButtonTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _fbAuthButton.SetTheme(theme);
     });
 }
Beispiel #10
0
 public void SetRegistrationButtonTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _registrationButton.SetTheme(theme);
     });
 }
Beispiel #11
0
 public void SetLogInButtonTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _logInButton.SetTheme(theme);
     });
 }
Beispiel #12
0
        public static void SetTheme(this UIButton button, IButtonTheme mainTheme, string mainText, IButtonTheme attrTheme, string attrText, int position)
        {
            SetTheme(button, mainTheme);

            var firstAttributes = new UIStringAttributes();

            if (mainTheme.TextColor != null)
            {
                firstAttributes.ForegroundColor = (UIColor)mainTheme.TextColor;
            }

            if (mainTheme.TextSize > 0)
            {
                firstAttributes.Font = FontStyleFromEnum(mainTheme.TextStyle, (int)mainTheme.TextSize);
            }

            var secondAttributes = new UIStringAttributes
            {
                Font            = FontStyleFromEnum(attrTheme.TextStyle, (int)attrTheme.TextSize),
                ForegroundColor = (UIColor)attrTheme.TextColor,
                UnderlineStyle  = NSUnderlineStyle.Single //_nativeTheme.UnderlineStyles[linkFontStyle]
            };

            var prettyString = new NSMutableAttributedString(mainText.Insert(position, attrText));

            prettyString.SetAttributes(firstAttributes.Dictionary, new NSRange(0, position - 1));
            prettyString.SetAttributes(firstAttributes.Dictionary, new NSRange(position + attrText.Length - 1, prettyString.Length - position - attrText.Length));
            prettyString.SetAttributes(secondAttributes.Dictionary, new NSRange(position, attrText.Length));

            button.SetAttributedTitle(prettyString, UIControlState.Normal);
        }
Beispiel #13
0
 public void SetCancelButtonTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _cancelButton.SetTheme(theme);
     });
 }
 public PostSocialStylesHolderDroid(ThemeParser <T> themeParser)
 {
     NotLikeTheme = themeParser.GetThemeByName <IButtonTheme>(_notLikeThemeName);
     LikeTheme    = themeParser.GetThemeByName <IButtonTheme>(_likeThemeName);
     CommentTheme = themeParser.GetThemeByName <IButtonTheme>(_commentThemeName);
     ShareTheme   = themeParser.GetThemeByName <IButtonTheme>(_shareThemeName);
 }
Beispiel #15
0
 public void SetRecoveryButtonTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _passRecoveryButton.SetTheme(theme);
     });
 }
Beispiel #16
0
 public void SetRegButtonTheme(IButtonTheme themeName)
 {
     (Context as Activity)?.RunOnUiThread(() =>
     {
         _holder.RegButton.SetTheme(themeName);
     });
 }
Beispiel #17
0
 public void SetUserAgreementTheme(IButtonTheme mainThemeName, string mainText, IButtonTheme attrThemeName, string attrText, int position)
 {
     (Context as Activity)?.RunOnUiThread(() =>
     {
         _holder.UserAgreementTextView.SetTheme((ITextViewTheme)mainThemeName, mainText, (ITextViewTheme)attrThemeName, attrText, position);
     });
 }
Beispiel #18
0
 public void SetLikeDrawable(IButtonTheme theme)
 {
     Application.SynchronizationContext.Post(_ =>
     {
         _holder.LikeTextView.SetTheme((ITextViewTheme)theme);
     }, null);
 }
Beispiel #19
0
 public void SetCommentTheme(IButtonTheme theme)
 {
     Application.SynchronizationContext.Post(_ =>
     {
         _holder.CommentTextView.SetTheme((ITextViewTheme)theme);
     }, null);
 }
Beispiel #20
0
 public void SetShareTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         CleanImageForSmallDevice(theme);
         _shareButton.SetTheme(theme);
     });
 }
Beispiel #21
0
 public void SetLikeDrawable(IButtonTheme themeName)
 {
     InvokeOnMainThread(() =>
     {
         CleanImageForSmallDevice(themeName);
         _likeButton.SetTheme(themeName);
     });
 }
Beispiel #22
0
        public void SetCommentTheme(IButtonTheme theme)
        {
            InvokeOnMainThread(() =>
            {
                CleanImageForSmallDevice(theme);

                _commentButton.SetTheme(theme);
            });
        }
Beispiel #23
0
 public void SetLikeTheme(IButtonTheme theme)
 {
     InvokeOnMainThread(() =>
     {
         _likeButton.SetImage(null, UIControlState.Normal);
         CleanImageForSmallDevice(theme);
         _likeButton.SetTheme(theme);
     });
 }
 public EditContactStyleHolderDroid(ThemeParser <T> themeParser)
 {
     BackgroundTheme         = themeParser.GetThemeByName <IViewTheme>(_backgroundTheme);
     UnEditableTextNoneTheme = themeParser.GetThemeByName <IEditTextTheme>(_uneditableTextNoneTheme);
     EditTextNoneTheme       = themeParser.GetThemeByName <IEditTextTheme>(_editTextNoneTheme);
     EditTextFailTheme       = themeParser.GetThemeByName <IEditTextTheme>(_editTextFailTheme);
     TextViewTheme           = themeParser.GetThemeByName <ITextViewTheme>(_textViewTheme);
     SaveButtonTheme         = themeParser.GetThemeByName <IButtonTheme>(_saveButtonTheme);
     CancelButtonTheme       = themeParser.GetThemeByName <IButtonTheme>(_cancelButtonTheme);
 }
Beispiel #25
0
        private void CleanImageForSmallDevice(IButtonTheme theme, bool left = true)
        {
            var w = UIScreen.MainScreen.Bounds.Width;

            if (w == 320 || w == 568)
            {
                if (left)
                {
                    theme.ImageLeft = null;
                }
                else
                {
                    theme.ImageRight = null;
                }
            }
        }
Beispiel #26
0
        public static void SetTheme(this UIButton button, IButtonTheme theme)
        {
            SetTheme((UIView)button, (IViewTheme)theme);

            if (theme.TextColor != null)
            {
                button.SetTitleColor((UIColor)theme.TextColor, UIControlState.Normal);
            }

            if (theme.TextSize > 0)
            {
                button.Font = FontStyleFromEnum(theme.TextStyle, (int)theme.TextSize);
            }

            if (theme.CornerRadius > 0)
            {
                button.Layer.CornerRadius = theme.CornerRadius;
            }

            if (theme.BorderWidth > 0)
            {
                button.Layer.BorderWidth = theme.BorderWidth;
            }

            if (theme.BorderColor != null)
            {
                button.Layer.BorderColor = ((UIColor)theme.BorderColor).CGColor;
            }

            if (theme.ImageLeft != null)
            {
                button.SetImage((UIImage)theme.ImageLeft, UIControlState.Normal);
                //button.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
                //var availableSpace = button.ContentEdgeInsets.InsetRect(button.Bounds);
                //var availableWidth = availableSpace.Width - button.ImageEdgeInsets.Right - (button.ImageView?.Frame.Width ?? 0) - (button.TitleLabel?.Frame.Width ?? 0);
                //button.TitleEdgeInsets = new UIEdgeInsets(top: 0, left: availableWidth / 2, bottom: 0, right: 0);
            }

            if (theme.ImageRight != null)
            {
                button.SetImage((UIImage)theme.ImageRight, UIControlState.Normal);
                button.TitleEdgeInsets = new UIEdgeInsets(0, -button.ImageView.Frame.Size.Width, 0, button.ImageView.Frame.Size.Width);
                button.ImageEdgeInsets = new UIEdgeInsets(0, button.Frame.Size.Width - button.ImageView.Frame.Size.Width * 4, 0, -(button.Frame.Size.Width - button.ImageView.Frame.Size.Width));
            }
        }
 public void SetNextButtonTheme(IButtonTheme themeName)
 {
     _nextButton.SetTheme(themeName);
 }
Beispiel #28
0
 public UpdatePostStylesHolderDroid(ThemeParser <T> themeParser) : base(themeParser)
 {
     ToolsDisableTheme      = themeParser.GetThemeByName <IButtonTheme>(_toolsDisableTheme);
     TextFieldsDisableTheme = themeParser.GetThemeByName <IButtonTheme>(_textFieldsDisableTheme);
 }
Beispiel #29
0
 public static void SetTheme(this Button button, IButtonTheme theme)
 {
     SetTheme((TextView)button, (ITextViewTheme)theme);
 }