| | |
| | | import com.lidroid.xutils.ViewUtils;
|
| | | import com.lidroid.xutils.view.annotation.ViewInject;
|
| | | import com.lidroid.xutils.view.annotation.event.OnClick;
|
| | | import com.wx.wheelview.widget.WheelView;
|
| | | import cn.com.basic.face.dialog.wheelview.widget.WheelView;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | |
|
| | | public class CountryDialog extends PopupWindow implements WheelView.OnWheelItemSelectedListener {
|
| | |
|
| | |
| | | dismiss();
|
| | | }
|
| | |
|
| | | public CountryDialog(View parentView, OkClickedListener okButtonClickedListener) {
|
| | | public CountryDialog(View parentView, OkClickedListener okButtonClickedListener, String defaultValue) {
|
| | | view = LayoutInflater.from(MainActivity.getInstance()).inflate(R.layout.dialog_country, null);
|
| | | ViewUtils.inject(this, view);
|
| | |
|
| | | if (defaultValue != null && !"".equals(defaultValue)) {
|
| | | for (int i = 0; i < uniqueFirstLetterList.size(); i++) {
|
| | | String firstLetter = uniqueFirstLetterList.get(i);
|
| | | int j = 0;
|
| | | for(String countryName : countriesGroupByFirstLetter.get(firstLetter)) {
|
| | | if (defaultValue.equals(countryName)) {
|
| | | dialog_country_name_first_letter.setSelection(i);
|
| | | dialog_country_name.setSelection(j);
|
| | | break;
|
| | | }
|
| | | j++;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | this.countriesWithSameFirstLetter = countriesGroupByFirstLetter.get(uniqueFirstLetterList.get(dialog_country_name_first_letter.getSelection()));
|
| | |
|
| | |
| | | dialog_country_name_first_letter.setBackgroundResource(R.color.colorBackground);
|
| | | dialog_country_name_first_letter.setStyle(wheelViewStyle);
|
| | |
|
| | | dialog_country_name_first_letter.setSelection(4);
|
| | |
|
| | | //dialog_country_name_first_letter.setSelection(4);
|
| | |
|
| | | dialog_country_name.setWheelAdapter(new SelectDialog.WheelAdapter(MainActivity.getInstance()));
|
| | | dialog_country_name.setSkin(WheelView.Skin.Holo);
|