예제 #1
0
 public void setEditText(String text, String hintText, int leftIconResId) {
   mEditText.setVisibility(View.VISIBLE);
   if (!TextUtils.isEmpty(hintText)) {
     mEditText.setHint(hintText);
   }
   if (!TextUtils.isEmpty(text)) {
     mEditText.setText(text);
   }
   if (leftIconResId != 0) {
     mEditText.setIsShowLeftIcon(true);
     mEditText.setLeftIcon(leftIconResId);
   }
 }
예제 #2
0
  private void initView(LayoutInflater inflater) {
    mDialogView = inflater.inflate(R.layout.renren_dialog_layout, null);
    mContentView = mDialogView.findViewById(R.id.renren_dialog_content_layout);
    mButtonView = mDialogView.findViewById(R.id.button_view);
    mTitleView = (TextView) mDialogView.findViewById(R.id.renren_dialog_title_view);
    mMessageView = (TextView) mDialogView.findViewById(R.id.renren_dialog_message_view);
    mEditText = (SearchEditText) mDialogView.findViewById(R.id.renren_dialog_edit_text);
    mCheckView = mDialogView.findViewById(R.id.renren_dialog_check_layout);
    mCheckBox = (CheckBox) mDialogView.findViewById(R.id.renren_dialog_check_box);
    mCheckMessageView = (TextView) mDialogView.findViewById(R.id.renren_dialog_check_message_view);
    mCancelBtn = (Button) mDialogView.findViewById(R.id.renren_dialog_cancel_btn);
    mOkBtn = (Button) mDialogView.findViewById(R.id.renren_dialog_ok_btn);

    mBtnDivider = mDialogView.findViewById(R.id.renren_dialog_btn_divider);
    mDiliver = mDialogView.findViewById(R.id.renren_dialog_divider);
    mListView = (ListView) mDialogView.findViewById(R.id.renren_dialog_list_view);
    mListView.setVerticalFadingEdgeEnabled(false);
    mListView.setScrollingCacheEnabled(false);
    mListView.setCacheColorHint(0);

    mEditText.setIsShowLeftIcon(false);
    mCancelBtn.setOnClickListener(
        new android.view.View.OnClickListener() {

          @Override
          public void onClick(View v) {
            AppMethods.hideSoftInputMethods(mEditText);
            dismiss();
            if (mNegativeBtnClickListener != null) {
              mNegativeBtnClickListener.onClick(v);
            }
            if (mNegativeBinderOnClickListener != null && mBinder != null) {
              mNegativeBinderOnClickListener.OnClick(v, mBinder);
            }
          }
        });

    mOkBtn.setOnClickListener(
        new android.view.View.OnClickListener() {

          @Override
          public void onClick(View v) {
            AppMethods.hideSoftInputMethods(mEditText);
            dismiss();
            if (mPositiveBtnClickListener != null) {
              mPositiveBtnClickListener.onClick(v);
            }
            if (mPositiveBinderOnClickListener != null && mBinder != null) {
              mPositiveBinderOnClickListener.OnClick(v, mBinder);
            }
          }
        });
  }
예제 #3
0
 public String getEditTextInputString() {
   return mEditText.getEditableText().toString();
 }