@@ -70,7 +70,7 @@ public RecyclerViewHolder(View view) {
70
70
@ NonNull
71
71
@ Override
72
72
public RecyclerViewHolder onCreateViewHolder (@ NonNull ViewGroup parent , int viewType ) {
73
- View itemView = inflater .inflate (callback .isDarkTheme ()? R .layout .nearby_search_list_item_dark : R .layout .nearby_search_list_item , parent , false );
73
+ View itemView = inflater .inflate (callback .isDarkTheme () ? R .layout .nearby_search_list_item_dark : R .layout .nearby_search_list_item , parent , false );
74
74
return new RecyclerViewHolder (itemView );
75
75
}
76
76
@@ -79,17 +79,20 @@ public void onBindViewHolder(@NonNull RecyclerViewHolder holder, int position) {
79
79
Label label = displayedLabels .get (position );
80
80
holder .placeTypeIcon .setImageResource (label .getIcon ());
81
81
holder .placeTypeLabel .setText (label .toString ());
82
+ holder .placeTypeLayout .setSelected (label .isSelected ());
82
83
83
- holder .placeTypeLayout .setBackgroundColor (label .isSelected () ? ContextCompat .getColor (context , R .color .divider_grey ) : callback .isDarkTheme ()?Color .BLACK :Color .WHITE );
84
84
holder .placeTypeLayout .setOnClickListener (view -> {
85
85
callback .setCheckboxUnknown ();
86
+
86
87
if (label .isSelected ()) {
87
88
selectedLabels .remove (label );
88
89
} else {
89
90
selectedLabels .add (label );
90
91
}
92
+
91
93
label .setSelected (!label .isSelected ());
92
- holder .placeTypeLayout .setBackgroundColor (label .isSelected () ? ContextCompat .getColor (context , R .color .divider_grey ) : Color .WHITE );
94
+ holder .placeTypeLayout .setSelected (label .isSelected ());
95
+
93
96
callback .filterByMarkerType (selectedLabels , 0 , false , false );
94
97
});
95
98
}
@@ -165,7 +168,7 @@ public void setRecyclerViewAdapterAllSelected() {
165
168
notifyDataSetChanged ();
166
169
}
167
170
168
- public interface Callback {
171
+ public interface Callback {
169
172
170
173
void setCheckboxUnknown ();
171
174
0 commit comments