mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Store-filtering-related bugs fixed
This commit is contained in:
parent
ad4e7fd810
commit
9edab80c2f
@ -352,6 +352,7 @@ public class SearchResults extends AppCompatActivity implements FilterDialogFrag
|
||||
}
|
||||
|
||||
// Create a list of all stores in the results so the user can filter by store name
|
||||
stores.clear();
|
||||
for (int i = 0; i < resultsProductList.size(); i++) {
|
||||
if (!stores.contains(resultsProductList.get(i).getChainName())) {
|
||||
stores.add(resultsProductList.get(i).getChainName());
|
||||
|
||||
@ -55,19 +55,30 @@ public class CheckBoxListViewAdapter extends BaseAdapter {
|
||||
holder = new ViewHolder();
|
||||
holder.label = (TextView) convertView.findViewById(R.id.store_name);
|
||||
holder.checkBox = (CheckBox)convertView.findViewById(R.id.store_check_box);
|
||||
|
||||
holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
holder.checkBox.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
int getPosition = (Integer) buttonView.getTag();
|
||||
public void onClick(View v) {
|
||||
int getPosition = (Integer) ((CompoundButton)(v)).getTag();
|
||||
|
||||
if (isChecked) {
|
||||
if (((CompoundButton) v).isChecked()) {
|
||||
checkedList.add(list.get(getPosition));
|
||||
} else {
|
||||
checkedList.remove(list.get(getPosition));
|
||||
}
|
||||
}
|
||||
});
|
||||
// holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
// @Override
|
||||
// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
// int getPosition = (Integer) buttonView.getTag();
|
||||
//
|
||||
// if (isChecked) {
|
||||
// checkedList.add(list.get(getPosition));
|
||||
// } else {
|
||||
// checkedList.remove(list.get(getPosition));
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
convertView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Descending"
|
||||
android:text="Ascending"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:paddingStart="16dp"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user