Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/main/java/com/hfad/beeradviser/BeerExpert.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class BeerExpert {
//TODO: Complete the Model with private members, a constructor, and getter/setter methods


String getRecommendation(String color) {
static String getRecommendation(String color) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this static, refactor the method to use a new "mColor" instance variable

//Adds brand recommendation data to an ArrayList
List<String> brandList = new ArrayList<>();
switch (color) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/hfad/beeradviser/FindBeerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public void onClickFindBeer(View view) {
String beerType = String.valueOf(colorSpinnerView.getSelectedItem());

//TODO: WRITE code to get recommendations from the BeerExpert class
String beerBrand = BeerExpert.getRecommendation(beerType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you use the model, be sure to use the reference variable, rather than the class name, e.g., use expert.getRecommendation() instead of BeerExpert.getRecommendation()



//TODO: MODIFY code to display the brands instead of the beerType using the BeerExpert class
brandsListView.setText(beerType);
brandsListView.setText(beerBrand);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work

}
}