android.databinding.Bindable Java Examples

The following examples show how to use android.databinding.Bindable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Customer.java    From mobikul-standalone-pos with MIT License 6 votes vote down vote up
@Bindable
public String getEmail() {
    if (email == null) {
        return "";
    } else if (Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
        Log.d(TAG, "getEmail: " + getCustomerId());
        DataBaseController.getInstanse().checkEmailExist(getContext(), email, new DataBaseCallBack() {
            @Override
            public void onSuccess(Object responseData, String successMsg) {
                if (((Customer) responseData) != null && ((Customer) responseData).getCustomerId() != getCustomerId()) {
                    isEmailExist = true;
                } else {
                    isEmailExist = false;
                }
                Log.d(TAG, "onSuccess: " + responseData);
            }

            @Override
            public void onFailure(int errorCode, String errorMsg) {
                isEmailExist = false;
            }
        });
    }
    return email;
}
 
Example #2
Source File: Product.java    From mobikul-standalone-pos with MIT License 6 votes vote down vote up
@Bindable
public String getSku() {
    if (sku == null)
        return "";
    else if (!sku.isEmpty()) {
        Log.d(TAG, "getsku: " + sku);
        DataBaseController.getInstanse().checkSkuExist(getContext(), sku, new DataBaseCallBack() {
            @Override
            public void onSuccess(Object responseData, String successMsg) {
                if (responseData != null && ((Product) responseData).getPId() != getPId()) {
                    isSkuExist = true;
                } else {
                    isSkuExist = false;
                }
            }

            @Override
            public void onFailure(int errorCode, String errorMsg) {
                isSkuExist = false;
            }
        });
    }
    return sku;
}
 
Example #3
Source File: CashModel.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "collectedCash"})
public String getCollectedCashError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getCollectedCash().isEmpty()) {
        return "COLLECTED CASH CAN'T BE EMPTY!";
    }

    if (Double.parseDouble(getCollectedCash()) < Double.parseDouble(getTotal())) {
        return "COLLECTED CASH CAN'T LESS THEN TOTAL AMOUNT (" + getFormatedTotal() + ").    ";
    }
    return "";
}
 
Example #4
Source File: Product.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "weight"})
public String getWeightError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getWeight().isEmpty()) {
        return "WEIGHT IS EMPTY!";
    }
    return "";
}
 
Example #5
Source File: Administrator.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "firstName"})
public String getFirstNameError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getFirstName().isEmpty()) {
        return "FIRSTNAME IS EMPTY";
    }
    return "";
}
 
Example #6
Source File: Product.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "sku"})
public String getSkuError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getSku().isEmpty()) {
        return "SKU IS EMPTY!";
    }
    if (isSkuExist) {
        return SUCCESS_MSG_10_SKU_ALLREADY_EXIST;
    }
    return "";
}
 
Example #7
Source File: Product.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable

    public String getImage() {
        if (image == null)
            return "";
        return image;
    }
 
Example #8
Source File: Product.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "quantity"})
public String getQuantityError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getQuantity().isEmpty()) {
        return "QUANTITY IS EMPTY!";
    }
    return "";
}
 
Example #9
Source File: Administrator.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "lastName"})
public String getLastNameError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getLastName().isEmpty()) {
        return "LASTNAME IS EMPTY";
    }
    return "";
}
 
Example #10
Source File: Administrator.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "password"})
public String getPasswordError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getPassword().isEmpty()) {
        return "PASSWORD IS EMPTY";
    }
    return "";
}
 
Example #11
Source File: Product.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "price"})
public String getPriceError() {
    if (!isDisplayError()) {
        return "";
    }
    String price = getPrice() + "";
    if (price.isEmpty()) {
        return "PRICE IS EMPTY!";
    }
    return "";
}
 
Example #12
Source File: TotalModel.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "discount"})
public String getDiscountError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getDiscount().isEmpty()) {
        return "CUSTOM DISCOUNT IS EMPTY!";
    }
    return "";
}
 
Example #13
Source File: Product.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "productName"})
public String getProductNameError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getProductName().isEmpty()) {
        return "PRODUCT NAME IS EMPTY!";
    }
    return "";
}
 
Example #14
Source File: Customer.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "email"})
public String getContactNumberError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getContactNumber().isEmpty()) {
        return "CONTACT NUMBER IS EMPTY!";
    }
    if (isNumberExist) {
        return SUCCESS_MSG_9_CUSTOMER_ALL_READY_EXIST;
    }
    return "";
}
 
Example #15
Source File: TotalModel.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable
public String getFormatedSubTotal() {
    if (formatedSubTotal == null) {
        return "0.00";
    }
    return formatedSubTotal;
}
 
Example #16
Source File: TotalModel.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable
public String getFormatedGrandTotal() {
    if (formatedGrandTotal == null) {
        return "0.00";
    }
    return formatedGrandTotal;
}
 
Example #17
Source File: TotalModel.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable
public String getFormatedRoundTotal() {
    if (formatedRoundTotal == null) {
        return "0.00";
    }
    return formatedRoundTotal;
}
 
Example #18
Source File: Customer.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "email"})
public String getEmailError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getEmail().isEmpty()) {
        return "EMAIL IS EMPTY!";
    }
    if (!Patterns.EMAIL_ADDRESS.matcher(getEmail()).matches()) {
        return "PLEASE ENTER A VALID EMAIL!";
    }
    if (isEmailExist)
        return SUCCESS_MSG_9_CUSTOMER_ALL_READY_EXIST;
    return "";
}
 
Example #19
Source File: Customer.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "firstName"})
public String getFirstNameError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getFirstName().isEmpty()) {
        return "FIRST NAME IS EMPTY!";
    }
    return "";
}
 
Example #20
Source File: Options.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "optionName"})
public String getOptionNameError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getOptionName().isEmpty()) {
        return "OPTION NAME IS EMPTY!";
    }
    return "";
}
 
Example #21
Source File: Tax.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "taxRate"})
public String getTaxRateError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getTaxRate().isEmpty()) {
        return "TAX RATE IS EMPTY!";
    }
    return "";
}
 
Example #22
Source File: Category.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable({"displayError", "categoryName"})
public String getCategoryNameError() {
    if (!isDisplayError()) {
        return "";
    }
    if (getCategoryName().isEmpty()) {
        return "CATEGORY NAME IS EMPTY!";
    }
    return "";
}
 
Example #23
Source File: Options.java    From mobikul-standalone-pos with MIT License 5 votes vote down vote up
@Bindable
public List<OptionValues> getOptionValues() {
    if (optionValues == null) {
        optionValues = new ArrayList<>();
        return optionValues;
    }
    return optionValues;
}
 
Example #24
Source File: Product.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@Bindable
public String getBarCode() {
    if (barCode == null)
        return "";
    return barCode;
}
 
Example #25
Source File: Product.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@Bindable
public float getDiscount() {
    return discount;
}
 
Example #26
Source File: Product.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@Bindable
public Tax getProductTax() {
    return productTax;
}
 
Example #27
Source File: Product.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@Bindable
public String getCartProductSubtotal() {
    return cartProductSubtotal;
}
 
Example #28
Source File: Options.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@Bindable
public String getType() {
    if (type == null)
        return type;
    return type;
}
 
Example #29
Source File: Administrator.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@Bindable
public String getPassword() {
    if (password == null)
        return "";
    return password;
}
 
Example #30
Source File: Options.java    From mobikul-standalone-pos with MIT License 4 votes vote down vote up
@Bindable
public String getOptionName() {
    if (optionName == null)
        return "";
    return optionName;
}