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


Java AppCompatEditText.setEnabled方法代码示例

本文整理汇总了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);
}
 
开发者ID:AndroidDeveloperLB,项目名称:MaterialPreferenceLibrary,代码行数:18,代码来源:EditTextPreference.java

示例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);
}
 
开发者ID:afollestad,项目名称:material-dialogs,代码行数:17,代码来源:MaterialEditTextPreference.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:MaterialEditTextPreference.java

示例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);
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:15,代码来源:MaterialEditTextPreference.java

示例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);
}
 
开发者ID:creativetrendsapps,项目名称:SimplicityBrowser,代码行数:13,代码来源:MaterialEditText.java

示例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);
}
 
开发者ID:jecelyin,项目名称:920-text-editor-v2,代码行数:15,代码来源:MaterialEditTextPreference.java

示例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);
}
 
开发者ID:fython,项目名称:MaterialPreferenceCompat,代码行数:12,代码来源:EditTextPreferenceCompat.java

示例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);
}
 
开发者ID:chdir,项目名称:aria2-android,代码行数:16,代码来源:SanePreference.java

示例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);
}
 
开发者ID:lloydtorres,项目名称:stately,代码行数:58,代码来源:TelegramComposeActivity.java


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