| | |
| | | package com.sahooz.library.countrypicker; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | |
| | | import android.text.TextUtils; |
| | |
| | | JSONArray ja = new JSONArray(sb.toString()); |
| | | for (int i = 0; i < ja.length(); i++) { |
| | | JSONObject jo = ja.getJSONObject(i); |
| | | if (jo.getInt("code") == 886) { |
| | | //过滤掉台湾省 |
| | | continue; |
| | | } |
| | | int flag = 0; |
| | | String translate = ""; |
| | | String locale = jo.getString("locale"); |
| | |
| | | String name = jo.getString("name"); |
| | | Locale defaultLoc = Locale.getDefault(); |
| | | boolean inChina = "zh".equalsIgnoreCase(defaultLoc.getLanguage()); |
| | | |
| | | countries.add( |
| | | new Country( |
| | | jo.getInt("code"), |
| | |
| | | return code; |
| | | } |
| | | |
| | | @NonNull @Override |
| | | @NonNull |
| | | @Override |
| | | public String getPinyin() { |
| | | return pinyin; |
| | | } |