本文整理汇总了Java中android.support.v7.widget.AppCompatEditText.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatEditText.setEnabled方法的具体用法?Java AppCompatEditText.setEnabled怎么用?Java AppCompatEditText.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatEditText
的用法示例。
在下文中一共展示了AppCompatEditText.setEnabled方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
@Override
protected void init(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes) {
super.init(context, attrs, defStyleAttr, defStyleRes);
mEditText = new AppCompatEditText(context, attrs);
// Give it an ID so it can be saved/restored
mEditText.setId(android.R.id.edit);
/*
* The preference framework and view framework both have an 'enabled'
* attribute. Most likely, the 'enabled' specified in this XML is for
* the preference framework, but it was also given to the view framework.
* We reset the enabled state.
*/
mEditText.setEnabled(true);
setDialogLayoutResource(R.layout.mpl__edittext_dialog_preference);
}
示例2: init
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs) {
PrefUtil.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, R.attr.colorAccent, fallback);
color = DialogUtils.resolveColor(context, R.attr.md_widget_color, fallback);
editText = new AppCompatEditText(context, attrs);
// Give it an ID so it can be saved/restored
editText.setId(android.R.id.edit);
editText.setEnabled(true);
}
示例3: init
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs) {
PrefUtil.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, R.attr.colorAccent, fallback);
color = DialogUtils.resolveColor(context, R.attr.md_widget_color, fallback);
editText = new AppCompatEditText(context, attrs);
// Give it an ID so it can be saved/restored
editText.setId(android.R.id.edit);
editText.setEnabled(true);
}
示例4: MaterialEditTextPreference
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
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);
}
示例5: MaterialEditText
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
public MaterialEditText(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs, 0, 0);
int fallback = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
fallback = context.getTheme().obtainStyledAttributes(new int[]{R.attr.colorAccent}).getColor(0, FALLBACK_COLOR);
}
mColor = context.getTheme().obtainStyledAttributes(new int[]{R.attr.colorAccent}).getColor(0, fallback);
mEditText = new AppCompatEditText(context, attrs);
mEditText.setEnabled(true);
}
示例6: init
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
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);
}
示例7: EditTextPreferenceCompat
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
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);
}
示例8: init
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs) {
//PrefUtil.setLayoutResource(context, this, attrs);
TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{ R.attr.colorAccent });
try {
mColor = a.getColor(0, -1);
} finally {
a.recycle();
}
mEditText = new AppCompatEditText(context, attrs);
// Give it an ID so it can be saved/restored
mEditText.setId(android.R.id.edit);
mEditText.setEnabled(true);
}
示例9: onCreate
import android.support.v7.widget.AppCompatEditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_telegram_compose);
isInProgress = false;
// Either get data from intent or restore state
if (getIntent() != null) {
replyId = getIntent().getIntExtra(REPLY_ID_DATA, NO_REPLY_ID);
recipients = getIntent().getStringExtra(RECIPIENTS_DATA);
isDeveloperTg = getIntent().getBooleanExtra(DEVELOPER_TG_DATA, false);
}
String savedContent = null;
if (savedInstanceState != null) {
replyId = savedInstanceState.getInt(REPLY_ID_DATA, NO_REPLY_ID);
isDeveloperTg = savedInstanceState.getBoolean(DEVELOPER_TG_DATA, false);
recipients = savedInstanceState.getString(RECIPIENTS_DATA);
savedContent = savedInstanceState.getString(TG_CONTENT_DATA);
}
mView = findViewById(R.id.telegram_compose_main);
headerCardView = (CardView) findViewById(R.id.telegram_compose_header) ;
developerCardView = (CardView) findViewById(R.id.telegram_compose_developer_header);
headerCardView.setVisibility(isDeveloperTg ? View.GONE : View.VISIBLE);
developerCardView.setVisibility(isDeveloperTg ? View.VISIBLE : View.GONE);
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.telegram_compose_refresher);
mSwipeRefreshLayout.setColorSchemeResources(RaraHelper.getThemeRefreshColours(this));
mSwipeRefreshLayout.setEnabled(false);
Toolbar toolbar = (Toolbar) findViewById(R.id.telegram_compose_toolbar);
setToolbar(toolbar);
recipientsField = (AppCompatEditText) findViewById(R.id.telegram_compose_recipients);
if (recipients != null && recipients.length() > 0) {
recipientsField.setText(recipients);
if (replyId != NO_REPLY_ID) {
// If this is a reply telegram, don't let user edit this field
recipientsField.setEnabled(false);
recipientsField.setFocusable(false);
}
}
senderField = (TextView) findViewById(R.id.telegram_compose_sender);
senderField.setText(PinkaHelper.getActiveUser(this).name);
content = (AppCompatEditText) findViewById(R.id.telegram_compose_content);
if (savedContent != null) {
content.setText(savedContent);
}
content.requestFocus();
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}