当前位置: 首页>>代码示例>>Java>>正文


Java EditText.addTextChangedListener方法代码示例

本文整理汇总了Java中android.widget.EditText.addTextChangedListener方法的典型用法代码示例。如果您正苦于以下问题:Java EditText.addTextChangedListener方法的具体用法?Java EditText.addTextChangedListener怎么用?Java EditText.addTextChangedListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.EditText的用法示例。


在下文中一共展示了EditText.addTextChangedListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: beautyEditText

import android.widget.EditText; //导入方法依赖的package包/类
protected void beautyEditText(final EditText mEditText, String hintStr, TextWatcher mTextWatcher) {
    mEditText.setHint(hintStr);
    mEditText.setHintTextColor(Color.parseColor("#1e0d0d0d"));
    mEditText.setTextColor(Color.parseColor("#0d0d0d"));
    SDKUtils.setBackground(mEditText, this.crMgmt.getDrawable("uac_input", true));
    mEditText.setTextSize(16.0f);
    if (mTextWatcher != null) {
        mEditText.addTextChangedListener(mTextWatcher);
    }
    mEditText.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            mEditText.setSelection(mEditText.length());
            mEditText.requestFocus();
            mEditText.setFocusable(true);
        }
    });
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:BasicActivity.java

示例2: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_group_notice);
    mEdit = (EditText) findViewById(R.id.edit_area);
    Intent intent = getIntent();
    mConversationType = Conversation.ConversationType.setValue(intent.getIntExtra("conversationType", 0));
    mTargetId = getIntent().getStringExtra("targetId");
    setTitle(R.string.group_announcement);
    Button rightButton = getHeadRightButton();
    rightButton.setVisibility(View.GONE);
    mHeadRightText.setVisibility(View.VISIBLE);
    mHeadRightText.setText(R.string.Done);
    mHeadRightText.setTextColor(getResources().getColor(android.R.color.darker_gray));
    mHeadRightText.setClickable(false);
    mHeadRightText.setOnClickListener(this);
    mEdit.addTextChangedListener(this);
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:19,代码来源:GroupNoticeActivity.java

示例3: onCreateView

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);

    View root = inflater.inflate(R.layout.dialog_country_or_city_select, container, false);

    EditText input = root.findViewById(R.id.input);
    input.setText(filter);
    input.addTextChangedListener(new TextWatcherAdapter() {
        @Override
        public void afterTextChanged(Editable s) {
            filter = s.toString();
            mHandler.removeCallbacks(mRunSearchRunnable);
            mHandler.postDelayed(mRunSearchRunnable, RUN_SEACRH_DELAY);
        }
    });

    mRecyclerView = root.findViewById(R.id.list);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));

    return root;
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:23,代码来源:SelectCityDialog.java

示例4: onCreateView

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	final View view = inflater.inflate(R.layout.fragment_save, container, false);

	view.findViewById(R.id.background).setBackgroundColor(SettingsActivity.getPrimaryColor(getActivity()));

	mCancel = (ImageButton) view.findViewById(android.R.id.button2);
	mCancel.setOnClickListener(this);

	mDisplayName = (EditText) view.findViewById(android.R.id.title);
	mDisplayName.addTextChangedListener(mDisplayNameWatcher);
	mDisplayName.setText(getArguments().getString(EXTRA_DISPLAY_NAME));

	mSave = (ImageButton) view.findViewById(android.R.id.button1);
	mSave.setOnClickListener(this);
	mSave.setEnabled(false);

	mProgress = (ProgressBar) view.findViewById(android.R.id.progress);

	return view;
}
 
开发者ID:gigabytedevelopers,项目名称:FireFiles,代码行数:22,代码来源:SaveFragment.java

示例5: init

import android.widget.EditText; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
protected void init() {
    eyeNo = resources.getDrawable(R.drawable.eye_no, null);
    eyeYes = resources.getDrawable(R.drawable.eye_yes, null);
    error = (TextView) dialog.findViewById(R.id.error);
    editText = (EditText) dialog.findViewById(R.id.edit);
    eye = (ImageView) dialog.findViewById(R.id.eye);
    eyeRegion = dialog.findViewById(R.id.eye_region);
    clear = (RelativeLayout) dialog.findViewById(R.id.rel_clear);
    clear.setVisibility(View.GONE);
    clear.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            editText.setText("");
        }
    });
    eyeRegion.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if(pwdVisible){
                pwdVisible = false;
                eye.setImageDrawable(eyeNo);
                editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
            }else{
                pwdVisible = true;
                eye.setImageDrawable(eyeYes);
                editText.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
            }
            editText.setSelection(editText.getText().length());
            Log.d(TAG, "onClick:"+pwdVisible);
        }
    });

    editText.addTextChangedListener(textWatcher);
}
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:37,代码来源:EditPwdDialog.java

示例6: prepareRestoreWalletDialog

import android.widget.EditText; //导入方法依赖的package包/类
private void prepareRestoreWalletDialog(final Dialog dialog) {
    final AlertDialog alertDialog = (AlertDialog) dialog;

    final View replaceWarningView = alertDialog
            .findViewById(R.id.restore_wallet_from_content_dialog_replace_warning);
    final boolean hasCoins = wallet.getBalance(BalanceType.ESTIMATED).signum() > 0;
    replaceWarningView.setVisibility(hasCoins ? View.VISIBLE : View.GONE);

    final EditText passwordView = (EditText) alertDialog
            .findViewById(R.id.import_keys_from_content_dialog_password);
    passwordView.setText(null);

    final ImportDialogButtonEnablerListener dialogButtonEnabler = new ImportDialogButtonEnablerListener(
            passwordView, alertDialog) {
        @Override
        protected boolean hasFile() {
            return true;
        }
    };
    passwordView.addTextChangedListener(dialogButtonEnabler);

    final CheckBox showView = (CheckBox) alertDialog.findViewById(R.id.import_keys_from_content_dialog_show);
    showView.setOnCheckedChangeListener(new ShowPasswordCheckListener(passwordView));
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:25,代码来源:RestoreWalletActivity.java

示例7: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    logEmailHint = (TextView) findViewById(R.id.logEmailHint);
    logEmail = (EditText) findViewById(R.id.logEmail);
    logEmailLine = (ImageView) findViewById(R.id.logEmailLine);
    logEmailCancel = (ImageView) findViewById(R.id.logEmailCancel);

    logPasswordHint = (TextView) findViewById(R.id.logPasswordHint);
    logPassword = (EditText) findViewById(R.id.logPassword);
    logPasswordLine = (ImageView) findViewById(R.id.logPasswordLine);
    logPasswordCancel = (ImageView) findViewById(R.id.logPasswordCancel);

    //For Focus
    logEmail.setOnFocusChangeListener(hasFocusListener);
    logPassword.setOnFocusChangeListener(hasFocusListener);

    //For TextChange
    logEmail.addTextChangedListener(textLengthListener);
    logPassword.addTextChangedListener(textLengthListener);

}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:25,代码来源:LoginActivity.java

示例8: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    scrollConsole = (ScrollView) findViewById(R.id.scroll_output);
    textConsole = (TextView) findViewById(R.id.text_output);
    inputConsole = (EditText) findViewById(R.id.edittext_input);
    buttonConfirm = (ImageButton) findViewById(R.id.button_confirm);
    coordinatorLayout = (CoordinatorLayout) findViewById(R.id.chess_coordinatorlayout);

    buttonColorEnabled = buttonConfirm.getColorFilter();
    enableButton(false);
    inputConsole.addTextChangedListener(new ConsoleInputWatcher());

    setKeyboardListener();
}
 
开发者ID:android-gamecollection,项目名称:gamecollection,代码行数:17,代码来源:ConsoleChess.java

示例9: initPage

import android.widget.EditText; //导入方法依赖的package包/类
private void initPage() {
	activity.findViewById(ResHelper.getIdRes(activity, "ll_back")).setOnClickListener(this);
	activity.findViewById(ResHelper.getIdRes(activity, "ivSearch")).setOnClickListener(this);
	activity.findViewById(ResHelper.getIdRes(activity, "iv_clear")).setOnClickListener(this);

	int resId = ResHelper.getIdRes(activity, "clCountry");
	listView = (CountryListView) activity.findViewById(resId);
	listView.setOnItemClickListener(this);

	resId = ResHelper.getIdRes(activity, "et_put_identify");
	etSearch = (EditText) activity.findViewById(resId);
	etSearch.addTextChangedListener(this);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:CountryPage.java

示例10: AddSpaceTextWatcher

import android.widget.EditText; //导入方法依赖的package包/类
public AddSpaceTextWatcher(Activity activity, EditText editText, int maxLenght) {
    this.activity=activity;
    this.editText = editText;
    this.maxLenght = maxLenght;
    if (editText == null) {
        new NullPointerException("editText is null");
    }
    spaceType = SpaceType.defaultType;
    editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(
            maxLenght)});
    editText.addTextChangedListener(this);
}
 
开发者ID:wenzhimin,项目名称:BootStepView,代码行数:13,代码来源:AddSpaceTextWatcher.java

示例11: onCreateView

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState)
{
    View view = inflater.inflate(R.layout.fragment_transfer_coins, container, false);
    wallet = Wallet.getWorkWallet();

    editTextToWallet = (EditText) view.findViewById(R.id.textEditWallet);
    editTextCoins = (EditText) view.findViewById(R.id.textEditCoins);
    textTotalInWallet = (TextView) view.findViewById(R.id.textTotalInWallet);
    imageValidOk = (ImageView) view.findViewById(R.id.textValidOk);
    coinsLayout = view.findViewById(R.id.coinsLayout);
    frameInput = view.findViewById(R.id.inputWalletLayout);

    imageValidOk.setVisibility(View.INVISIBLE);

    attachOnClickView(view, R.id.buttonTransfer);
    attachOnClickView(view, R.id.buttonScanQR);
    attachOnClickView(view, R.id.buttonClear);

    progressDialog = new ProgressDialog(getActivity());
    updateView();

    editTextToWallet.addTextChangedListener(this);
    editTextCoins.addTextChangedListener(this);

    editTextCoins.setOnKeyListener((v, keyCode, event) -> {
        if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
                (keyCode == KeyEvent.KEYCODE_ENTER)) {
            if (isValidTransferCash())
                new AccountService(this).isExist(editTextToWallet.getText().toString(), REQUEST_IS_EXIST);
            return true;
        }

        return false;
    });

    return view;
}
 
开发者ID:humaniq,项目名称:humaniq-android,代码行数:40,代码来源:TransferCoinsFragment.java

示例12: newProjectDialog

import android.widget.EditText; //导入方法依赖的package包/类
private void newProjectDialog() {

        mProjectDialog = new LovelyCustomDialog(this, mDarkTheme ? R.style.EditTextTintThemeDark : R.style.EditTextTintTheme)
                .setView(R.layout.project_form)
                .setTopColor(mPrimaryColor)
                .setIcon(R.drawable.ic_notepad)
                .setListener(R.id.projectDoneButton, new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        createProjectFromDialog();
                    }
                })
                .show();

        //get the views
        mProjectError = (TextView) mProjectDialog.findViewById(R.id.project_error_message);
        mProjectField = (EditText) mProjectDialog.findViewById(R.id.editProjectName);

        //hide error when text change
        mProjectField.addTextChangedListener(this);
        mProjectField.setHighlightColor(Color.LTGRAY);
        mProjectField.setOnFocusChangeListener(this);

        //request focus on the edit text
        if (mProjectField.requestFocus()) {
            mProjectDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
        }

    }
 
开发者ID:IdeaTrackerPlus,项目名称:IdeaTrackerPlus,代码行数:30,代码来源:MainActivity.java

示例13: onCreateDialog

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    Dialog mDialog = new Dialog(getActivity(), R.style.BottomDialog);
    mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mDialog.setContentView(R.layout.dialog_fragment_comment_layout);
    mDialog.setCanceledOnTouchOutside(true);

    Window window = mDialog.getWindow();
    WindowManager.LayoutParams layoutParams;
    if (window != null) {
        layoutParams = window.getAttributes();
        layoutParams.gravity = Gravity.BOTTOM;
        layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
        window.setAttributes(layoutParams);
    }

    commentEditText = (EditText) mDialog.findViewById(R.id.edit_comment);
    photoButton = (ImageView) mDialog.findViewById(R.id.image_btn_photo);
    atButton = (ImageView) mDialog.findViewById(R.id.image_btn_at);
    sendButton = (ImageView) mDialog.findViewById(R.id.image_btn_comment_send);

    fillEditText();
    setSoftKeyboard();

    commentEditText.addTextChangedListener(mTextWatcher);
    photoButton.setOnClickListener(this);
    atButton.setOnClickListener(this);

    sendButton.setOnClickListener(this);

    return mDialog;
}
 
开发者ID:showzeng,项目名称:PureComment,代码行数:34,代码来源:CommentDialogFragment.java

示例14: setupSecondEditText

import android.widget.EditText; //导入方法依赖的package包/类
protected void setupSecondEditText(boolean visible) {
    mSecondEditText = (EditText) findViewById(R.id.seconds);
    if (visible) {
        mSecondEditText.setFilters(new InputFilter[]{new InputFilterMinMax("0", "59"), new InputFilter.LengthFilter(2)});
        mSecondEditText.addTextChangedListener(mSecondTextWatcher);
    } else {
        mSecondEditText.setVisibility(View.GONE);
    }
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:10,代码来源:TimePickerView.java

示例15: onOptionsItemSelected

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_show_search_field) {
        // change layout params to show search text
        EditText searchTextView = (EditText) findViewById(R.id.editTextSearchField);
        // text listener to use entered characters in search
        searchTextView.addTextChangedListener(textWatcher);
        // input manager to start or hide keayboard
        InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

        if (searchTextView.getLayout().getWidth() == 0) {
            // show text for entering search field
            searchTextView.setLayoutParams(new Toolbar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
            // ... and set focus
            searchTextView.requestFocus();
            // show keyboard
            imm.showSoftInput(searchTextView, InputMethodManager.SHOW_IMPLICIT);
        } else {
            if (searchTextView.getText().toString().length() > 0) return true;
            // hide search field
            searchTextView.setLayoutParams(new Toolbar.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT));
            // hide keyboard
            imm.hideSoftInputFromWindow(searchTextView.getWindowToken(), 0);
        }
        return true;
    } else if (id == R.id.about_program_menu_item) {
        Intent intent = new Intent(getApplicationContext(), AboutProgramActivity.class);
        startActivity(intent);
        return true;
    }

    return super.onOptionsItemSelected(item);
}
 
开发者ID:white-collar,项目名称:mobile-grammar,代码行数:38,代码来源:AllArticlesListViewActivity.java


注:本文中的android.widget.EditText.addTextChangedListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。