Java Code Examples for android.widget.EditText#setHighlightColor()

The following examples show how to use android.widget.EditText#setHighlightColor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From IdeaTrackerPlus with MIT License 5 votes vote down vote up
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);
        }

    }