| | |
| | |
|
| | | import com.bsk.zhangbo.demoforbsk.R;
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | | import cn.com.basic.face.fragment.CheckInFragment;
|
| | | import cn.com.basic.face.service.DictionaryMng;
|
| | | import cn.com.basic.face.util.Constant;
|
| | | import cn.com.basic.face.util.OkClickedListener;
|
| | |
|
| | |
| | | private List list = new ArrayList();
|
| | |
|
| | | public static List visitorTypeList = new ArrayList();
|
| | | public static List attenderTypeList = new ArrayList();
|
| | | public static List genderList = new ArrayList();
|
| | | public static List idTypeList = new ArrayList();
|
| | | public static List visitReasonList = new ArrayList();
|
| | | private static List<String> resolutionList = new ArrayList();
|
| | | private static List<String> protocolList = new ArrayList();
|
| | | private static List<String> cameraBrandList = new ArrayList();
|
| | | private int type;
|
| | |
|
| | | public static void setVisitorTypeList(List visitorTypeList) {
|
| | | SelectDialog.visitorTypeList = visitorTypeList;
|
| | | }
|
| | |
|
| | | public static void setAttenderTypeList(List attenderTypeList) {
|
| | | SelectDialog.attenderTypeList = attenderTypeList;
|
| | | }
|
| | |
|
| | | public static void setGenderList(List genderList) {
|
| | |
| | | }
|
| | |
|
| | | public SelectDialog(View parentView, int type, OkClickedListener okButtonClickedListener, String defaultValue) {
|
| | | this.type = type;
|
| | | this.parentView = parentView;
|
| | | View view = LayoutInflater.from(MainActivity.getInstance()).inflate(R.layout.dialog_select,null);
|
| | | ViewUtils.inject(this, view);
|
| | |
| | | style.textSize = 16;
|
| | | style.holoBorderColor = Color.parseColor("#11c3e3");
|
| | |
|
| | | if(type == Constant.DialogSelectType.VISIT_REASON) {
|
| | | if(type == Constant.DialogSelectType.VISIT_REASON
|
| | | || type == Constant.DialogSelectType.PROTOCOL
|
| | | || type == Constant.DialogSelectType.RESOLUTION
|
| | | || type == Constant.DialogSelectType.CAMERA_BRAND
|
| | | ) {
|
| | | dialog_select_add_separator.setVisibility(View.VISIBLE);
|
| | | dialog_select_add.setVisibility(View.VISIBLE);
|
| | | }
|
| | |
| | | public void dialog_select_add_click(View view) {
|
| | | dismiss();
|
| | | Toast.makeText(MainActivity.getInstance(), "添加", Toast.LENGTH_SHORT);
|
| | | new AddDialog(parentView, Constant.DialogSelectType.VISIT_REASON_ADD, new OkClickedListener() {
|
| | | new AddDialog(parentView, type, new OkClickedListener() {
|
| | | public void onSelected(String value) {
|
| | | CheckInFragment.getInstance().setVisitReasonText(value);
|
| | | switch (type) {
|
| | | case Constant.DialogSelectType.VISIT_REASON:
|
| | | CheckInFragment.getInstance().setVisitReasonText(value);
|
| | | break;
|
| | | case Constant.DialogSelectType.RESOLUTION:
|
| | | DictionaryMng.getInstance().addDictionary(Constant.DialogSelectType.RESOLUTION, CommonVariables.DictionaryType.RESOLUTION, value);
|
| | | break;
|
| | | case Constant.DialogSelectType.PROTOCOL:
|
| | | DictionaryMng.getInstance().addDictionary(Constant.DialogSelectType.PROTOCOL, CommonVariables.DictionaryType.PROTOCOL, value);
|
| | | break;
|
| | | case Constant.DialogSelectType.CAMERA_BRAND:
|
| | | DictionaryMng.getInstance().addDictionary(Constant.DialogSelectType.CAMERA_BRAND, CommonVariables.DictionaryType.CAMERA_BRAND, value);
|
| | | break;
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|