class ShippingInfoWidget extends LinearLayout {

    public boolean validateAllFields() {
        boolean postalCodeValid = true;
        String countrySelected = mCountryAutoCompleteTextView.getSelectedCountryCode();
        if (mPostalCodeEditText.getText().toString().isEmpty() &&
                (mOptionalShippingInfoFields.contains(POSTAL_CODE_FIELD) || mHiddenShippingInfoFields.contains(POSTAL_CODE_FIELD))) {
            postalCodeValid = true;
        } else if (countrySelected.equals(Locale.US.getCountry())) {
            postalCodeValid = CountryUtils.isUSZipCodeValid(mPostalCodeEditText.getText().toString().trim());
        } else if (countrySelected.equals(Locale.UK.getCountry())) {
            postalCodeValid = CountryUtils.isUSZipCodeValid(mPostalCodeEditText.getText().toString().trim());
        } else if (countrySelected.equals(Locale.CANADA.getCountry())) {
            postalCodeValid = CountryUtils.isUSZipCodeValid(mPostalCodeEditText.getText().toString().trim());
        } else if (CountryUtils.doesCountryUsePostalCode(countrySelected)){
            postalCodeValid = !mPostalCodeEditText.getText().toString().isEmpty();
        }
        mPostalCodeEditText.setShouldShowError(!postalCodeValid);

        boolean requiredAddressLine1Empty = mAddressEditText.getText().toString().isEmpty() && !mOptionalShippingInfoFields.contains(ADDRESS_LINE_ONE_FIELD) && !mHiddenShippingInfoFields.contains(ADDRESS_LINE_ONE_FIELD);
        mAddressEditText.setShouldShowError(requiredAddressLine1Empty);

        boolean requiredCityEmpty = mCityEditText.getText().toString().isEmpty() && !mOptionalShippingInfoFields.contains(CITY_FIELD) && !mHiddenShippingInfoFields.contains(CITY_FIELD);
        mCityEditText.setShouldShowError(requiredCityEmpty);

        boolean requiredNameEmpty = mNameEditText.getText().toString().isEmpty();
        mNameEditText.setShouldShowError(requiredNameEmpty);

        boolean requiredStateEmpty = mStateEditText.getText().toString().isEmpty() && !mOptionalShippingInfoFields.contains(STATE_FIELD) && !mHiddenShippingInfoFields.contains(STATE_FIELD);
        mStateEditText.setShouldShowError(requiredStateEmpty);

        boolean requiredPhoneNumberEmpty = mPhoneNumberEditText.getText().toString().isEmpty() && !mOptionalShippingInfoFields.contains(PHONE_FIELD) && !mHiddenShippingInfoFields.contains(PHONE_FIELD);
        mPhoneNumberEditText.setShouldShowError(requiredPhoneNumberEmpty);

        return postalCodeValid &&
                !requiredAddressLine1Empty &&
                !requiredCityEmpty &&
                !requiredStateEmpty &&
                !requiredNameEmpty &&
                !requiredPhoneNumberEmpty;
    }

    public  ShippingInfoWidget(Context context);
    public  ShippingInfoWidget(Context context, AttributeSet attrs);
    public  ShippingInfoWidget(Context context, AttributeSet attrs, int defStyleAttr);

}