mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 02:38: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
|
// 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++) {
|
for (int i = 0; i < resultsProductList.size(); i++) {
|
||||||
if (!stores.contains(resultsProductList.get(i).getChainName())) {
|
if (!stores.contains(resultsProductList.get(i).getChainName())) {
|
||||||
stores.add(resultsProductList.get(i).getChainName());
|
stores.add(resultsProductList.get(i).getChainName());
|
||||||
|
|||||||
@ -55,19 +55,30 @@ public class CheckBoxListViewAdapter extends BaseAdapter {
|
|||||||
holder = new ViewHolder();
|
holder = new ViewHolder();
|
||||||
holder.label = (TextView) convertView.findViewById(R.id.store_name);
|
holder.label = (TextView) convertView.findViewById(R.id.store_name);
|
||||||
holder.checkBox = (CheckBox)convertView.findViewById(R.id.store_check_box);
|
holder.checkBox = (CheckBox)convertView.findViewById(R.id.store_check_box);
|
||||||
|
holder.checkBox.setOnClickListener(new View.OnClickListener() {
|
||||||
holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onClick(View v) {
|
||||||
int getPosition = (Integer) buttonView.getTag();
|
int getPosition = (Integer) ((CompoundButton)(v)).getTag();
|
||||||
|
|
||||||
if (isChecked) {
|
if (((CompoundButton) v).isChecked()) {
|
||||||
checkedList.add(list.get(getPosition));
|
checkedList.add(list.get(getPosition));
|
||||||
} else {
|
} else {
|
||||||
checkedList.remove(list.get(getPosition));
|
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() {
|
convertView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Descending"
|
android:text="Ascending"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:paddingStart="16dp"/>
|
android:paddingStart="16dp"/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user