| | |
| | | import com.lidroid.xutils.ViewUtils;
|
| | | import com.lidroid.xutils.view.annotation.ViewInject;
|
| | | import com.lidroid.xutils.view.annotation.event.OnClick;
|
| | | import com.wx.wheelview.adapter.BaseWheelAdapter;
|
| | | import com.wx.wheelview.widget.WheelView;
|
| | | import cn.com.basic.face.dialog.wheelview.adapter.BaseWheelAdapter;
|
| | | import cn.com.basic.face.dialog.wheelview.widget.WheelView;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
| | | private final View parentView;
|
| | | @ViewInject(R.id.dialog_add_title)
|
| | | private TextView dialog_add_title;
|
| | | @ViewInject(R.id.dialog_add_list_view)
|
| | | private WheelView dialog_add_list_view;
|
| | | @ViewInject(R.id.dialog_add_content)
|
| | | private EditText dialog_add_content;
|
| | |
|
| | |
| | | public static List genderList = new ArrayList();
|
| | | public static List idTypeList = new ArrayList();
|
| | | public static List visitReasonList = new ArrayList();
|
| | | public int type;
|
| | |
|
| | | public static void setVisitorTypeList(List visitorTypeList) {
|
| | | AddDialog.visitorTypeList = visitorTypeList;
|
| | |
| | | }
|
| | |
|
| | | public AddDialog(View parentView, int type, OkClickedListener okButtonClickedListener) {
|
| | | this.type = type;
|
| | | this.parentView = parentView;
|
| | | View view = LayoutInflater.from(MainActivity.getInstance()).inflate(R.layout.dialog_add,null);
|
| | | ViewUtils.inject(this, view);
|
| | |
| | | style.textSize = 16;
|
| | | style.holoBorderColor = Color.parseColor("#11c3e3");
|
| | |
|
| | | dialog_add_list_view.setWheelAdapter(new WheelAdapter(MainActivity.getInstance()));
|
| | | dialog_add_list_view.setSkin(WheelView.Skin.Holo);
|
| | | if (list != null && list.size() > 0) {
|
| | | dialog_add_list_view.setWheelData(list);
|
| | | }
|
| | | dialog_add_list_view.setWheelSize(5);
|
| | | dialog_add_list_view.setBackgroundResource(R.color.colorBackground);
|
| | | dialog_add_list_view.setStyle(style);
|
| | |
|
| | | view.setOnTouchListener(new View.OnTouchListener() {
|
| | | @Override
|
| | |
| | | private void setTitleAndList(int type) {
|
| | | String tile = "";
|
| | | switch (type) {
|
| | | case Constant.DialogSelectType.VISIT_REASON_ADD:
|
| | | case Constant.DialogSelectType.VISIT_REASON:
|
| | | tile = "添加访问事由";
|
| | | break;
|
| | | case Constant.DialogSelectType.PROTOCOL:
|
| | | tile = "添加通讯";
|
| | | break;
|
| | | case Constant.DialogSelectType.RESOLUTION:
|
| | | tile = "添加分辨率";
|
| | | break;
|
| | | case Constant.DialogSelectType.CAMERA_BRAND:
|
| | | tile = "添加摄像机品牌";
|
| | | break;
|
| | | }
|
| | | dialog_add_title.setText(tile);
|
| | | }
|