private void initView() {
    mEtDeviceName = (MaterialEditText) findViewById(R.id.etDeviceName);
    mEtDeviceDesc = (MaterialEditText) findViewById(R.id.etDeviceDescription);
    mEtAndroidVersion = (MaterialEditText) findViewById(R.id.etAndroidVersion);
    mLinDeviceName = (LinearLayout) findViewById(R.id.linDeviceName);
    mLinDeviceDesc = (LinearLayout) findViewById(R.id.linDeviceDescription);
    mLinAndroidVersion = (LinearLayout) findViewById(R.id.linAndroidVersion);

    mEtAndroidVersion.setOnClickListener(this);

    mEtDeviceName.addTextChangedListener(new CustomInputValidator(mEtDeviceName));
    mEtDeviceName.setOnFocusChangeListener(AddDeviceActivity.this);

    mEtDeviceDesc.setFilters(new InputFilter[] {new InputFilter.LengthFilter(256)});
    mEtDeviceDesc.addTextChangedListener(new CustomInputValidator(mEtDeviceDesc));
    mEtDeviceDesc.setOnFocusChangeListener(AddDeviceActivity.this);

    mDbHelper = DBHelper.getInstance(ShowCaseApp.getAppContext());
  }
Exemplo n.º 2
0
  private void initView() {
    context = (BaseActivity) getActivity();
    imgLeftCorner = (ImageView) ret.findViewById(R.id.img_left_corner);
    et_searchkey = (MaterialEditText) ret.findViewById(R.id.et_searchkey);
    mListView = (XListView) ret.findViewById(R.id.list_search_fans);
    mListView.setPullRefreshEnable(false);
    mListView.setPullLoadEnable(false);
    mNoContentHint = (TextView) ret.findViewById(R.id.no_content_hint);

    imgLeftCorner.setOnClickListener(this);
    mListView.setOnItemClickListener(this);
    et_searchkey.addTextChangedListener(this);

    et_searchkey.setFocusable(true);
    et_searchkey.setFocusableInTouchMode(true);
    et_searchkey.requestFocus();

    adapter = new SearchAdapter(context, R.layout.item_group_member2, cursor);
    mListView.setAdapter(adapter);
  }