Example #1
0
        private void TrainersSpinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            Spinner spin = (Spinner)sender;

            currTrainer = spin.GetItemAtPosition(e.Position).ToString();
            switch (currTrainer)
            {
            case "עידו":
                CurrNumber = "0542077344";
                Toasty.Info(this, "עידו " + CurrNumber, 3, true).Show();
                c = true;
                break;

            case "נועם":
                CurrNumber = "0546544244";
                Toasty.Info(this, " נועם" + CurrNumber, 3, true).Show();
                c = true;
                break;

            case "נצי":
                CurrNumber = "0547682373";
                Toasty.Info(this, " נצי" + CurrNumber, 3, true).Show();
                c = true;
                break;

            default:
                c = false;
                break;
            }
        }
Example #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            FindViewById <Button>(Resource.Id.ButtonErrorToast).Click += delegate
            {
                Toasty.Error(this, "This is an error toast").Show();
            };

            FindViewById <Button>(Resource.Id.ButtonSuccessToast).Click += delegate
            {
                Toasty.Success(this, "Success").Show();
            };

            FindViewById <Button>(Resource.Id.ButtonInfoToast).Click += delegate
            {
                Toasty.Info(this, "Here is some info for you").Show();
            };
            FindViewById <Button>(Resource.Id.ButtonWarningToast).Click += delegate
            {
                Toasty.Warning(this, "Beware of the dog").Show();
            };
            FindViewById <Button>(Resource.Id.ButtonNormalToastWithoutIcon).Click += delegate
            {
                Toasty.Normal(this, "Normal toast without icon").Show();
            };
            FindViewById <Button>(Resource.Id.ButtonNormalToastWithIcon).Click += delegate
            {
                var icon = ToastyUtils.GetDrawable(this, Resource.Drawable.ic_pets_white_48dp);
                Toasty.Normal(this, "Normal toast with icon", icon).Show();
            };
        }
Example #3
0
        //formats the string in DD/MM/YYYY format
        #endregion

        private void RB_Click(object sender, EventArgs e)
        {
            RadioButton rb = (RadioButton)sender;

            Toasty.Config.Instance
            .TintIcon(true)
            .SetToastTypeface(Typeface.CreateFromAsset(Assets, "Katanf.ttf"));
            Toasty.Info(this, rb.Text, 5, false).Show();
            c = true;
        }
Example #4
0
        private void Edittexts_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            Spinner spin = (Spinner)sender;

            Toasty.Info(this, "" + spin.SelectedItem, 3, true).Show();
        }
Example #5
0
        //Dialog MyButton Click
        public void BuildDialog(object sender, int f)
        {
            MyButton b = (MyButton)sender;

            for (int i = 0; i < exes.Count; i++)
            {
                if (exes[i].name.Equals(b.Text))
                {
                    ab1 = exes[i];
                }
            }
            d1 = new Dialog(this);
            //if (exes.Contains)
            d1.SetCancelable(true);
            d1.SetTitle(ab1.name);
            d1.SetContentView(Resource.Layout.MyDialog);
            LinearLayout ll = d1.FindViewById <LinearLayout>(Resource.Id.AbcDEF);

            ll.Orientation = Orientation.Vertical;
            //
            LinearLayout DialogLayout = new LinearLayout(this);

            DialogLayout.LayoutParameters = vWrap;
            DialogLayout.Orientation      = Orientation.Vertical;
            DialogLayout.SetGravity(GravityFlags.CenterVertical);
            //Dialog TitleTV
            ExDialogTitle = new EditText(this);
            ExDialogTitle.SetBackgroundColor(Color.RoyalBlue);
            ExDialogTitle.Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf");
            ExDialogTitle.SetTextColor(Color.DarkRed);
            ExDialogTitle.TextSize = 40;
            ExDialogTitle.Text     = ab1.name;
            DialogLayout.AddView(ExDialogTitle);
            //
            DialogExplenationTextView          = new EditText(this);
            DialogExplenationTextView.Text     = ab1.explenatiotn.ToString();
            DialogExplenationTextView.TextSize = 30;
            DialogExplenationTextView.SetTextColor(Color.Black);
            //
            if (f == 1)
            {
                if (!h)
                {
                    for (int i = 0; i < exes.Count; i++)
                    {
                        if (buttons[i].Text == b.Text)
                        {
                            b.Time = buttons[i].Time;

                            h = true;
                        }
                    }
                }
                dur = new EditText(this)
                {
                    Text             = b.Time.ToString(),
                    LayoutParameters = OneTwentyParams,
                    Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
                    TextSize         = 35,
                };
                dur.SetBackgroundResource(Resource.Drawable.MyBackground);
                dur.InputType = InputTypes.ClassPhone;
                //
            }
            Save = new MyButton(this)
            {
                Text             = "Save",
                LayoutParameters = OneTwentyParams,
                TextSize         = 35,
                Typeface         = Typeface.CreateFromAsset(Assets, "Katanf.ttf"),
            };
            bool a = false;

            Save.Click += delegate
            {
                OAduration       -= b.Time;
                b.Time            = int.Parse(dur.Text);
                OAduration       += b.Time;
                OAdurationTV.Text = OAduration.ToString();
                a = true;
                if (OAduration <= 50 && OAduration >= 40)
                {
                    OAdurationTV.SetTextColor(Color.LawnGreen);
                }
                else if (OAduration > 50)
                {
                    OAdurationTV.SetTextColor(Color.Red);
                }
                else
                {
                    OAdurationTV.SetTextColor(Color.Black);
                }
                if (ExDialogTitle.Text != ab1.name)
                {
                    ab1.name = ExDialogTitle.Text;
                    a        = true;
                    Toasty.Info(this, "Happened2", 2, false).Show();
                }
                else if (DialogExplenationTextView.Text != ab1.explenatiotn)
                {
                    ab1.explenatiotn = DialogExplenationTextView.Text;
                    a = true;
                    Toasty.Info(this, "Happened3", 2, false).Show();
                }
                if (a == true)
                {
                    HashMap map = new HashMap();
                    map.Put("Explenation", ab1.explenatiotn);
                    map.Put("Name", ab1.name);
                    DocumentReference DocRef = database.Collection("Users").Document(admin.email).Collection("Exercises").Document(ab1.name);
                    DocRef.Set(map);
                }
            };
            ////Add BitMap
            //
            DialogLayout.AddView(DialogExplenationTextView);
            if (f == 1)
            {
                DialogLayout.AddView(dur);
            }
            DialogLayout.AddView(Save);
            ll.AddView(DialogLayout);
            d1.Show();
        }
Example #6
0
        public void ShowInfoToast(string message, bool longToast = false)
        {
            var toastLength = GetToastLength(longToast);

            Toasty.Info(Application.Context, message, toastLength, true).Show();
        }