partial void LikeButton_Activated(UIBarButtonItem sender)
        {
            Accengage.TrackLead("Facebook", "like");

            SCLAlertView alert = new SCLAlertView();

            alert.ShowSuccess(this.ParentViewController, "Thank you!", "Thanks for liking us on Facebook!", "Close", 3.0f);
        }
        SCLAlertView editionAlertView()
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShouldDismissOnTapOutside = true;
            alert.CustomViewColor           = UIColor.FromRGB(44, 147, 255);
            alert.HideAnimationType         = SCLAlertViewHideAnimation.FadeOut;
            alert.ShowAnimationType         = SCLAlertViewShowAnimation.FadeIn;

            return(alert);
        }
        void setUserName()
        {
            SCLAlertView alert = editionAlertView();

            UITextField textField = alert.AddTextField("User name");

            alert.AddButton("Send", () =>
            {
                string text = textField.Text;
                NSUserDefaults.StandardUserDefaults.SetValueForKey(new NSString(text), new NSString("user.name"));
                var list = new List <KeyValuePair <string, string> >();
                list.Add(new KeyValuePair <string, string>("user_name", text));
                Accengage.UpdateDeviceInfo(list);
            });

            var    name     = NSUserDefaults.StandardUserDefaults.ValueForKey(new NSString("user.name"));
            string subtitle = (name != null) ? "The current name is: " + name : "";

            alert.ShowEdit(this.ParentViewController, "User's name", subtitle, "cancel", 0);
        }
Пример #4
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            SCLAlertView alert     = new SCLAlertView();
            UITextField  textField = alert.AddTextField("Enter the quantity");

            textField.KeyboardType = UIKeyboardType.NumberPad;

            UITextField textField2 = alert.AddTextField("Enter the price");

            textField2.KeyboardType = UIKeyboardType.NumberPad;

            alert.ShouldDismissOnTapOutside = true;
            alert.CustomViewColor           = UIColor.FromRGB(44, 147, 255);
            alert.HideAnimationType         = SCLAlertViewHideAnimation.FadeOut;
            alert.ShowAnimationType         = SCLAlertViewShowAnimation.FadeIn;

            alert.AddButton("Send", () => {
                if (textField.Text != "" && textField2.Text != "")
                {
                    Console.WriteLine("Text Value: " + textField.Text);

                    Int32 quantity = Int32.Parse(textField.Text);
                    Double price   = Double.Parse(textField2.Text);

                    string product = "Product " + indexPath.Row.ToString();
                    AccengageItem accengageItem = new AccengageItem(product, "Brand", "Product", price, "EUR", quantity);

                    List <AccengageItem> listItem = new List <AccengageItem>();
                    listItem.Add(accengageItem);

                    Accengage.TrackPurchase("dePurchase", "EUR", quantity * price, listItem);
                }
            });

            alert.ShowEdit(this.ParentViewController, "How much ?", "", "Cancel", 0);

            TableView.DeselectRow(indexPath, true);
        }
        partial void ShowWaiting(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowWaiting(this, "Waiting", "Continue waittttttinggggg...", null, 5.0);
        }
        partial void ShowEdit(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowEdit(this, "Hello Edit", "This is a more descriptive text with edit textbox.", "OK", 0);
        }
        partial void ShowCustom(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowCustom(this, new UIImage("git.png"), UIColor.Purple, "Custom", "I'm with custom image and color", "OK", 0);
        }
        partial void ShowInfo(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowInfo(this, "Hello Info", "This is a more descriptive info text.", "OK", 0);
        }
        partial void ShowWarning(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowWarning(this, "Hello Warning", "This is a more descriptive warning text.", "OK", 0);
        }
        partial void ShowNotice(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowNotice(this, "Hello Notice", "This is a more descriptive notice text.", "OK", 0);
        }
        partial void ShowError(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowError(this, "Hello Error", "This is a more descriptive error text.", "OK", 0);
        }
        partial void ShowSuccess(UIButton sender)
        {
            SCLAlertView alert = new SCLAlertView();

            alert.ShowSuccess(this, "Hello World", "This is a more descriptive text.", "Done", 0);
        }