/** * Sets the color used to display the selection highlight. * * @attr ref android.R.styleable#TextView_textColorHighlight */ public void setHighlightColor (int color){ mInputView.setHighlightColor(color); }
/** * Set the color of the highlight when text is selected * * @param highlightedTextColor selected text highlight color */ public void setTextHighlightColor(int highlightedTextColor) { this.highlightedTextColor = highlightedTextColor; searchEdit.setHighlightColor(highlightedTextColor); }
/** * Setup editText coloring and drawables */ private void setupSearchEditText() { setupCursorColor(); searchEdit.setHighlightColor(highlightedTextColor); if (hintText != null) searchEdit.setHint(hintText); if (placeholderText != null) { arrowIcon.setBackground(null); placeHolder.setText(placeholderText); } }
editText.setShadowLayer(shadowRadius, shadowDx, shadowDy, shadowColor); editText.setLinkTextColor(linkColor); editText.setHighlightColor(highlightColor); editText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); editText.setLineSpacing(extraSpacing, spacingMultiplier);
public void setColors(int colorTo) { mTextView.setTextColor(colorTo); int black_54p = ContextCompat.getColor(mContext, R.color.black_54p); if (colorTo == black_26p) { mEditText.setTextColor(black_54p); mEditText.setHighlightColor(black_26p); } else { mEditText.setTextColor(colorTo); mEditText.setHighlightColor(DisplayUtil.getLightColor(colorTo, mContext)); } DisplayUtil.tintView(mEditText, colorTo); } }
color, WidgetDefaults.ADS_ALPHA_HINT); editText.setHintTextColor(hintColor); editText.setHighlightColor(DynamicColorUtils.getContrastColor( hintColor, editText.getCurrentTextColor()));
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); } }
@Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { DisplayUtil.tintView(v, mAccentColor); ((EditText) v).setTextColor(mAccentColor); ((EditText) v).setHighlightColor(DisplayUtil.getLightColor(mAccentColor, mActivity)); } else { improveComplex(); DisplayUtil.tintView(v, black_26p); ((EditText) v).setTextColor(black_54p); } } });
@Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { DisplayUtil.tintView(v, mAccentColor); ((EditText) v).setTextColor(mAccentColor); ((EditText) v).setHighlightColor( DisplayUtil.getLightColor(mAccentColor, mContext)); } else { DisplayUtil.tintView(v, black_26p); ((EditText) v).setTextColor(black_54p); if (v.equals(etHour)) { DateTimeUtil.limitHourForEditText(etHour); } else { DateTimeUtil.formatLimitMinuteForEditText((EditText) v); } } } };
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); mActivity = (DetailActivity) getActivity(); mRecorder = new AudioRecorder(); mLlFileName = f(R.id.ll_audio_file_name); mEtFileName = f(R.id.et_audio_file_name); mChronometer = f(R.id.chronometer_record_audio); mVisualizer = f(R.id.voice_visualizer); mBase = f(R.id.view_voice_visualizer_base); mFabMain = f(R.id.fab_record_main); mIvReRecording = f(R.id.iv_re_recording_audio); mIvCancelRecording = f(R.id.iv_cancel_recording_audio); int accentColor = mActivity.getAccentColor(); mVisualizer.setRenderColor(accentColor); mBase.setBackgroundColor(accentColor); mEtFileName.setHighlightColor(DisplayUtil.getLightColor(accentColor, mActivity)); DisplayUtil.setSelectionHandlersColor(mEtFileName, accentColor); DisplayUtil.tintView(mEtFileName, ContextCompat.getColor(mActivity, R.color.black_26p)); mRecorder.link(mVisualizer); mRecorder.startListening(); setEvents(); return mContentView; }