@Test public void shippingInfoWidget_whenFieldsHidden_renderedHidden() { assertEquals(mNameTextInputLayout.getVisibility(), View.VISIBLE); assertEquals(mPostalCodeTextInputLayout.getVisibility(), View.VISIBLE); List<String> hiddenFields = new ArrayList<>(); hiddenFields.add(ShippingInfoWidget.POSTAL_CODE_FIELD); mShippingInfoWidget.setHiddenFields(hiddenFields); assertEquals(mPostalCodeTextInputLayout.getVisibility(), View.GONE); mCountryAutoCompleteTextView.updateUIForCountryEntered(Locale.CANADA.getDisplayCountry()); assertEquals(mPostalCodeTextInputLayout.getVisibility(), View.GONE); }
public void setHiddenFields(@Nullable List<String> hiddenAddressFields) { if (hiddenAddressFields != null) { mHiddenShippingInfoFields = hiddenAddressFields; } else { mHiddenShippingInfoFields = new ArrayList<>(); } renderLabels(); renderCountrySpecificLabels(mCountryAutoCompleteTextView.getSelectedCountryCode()); }
ShippingInfoWidget extends LinearLayout { public void setHiddenFields(@Nullable List<String> hiddenAddressFields) { if (hiddenAddressFields != null) { mHiddenShippingInfoFields = hiddenAddressFields; } else { mHiddenShippingInfoFields = new ArrayList<>(); } renderLabels(); renderCountrySpecificLabels(mCountryAutoCompleteTextView.getSelectedCountryCode()); } }
ShippingInfoWidget extends LinearLayout { public void setHiddenFields(@Nullable List<String> hiddenAddressFields) { if (hiddenAddressFields != null) { mHiddenShippingInfoFields = hiddenAddressFields; } else { mHiddenShippingInfoFields = new ArrayList<>(); } renderLabels(); renderCountrySpecificLabels(mCountryAutoCompleteTextView.getSelectedCountryCode()); } ShippingInfoWidget(Context context);  ShippingInfoWidget(Context context, AttributeSet attrs);  ShippingInfoWidget(Context context, AttributeSet attrs, int defStyleAttr); }
ShippingInfoWidget extends LinearLayout { public void setHiddenFields(@Nullable List<String> hiddenAddressFields) { if (hiddenAddressFields != null) { mHiddenShippingInfoFields = hiddenAddressFields; } else { mHiddenShippingInfoFields = new ArrayList<>(); } renderLabels(); renderCountrySpecificLabels(mCountryAutoCompleteTextView.getSelectedCountryCode()); } ShippingInfoWidget(Context context);  ShippingInfoWidget(Context context, AttributeSet attrs);  ShippingInfoWidget(Context context, AttributeSet attrs, int defStyleAttr); void setOptionalFields(@Nullable List<String> optionalAddressFields); void setHiddenFields(@Nullable List<String> hiddenAddressFields); ShippingInformation getShippingInformation(); void populateShippingInfo(@Nullable ShippingInformation shippingInformation); boolean validateAllFields(); }
ShippingInfoWidget extends LinearLayout { public void setHiddenFields(@Nullable List<String> hiddenAddressFields) { if (hiddenAddressFields != null) { mHiddenShippingInfoFields = hiddenAddressFields; } else { mHiddenShippingInfoFields = new ArrayList<>(); } renderLabels(); renderCountrySpecificLabels(mCountryAutoCompleteTextView.getSelectedCountryCode()); } ShippingInfoWidget(Context context);  ShippingInfoWidget(Context context, AttributeSet attrs);  ShippingInfoWidget(Context context, AttributeSet attrs, int defStyleAttr); void setOptionalFields(@Nullable List<String> optionalAddressFields); void setHiddenFields(@Nullable List<String> hiddenAddressFields); ShippingInformation getShippingInformation(); void populateShippingInfo(@Nullable ShippingInformation shippingInformation); boolean validateAllFields(); static final String ADDRESS_LINE_ONE_FIELD; static final String ADDRESS_LINE_TWO_FIELD; static final String CITY_FIELD; static final String POSTAL_CODE_FIELD; static final String STATE_FIELD; static final String PHONE_FIELD; }