當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。