Java Code Examples for android.support.v7.widget.AppCompatEditText#setEnabled()

The following examples show how to use android.support.v7.widget.AppCompatEditText#setEnabled() . 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: MaterialEditTextPreference.java    From talk-android with MIT License 5 votes vote down vote up
public MaterialEditTextPreference(Context context, AttributeSet attrs) {
    super(context, attrs);
    int fallback;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
        fallback = DialogUtils.resolveColor(context, android.R.attr.colorAccent);
    else fallback = 0;
    fallback = DialogUtils.resolveColor(context, R.attr.colorAccent, fallback);
    mColor = DialogUtils.resolveColor(context, R.attr.md_widget_color, fallback);

    mEditText = new AppCompatEditText(context, attrs);
    // Give it an ID so it can be saved/restored
    mEditText.setId(android.R.id.edit);
    mEditText.setEnabled(true);
}
 
Example 2
Source File: MaterialEditTextPreference.java    From 920-text-editor-v2 with Apache License 2.0 5 votes vote down vote up
private void init(Context context, AttributeSet attrs) {
    setLayoutResource(context, this, attrs);
    int fallback;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
        fallback = DialogUtils.resolveColor(context, android.R.attr.colorAccent);
    else fallback = 0;
    fallback = DialogUtils.resolveColor(context, com.afollestad.materialdialogs.commons.R.attr.colorAccent, fallback);
    mColor = DialogUtils.resolveColor(context, com.afollestad.materialdialogs.commons.R.attr.md_widget_color, fallback);

    mEditText = new AppCompatEditText(context, attrs);
    // Give it an ID so it can be saved/restored
    mEditText.setId(android.R.id.edit);
    mEditText.setEnabled(true);
}
 
Example 3
Source File: EditTextPreferenceCompat.java    From MaterialPreferenceCompat with MIT License 5 votes vote down vote up
public EditTextPreferenceCompat(Context context, AttributeSet attrs) {
	super(context, attrs);
	int fallback = 0;
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
		fallback = context.getTheme().obtainStyledAttributes(new int[]{R.attr.colorAccent}).getColor(0, 0);
	}
	mColor = context.getTheme().obtainStyledAttributes(new int[]{R.attr.colorAccent}).getColor(0, fallback);

	mEditText = new AppCompatEditText(context, attrs);
	mEditText.setEnabled(true);
}