// Path: firestore/app/src/main/java/com/google/firebase/example/fireeats/java/model/Restaurant.java
// @IgnoreExtraProperties
// public class Restaurant {
// 
//     public static final String FIELD_CITY = "city";
//     public static final String FIELD_CATEGORY = "category";
//     public static final String FIELD_PRICE = "price";
//     public static final String FIELD_POPULARITY = "numRatings";
//     public static final String FIELD_AVG_RATING = "avgRating";
// 
//     private String name;
//     private String city;
//     private String category;
//     private String photo;
//     private int price;
//     private int numRatings;
//     private double avgRating;
// 
//     public Restaurant() {}
// 
//     public Restaurant(String name, String city, String category, String photo,
//                       int price, int numRatings, double avgRating) {
//         this.name = name;
//         this.city = city;
//         this.category = category;
//         this.photo = photo;
//         this.price = price;
//         this.numRatings = numRatings;
//         this.avgRating = avgRating;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getCategory() {
//         return category;
//     }
// 
//     public void setCategory(String category) {
//         this.category = category;
//     }
// 
//     public String getPhoto() {
//         return photo;
//     }
// 
//     public void setPhoto(String photo) {
//         this.photo = photo;
//     }
// 
//     public int getPrice() {
//         return price;
//     }
// 
//     public void setPrice(int price) {
//         this.price = price;
//     }
// 
//     public int getNumRatings() {
//         return numRatings;
//     }
// 
//     public void setNumRatings(int numRatings) {
//         this.numRatings = numRatings;
//     }
// 
//     public double getAvgRating() {
//         return avgRating;
//     }
// 
//     public void setAvgRating(double avgRating) {
//         this.avgRating = avgRating;
//     }
// }


import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Spinner;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import com.google.firebase.example.fireeats.R;
import com.google.firebase.example.fireeats.databinding.DialogFiltersBinding;
import com.google.firebase.example.fireeats.java.model.Restaurant;
import com.google.firebase.firestore.Query;
        }
    }

    @Nullable
    private String getSelectedCity() {
        String selected = (String) mBinding.spinnerCity.getSelectedItem();
        if (getString(R.string.value_any_city).equals(selected)) {
            return null;
        } else {
            return selected;
        }
    }

    private int getSelectedPrice() {
        String selected = (String) mBinding.spinnerPrice.getSelectedItem();
        if (selected.equals(getString(R.string.price_1))) {
            return 1;
        } else if (selected.equals(getString(R.string.price_2))) {
            return 2;
        } else if (selected.equals(getString(R.string.price_3))) {
            return 3;
        } else {
            return -1;
        }
    }

    @Nullable
    private String getSelectedSortBy() {
        String selected = (String) mBinding.spinnerSort.getSelectedItem();
        if (getString(R.string.sort_by_rating).equals(selected)) {
// Path: firestore/app/src/main/java/com/google/firebase/example/fireeats/java/model/Restaurant.java
// @IgnoreExtraProperties
// public class Restaurant {
// 
//     public static final String FIELD_CITY = "city";
//     public static final String FIELD_CATEGORY = "category";
//     public static final String FIELD_PRICE = "price";
//     public static final String FIELD_POPULARITY = "numRatings";
//     public static final String FIELD_AVG_RATING = "avgRating";
// 
//     private String name;
//     private String city;
//     private String category;
//     private String photo;
//     private int price;
//     private int numRatings;
//     private double avgRating;
// 
//     public Restaurant() {}
// 
//     public Restaurant(String name, String city, String category, String photo,
//                       int price, int numRatings, double avgRating) {
//         this.name = name;
//         this.city = city;
//         this.category = category;
//         this.photo = photo;
//         this.price = price;
//         this.numRatings = numRatings;
//         this.avgRating = avgRating;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getCategory() {
//         return category;
//     }
// 
//     public void setCategory(String category) {
//         this.category = category;
//     }
// 
//     public String getPhoto() {
//         return photo;
//     }
// 
//     public void setPhoto(String photo) {
//         this.photo = photo;
//     }
// 
//     public int getPrice() {
//         return price;
//     }
// 
//     public void setPrice(int price) {
//         this.price = price;
//     }
// 
//     public int getNumRatings() {
//         return numRatings;
//     }
// 
//     public void setNumRatings(int numRatings) {
//         this.numRatings = numRatings;
//     }
// 
//     public double getAvgRating() {
//         return avgRating;
//     }
// 
//     public void setAvgRating(double avgRating) {
//         this.avgRating = avgRating;
//     }
// }


// Path: firestore/app/src/main/java/com/google/firebase/example/fireeats/java/FilterDialogFragment.java
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Spinner;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import com.google.firebase.example.fireeats.R;
import com.google.firebase.example.fireeats.databinding.DialogFiltersBinding;
import com.google.firebase.example.fireeats.java.model.Restaurant;
import com.google.firebase.firestore.Query;

        }
    }

    @Nullable
    private String getSelectedCity() {
        String selected = (String) mBinding.spinnerCity.getSelectedItem();
        if (getString(R.string.value_any_city).equals(selected)) {
            return null;
        } else {
            return selected;
        }
    }

    private int getSelectedPrice() {
        String selected = (String) mBinding.spinnerPrice.getSelectedItem();
        if (selected.equals(getString(R.string.price_1))) {
            return 1;
        } else if (selected.equals(getString(R.string.price_2))) {
            return 2;
        } else if (selected.equals(getString(R.string.price_3))) {
            return 3;
        } else {
            return -1;
        }
    }

    @Nullable
    private String getSelectedSortBy() {
        String selected = (String) mBinding.spinnerSort.getSelectedItem();
        if (getString(R.string.sort_by_rating).equals(selected)) {
            return Restaurant.FIELD_AVG_RATING;