Пример #1
0
 private void processRestoredCountry() {
   if (!TextUtils.isEmpty(restoredCountry)) {
     Country country = countries.getCountryByIso(restoredCountry);
     restoredCountry = null;
     if (country != null) {
       setCountry(country);
     }
   }
 }
Пример #2
0
 private void setupDefaultCountry() {
   String[] possibleRegions = Phones.getPossibleRegions(getContext());
   for (String region : possibleRegions) {
     Country country = countries.getCountryByIso(region);
     if (country != null) {
       this.defaultCountry = country;
       break;
     }
   }
 }
Пример #3
0
  private void onCountriesLoaded() {
    if (defaultCountry == null) {
      setupDefaultCountry();
    }

    processRestoredCountry();

    if (this.country != null) {
      return;
    }

    Country country = countries.getCountryByIso(countryFromAttrs);
    if (country != null) {
      setCountry(country);
    }

    if (this.country == null) {
      setCountry(defaultCountry);
    }
  }
Пример #4
0
 public void setCountryIso(String countryIso) {
   setCountry(countries.getCountryByIso(countryIso));
 }