mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 20:00:50 +00:00
Fix search function bug
This commit is contained in:
Generated
-17
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="C:\Users\phanh\.android\avd\Pixel_5_API_31.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-03-10T08:30:32.300635400Z" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -212,12 +212,22 @@ public class SearchFragment extends Fragment {
|
||||
statusCategoryChecked.remove(Integer.valueOf(tempCategory.getId()));
|
||||
}
|
||||
|
||||
ACTION_CODE = LIST_FOOD_BY_CATEGORY;
|
||||
|
||||
listFoodSearch.clear();
|
||||
CURRENT_PAGE = 0;
|
||||
showProgressBarAndHideEndOfListText();
|
||||
getListFoodByCategory(CURRENT_PAGE);
|
||||
Toast.makeText(getContext(), "Category check: " + statusCategoryChecked, Toast.LENGTH_SHORT).show();
|
||||
|
||||
//Check category list null or not
|
||||
if(statusCategoryChecked.size() == 0){
|
||||
|
||||
//If null, return list food
|
||||
ACTION_CODE = LIST_FOOD;
|
||||
getListFood(0);
|
||||
} else {
|
||||
//If have category check, return list food by category
|
||||
ACTION_CODE = LIST_FOOD_BY_CATEGORY;
|
||||
getListFoodByCategory(CURRENT_PAGE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user