diff --git a/app/src/main/java/com/example/nemophila/MapsActivity.java b/app/src/main/java/com/example/nemophila/MapsActivity.java index e2cbd28..65b1128 100644 --- a/app/src/main/java/com/example/nemophila/MapsActivity.java +++ b/app/src/main/java/com/example/nemophila/MapsActivity.java @@ -131,14 +131,9 @@ }); // サイドメニューのフィルターのリストの準備 - genreData = new String[5]; + genreData = new String[]{"中華", "和食", "イタリアン", "フレンチ", "カフェ", "バー", "居酒屋", "ラーメン", "うどん・そば", "その他 海外料理"}; friendsData = new ArrayList<>(); NameToId = new HashMap<>(); - genreData[0] = "和食"; - genreData[1] = "中華"; - genreData[2] = "イタリアン"; - genreData[3] = "洋食"; - genreData[4] = "ジャンクフード"; // friendsData[0] = "iyo"; // friendsData[1] = "iyo2"; @@ -341,21 +336,23 @@ nemophila.getSelectGenres(); for (Shop shop : shops) { - if ( shopsViewModel.getMarker(shop) != null) { -// if (shop.getgenreSet ) { -// //すでに立っているピンをフィルター掛け -// Marker setMaker = shopsViewModel.getMarker(shop); -// if (!nemophila.getSelectGenres().isEmpty()) { -// setMaker.setVisible(false); -// } else { -// setMaker.setVisible(true); -// } -// } + Marker setMarker = shopsViewModel.getMarker(shop); + if(nemophila.getSelectGenres().isEmpty()){ + setMarker.setVisible(true); + } else { + for(String genre : nemophila.getSelectGenres()) { + if(shop.getGenreSet().contains(genre)) { + setMarker.setVisible(true); + } else { + setMarker.setVisible(false); + } + } } + } + // if (!nemophila.getSelectFriends().isEmpty()) { // setMaker.setVisible(false); // } - } } } });