Esempio n. 1
0
 public async Task Snackbar(string message, string title, TypeSnackbar typeSnackbar)
 {
     if (typeSnackbar == TypeSnackbar.Success)
     {
         CookieBar.Build(CrossCurrentActivity.Current.Activity)
         // .SetIcon(Resource.Drawable.ic_done)
         .SetTitle(title)
         .SetIconAnimation(Resource.Animator.iconspin)
         .SetBackgroundColor(Resource.Color.backgroundcoockiesuccess)
         .SetTitleColor(Resource.Color.cookiebartitle)
         .SetMessageColor(Resource.Color.cookiebartitle)
         .SetMessage(message)
         .SetEnableAutoDismiss(true)
         .SetSwipeToDismiss(true)
         .Show();
     }
     else
     {
         CookieBar.Build(CrossCurrentActivity.Current.Activity)
         // .SetIcon(Resource.Drawable.ic_error)
         .SetTitle(title)
         .SetIconAnimation(Resource.Animator.iconspin)
         .SetBackgroundColor(Resource.Color.backgroundcoockieerror)
         .SetTitleColor(Resource.Color.cookiebartitle)
         .SetMessageColor(Resource.Color.cookiebartitle)
         .SetMessage(message)
         .SetEnableAutoDismiss(true)
         .SetSwipeToDismiss(true)
         .Show();
     }
 }
Esempio n. 2
0
        public async Task Snackbar(string message, string title, TypeSnackbar typeSnackbar)
        {
            var snackbar = new TTGSnackbar(message);

            if (typeSnackbar == TypeSnackbar.Success)
            {
                snackbar.MessageTextColor   = UIKit.UIColor.White;
                snackbar.AnimationType      = TTGSnackbarAnimationType.SlideFromBottomBackToBottom;
                snackbar.BackgroundColor    = ColorHelper.FromHex("#1E9690");
                snackbar.BottomMargin       = 0;
                snackbar.TopMargin          = 0;
                snackbar.LeftMargin         = 0;
                snackbar.RightMargin        = 0;
                snackbar.MessageTextAlign   = UITextAlignment.Center;
                snackbar.MessageMarginLeft  = 20;
                snackbar.MessageMarginRight = 20;
                snackbar.Height             = 150;
                snackbar.LocationType       = TTGSnackbarLocation.Top;
                snackbar.CornerRadius       = 0;
                snackbar.Show();
            }
            else
            {
                snackbar.MessageTextColor   = UIKit.UIColor.White;
                snackbar.AnimationType      = TTGSnackbarAnimationType.SlideFromBottomBackToBottom;
                snackbar.BackgroundColor    = ColorHelper.FromHex("#F44336");
                snackbar.BottomMargin       = 0;
                snackbar.TopMargin          = 0;
                snackbar.LeftMargin         = 0;
                snackbar.RightMargin        = 0;
                snackbar.MessageMarginLeft  = 20;
                snackbar.MessageMarginRight = 20;
                snackbar.Height             = 100;
                snackbar.MessageTextAlign   = UITextAlignment.Center;
                snackbar.LocationType       = TTGSnackbarLocation.Top;
                snackbar.CornerRadius       = 0;
                snackbar.Show();
            }
        }
Esempio n. 3
0
 public void Snack(string message, string title, TypeSnackbar typeSnack)
 {
     dial.Snackbar(message, title, typeSnack);
 }