Esempio n. 1
0
        private async void CancelButton_Clicked(object sender, EventArgs e)
        {
            EditNumberFrame.IsVisible = false;
            EditNumberEntry.IsVisible = false;
            EditDateFrame.IsVisible   = false;
            OKButton.IsEnabled        = false;
            OKButton.IsVisible        = false;
            CancelButton.IsVisible    = false;
            CancelButton.IsEnabled    = false;
            AddButton.IsEnabled       = true;
            AddButton.IsVisible       = true;
            OKAimButton.IsVisible     = false;
            CancelAimButton.IsVisible = false;



            AnimButton.IsVisible      = true;
            AnimButton.IsEnabled      = true;
            OKAimButton.IsVisible     = false;
            CancelAimButton.IsVisible = false;
            AddButton.IsVisible       = true;
            ToggleEditAnimState(true, true);
            AnimButton.PlayFrameSegment(45, 125);
            CartAnimButton.PlayFrameSegment(50, 160); // use frame 160 if item is added to shopping cart
            CartAnimComplete = true;
            EditAnimButton.PlayFrameSegment(14, 48);
            EditAnimComplete = true;
            AnimButton.PlayFrameSegment(0, 25);
            CurrentFrame = 25;
            selectedItem = null;

            await(BindingContext as PantryView).RefreshPantry();
        }
Esempio n. 2
0
        private async void Handle_Completed(object sender, EventArgs e)
        {
            await FirebaseHelper.AddShoppingList(selectedItem.ItemName, NumberEntry.Text);

            NumberFrame.IsVisible = false;
            NumberEntry.IsVisible = false;
            AnimButton.PlayFrameSegment(45, 125);
            CartAnimButton.PlayFrameSegment(50, 160); // use frame 160 if item is added to shopping cart
            CartAnimComplete = true;
            EditAnimButton.PlayFrameSegment(14, 48);
            EditAnimComplete = true;
            AnimButton.PlayFrameSegment(0, 25);
            CurrentFrame = 25;
            selectedItem = null;
        }
Esempio n. 3
0
        private void CollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            selectedItem = (e.CurrentSelection.FirstOrDefault() as PantryItems);
            ToggleCartAnimState(true, false);
            CartAnimButton.PlayFrameSegment(0, 50);

            ToggleEditAnimState(true, false);
            EditAnimButton.PlayFrameSegment(0, 14);


            if (CurrentFrame == 25)
            {
                AnimButton.PlayFrameSegment(25, 45);
                CurrentFrame = 45;
            }
        }
Esempio n. 4
0
        private async void DatePicker_DateSelected(object sender, DateChangedEventArgs e)
        {
            await FirebaseHelper.AddPantryItem(selectedItem.ItemName, selectedItem.Amount, ExpDate); DateSelect.Date.ToString("MM/dd");

            (BindingContext as ShoppingListView).Delete.Execute(selectedItem);
            AnimButton.PlayFrameSegment(45, 125);
            CartAnimButton.PlayFrameSegment(23, 120); // use in between frames when adding to pantry <3
            CartAnimComplete = true;
            EditAnimButton.PlayFrameSegment(14, 48);
            EditAnimComplete = true;
            AnimButton.PlayFrameSegment(0, 25);
            CurrentFrame         = 25;
            selectedItem         = null;
            DateFrame.IsVisible  = false;
            DateSelect.IsVisible = false;
        }
Esempio n. 5
0
 private async void AddDeleteButton_Clicked(object sender, EventArgs e)
 {
     if (CurrentFrame == 25)
     {
         await Shell.Current.GoToAsync("PantryAddItem");
     }
     else if (CurrentFrame == 45)
     {
         (BindingContext as PantryView).Delete.Execute(selectedItem);
         AnimButton.PlayFrameSegment(45, 125);
         CartAnimButton.PlayFrameSegment(50, 102);
         CartAnimComplete = true;
         EditAnimButton.PlayFrameSegment(14, 48);
         EditAnimComplete = true;
         AnimButton.PlayFrameSegment(0, 25);
         CurrentFrame = 25;
         selectedItem = null;
     }
 }
Esempio n. 6
0
 private async void AddDeleteButton_Clicked(object sender, EventArgs e)
 {
     if (CurrentFrame == 25)
     {
         await Shell.Current.GoToAsync("ShoppingAddItem");
     }
     else if (CurrentFrame == 45)
     {
         (BindingContext as ShoppingListView).Delete.Execute(selectedItem);
         AnimButton.PlayFrameSegment(45, 125);
         CartAnimButton.PlayFrameSegment(98, 120); // use in between frames when adding to pantry <3
         CartAnimComplete = true;
         EditAnimButton.PlayFrameSegment(14, 48);
         EditAnimComplete = true;
         AnimButton.PlayFrameSegment(0, 25);
         CurrentFrame = 25;
         selectedItem = null;
     }
 }