public void fetchCustomers()

in app/src/main/java/org/apache/fineract/ui/online/customers/customerlist/CustomersPresenter.java [59:87]


    public void fetchCustomers(Integer pageIndex, Integer size) {
        checkViewAttached();
        getMvpView().showProgressbar();
        ArrayList<Customer> customerList = new ArrayList<>();

        Expression expression = Expression.property("documentType")
                .equalTo(Expression.string(DocumentType.CUSTOMER.getValue()));

        List<HashMap<String, Object>> map = synchronizationManager.getDocuments(
                expression,
                size,
                pageIndex);

        for (HashMap<String, Object> item : map) {
            Customer customer = GsonUtilsKt.convertToData(item, Customer.class);
            customerList.add(customer);
        }

        if (!loadmore && customerList.size() == 0) {
            getMvpView().showEmptyCustomers(
                    context.getString(R.string.empty_customer_list));
        } else if (loadmore && customerList.size() == 0) {
            getMvpView().showMessage(
                    context.getString(R.string.no_more_customer_available));
        } else {
            showCustomers(customerList);
        }
        getMvpView().hideProgressbar();
    }