Exemplo n.º 1
0
        public AddPet()
        {
            InitializeComponent();
            imgChoosen.Source = null;
            services          = new DBFirebase();


            // Next Page button disabled until everything filled out -- logic still isn't thought through
            //btnAddPet.IsEnabled = false;

            // initialize the UI
            dogButton.BackgroundColor = Color.White;
            dogButton.BorderColor     = Color.LightGray;
            dogButton.TextColor       = Color.Black;

            catButton.BackgroundColor = Color.White;
            catButton.BorderColor     = Color.LightGray;
            catButton.TextColor       = Color.Black;

            exoticButton.BackgroundColor = Color.White;
            exoticButton.BorderColor     = Color.LightGray;
            exoticButton.TextColor       = Color.Black;


            maleButton.BackgroundColor = Color.White;
            maleButton.BorderColor     = Color.LightGray;
            maleButton.TextColor       = Color.Black;

            femaleButton.BackgroundColor = Color.White;
            femaleButton.BorderColor     = Color.LightGray;
            femaleButton.TextColor       = Color.Black;

            imgChoosen.HeightRequest = 0;
        }
 public AddCommentPage(Pet _pet)
 {
     services = new DBFirebase();
     pet      = _pet;
     InitializeComponent();
     Title               = "Leave a comment for " + pet.Name;
     Intro.Text          = "How was your interaction with " + pet.Name + "?";
     Comment.Placeholder = pet.Name + " was energetic, loved to play, scared of other dogs, ...";
 }
 public AddMediaPage(Pet _pet)
 {
     InitializeComponent();
     Title       = "Select photos of " + _pet.Name;
     pet         = _pet;
     service     = new DBFirebase();
     _imgStreams = new List <Stream>();
     urls        = new List <string>();
     Device.BeginInvokeOnMainThread(async() => await AskForPermissions());
 }
Exemplo n.º 4
0
        public UsersViewModel()
        {
            auth = DependencyService.Get <IAuth>();
            _firebaseStorageHelper = new FirebaseStorageHelper();
            _services       = new DBFirebase();
            AddUserCommand  = new Command(async() => await auth.AddUser(Name, Age, City, Description, Gender, OppositeGender, ImageUrl = await UploadPhoto(ImageUrl)));
            RefreshMessages = new Command(async() => await RefreshUserMessages());
            DownloadPhoto();

            SelectPhotoCommand = new Command(async() => await SelectPhoto());
            var test = auth.GetUserProfile();
        }
Exemplo n.º 5
0
        public AddPet2(string _petType, string _name, int _age, string _sex, MediaFile _file)
        {
            InitializeComponent();
            services     = new DBFirebase();
            petName.Text = "Tell us a little bit about " + _name + "'s personality ";

            // Pass over previous page's info
            petType = _petType;
            name    = _name;
            age     = _age;
            sex     = _sex;
            file    = _file;

            // initialize the button colors
            smallBtn.BackgroundColor = Color.White;
            smallBtn.BorderColor     = Color.LightGray;
            smallBtn.TextColor       = Color.Black;


            mediumBtn.BackgroundColor = Color.White;
            mediumBtn.BorderColor     = Color.LightGray;
            mediumBtn.TextColor       = Color.Black;

            largeBtn.BackgroundColor = Color.White;
            largeBtn.BorderColor     = Color.LightGray;
            largeBtn.TextColor       = Color.Black;

            yesMedBtn.BackgroundColor = Color.White;
            yesMedBtn.BorderColor     = Color.LightGray;
            yesMedBtn.TextColor       = Color.Black;

            noMedBtn.BackgroundColor = Color.White;
            noMedBtn.BorderColor     = Color.LightGray;
            noMedBtn.TextColor       = Color.Black;

            medicalConditionDetails.IsVisible     = false;
            medicalConditionDetails.HeightRequest = 0;

            pottyTrained.BackgroundColor = Color.White;
            pottyTrained.BorderColor     = Color.LightGray;
            pottyTrained.TextColor       = Color.Black;

            apartmentFriendly.BackgroundColor = Color.White;
            apartmentFriendly.BorderColor     = Color.LightGray;
            apartmentFriendly.TextColor       = Color.Black;
        }
Exemplo n.º 6
0
 public CharityHomeViewModel()
 {
     firebase = new DBFirebase();
     LoadUsers();
 }
Exemplo n.º 7
0
 public SupermarketChatViewModel()
 {
     firebase       = new DBFirebase();
     ChatCollection = new ObservableCollection <Chat>();
 }
 public SuperMarkeHometViewModel()
 {
     firebase       = new DBFirebase();
     UserCollcetion = new ObservableCollection <UserData>();
     LoadUsers();
 }
Exemplo n.º 9
0
 public PetsViewModel()
 {
     services = new DBFirebase();
     Pets     = services.getPets();
 }
Exemplo n.º 10
0
 public HouseHoldHomeViewMdoel()
 {
     firebase = new DBFirebase();
     LoadUsers();
 }
Exemplo n.º 11
0
 public CharityChatViewModel()
 {
     firebase       = new DBFirebase();
     ChatCollection = new ObservableCollection <Chat>();
 }
Exemplo n.º 12
0
        public PetDetailsPage(Pet _pet, ObservableCollection <Pet> petList)
        {
            InitializeComponent();

            pet = _pet;
            if (petList != null)
            {
                allPets = petList;
            }
            else
            {
                // Came from AddPet logic, so need to remove the two "Add Pet Details" pages
                for (var counter = 0; counter < 2; counter++)
                {
                    Application.Current.MainPage.Navigation.RemovePage(Application.Current.MainPage.Navigation.NavigationStack[Application.Current.MainPage.Navigation.NavigationStack.Count - 1]);
                }
            }



            // Page UI components:
            BindingContext          = pet;
            Title                   = pet.Name + " - " + pet.Affiliation;
            shelteredWithLabel.Text = "See who else is sheltered with " + pet.Name + "...";
            // var comments = pet.Comments;
            //var topComments = comments.Take(6).ToList();    // limits to only the top five comments
            //topComments.RemoveAt(0);    // bc first is blank
            //lstComments.ItemsSource = topComments;

            if (pet.Comments.Count == 1 && pet.Comments[0].Equals(""))
            {
                Console.WriteLine("comments count  = 1 and is blank");
                hasNoComments.IsVisible = true;
                lstComments.IsVisible   = false;
                SeeComments.IsVisible   = false;
            }
            else
            {
                hasNoComments.IsVisible = false;
                lstComments.IsVisible   = true;
                if (pet.Comments.Count > 4)
                {
                    SeeComments.IsVisible = true;
                }
                else
                {
                    SeeComments.IsVisible = false;
                }
                lstComments.ItemsSource = pet.Comments;
            }
            // NOTE - isENabled = false makes it not scrollable (but not sure what our desired behavior is)
            //else lstComments.ItemsSource = pet.Comments; // size wise this is fine, but need to remove the first blank!!

            // TODO - have to check user data if they've already favorited this pet or not
            faveImage.Source = "@drawable/star_empty.png";

            // Get filtered list of pets for shared affiliation
            services = new DBFirebase();
            if (petList != null)
            {
                lstSharedPets.ItemsSource = services.GetAffiliatedPets(petList, pet);
            }
        }
Exemplo n.º 13
0
        private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
        {
            DBFirebase dBFirebase = new DBFirebase();

            dBFirebase.OnUploadFile(cmaera);
        }
Exemplo n.º 14
0
 public HouseHoldChatViewModel()
 {
     firebase       = new DBFirebase();
     ChatCollection = new ObservableCollection <Chat>();
 }