fixed bug again
This commit is contained in:
@@ -210,7 +210,7 @@ public class AdoptionFragment extends Fragment implements AdoptionAdapter.OnAdop
|
|||||||
if (status.equals("All Statuses")) status = null;
|
if (status.equals("All Statuses")) status = null;
|
||||||
else status = status.toUpperCase();
|
else status = status.toUpperCase();
|
||||||
|
|
||||||
viewModel.loadAdoptions(true, query, status, storeId);
|
viewModel.loadAdoptions(true, query, status, storeId, selectedDateString, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openDetail(int position) {
|
private void openDetail(int position) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class AdoptionListViewModel extends ViewModel {
|
|||||||
public LiveData<Boolean> getIsLoading() { return isLoading; }
|
public LiveData<Boolean> getIsLoading() { return isLoading; }
|
||||||
public boolean isLastPage() { return isLastPage; }
|
public boolean isLastPage() { return isLastPage; }
|
||||||
|
|
||||||
public void loadAdoptions(boolean reset, String query, String status, Long storeId) {
|
public void loadAdoptions(boolean reset, String query, String status, Long storeId, String date, Long employeeId) {
|
||||||
if (isLoading.getValue() != null && isLoading.getValue() && !reset) return;
|
if (isLoading.getValue() != null && isLoading.getValue() && !reset) return;
|
||||||
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
@@ -53,7 +53,7 @@ public class AdoptionListViewModel extends ViewModel {
|
|||||||
if ("All Statuses".equals(status)) status = null;
|
if ("All Statuses".equals(status)) status = null;
|
||||||
|
|
||||||
isLoading.setValue(true);
|
isLoading.setValue(true);
|
||||||
adoptionRepository.getAllAdoptions(currentPage, PAGE_SIZE, query, status, storeId, "adoptionDate,desc", null).observeForever(resource -> {
|
adoptionRepository.getAllAdoptions(currentPage, PAGE_SIZE, query, status, storeId, date, employeeId).observeForever(resource -> {
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
if (resource.status == Resource.Status.SUCCESS && resource.data != null) {
|
if (resource.status == Resource.Status.SUCCESS && resource.data != null) {
|
||||||
List<AdoptionDTO> currentList = reset ? new ArrayList<>() : new ArrayList<>(adoptions.getValue());
|
List<AdoptionDTO> currentList = reset ? new ArrayList<>() : new ArrayList<>(adoptions.getValue());
|
||||||
|
|||||||
Reference in New Issue
Block a user