當前位置: 首頁>>代碼示例>>Java>>正文


Java EditText.getTag方法代碼示例

本文整理匯總了Java中android.widget.EditText.getTag方法的典型用法代碼示例。如果您正苦於以下問題:Java EditText.getTag方法的具體用法?Java EditText.getTag怎麽用?Java EditText.getTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.EditText的用法示例。


在下文中一共展示了EditText.getTag方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: validateEditText

import android.widget.EditText; //導入方法依賴的package包/類
public static boolean validateEditText(final EditText editText, final ValidationEngine validationEngine) {
    if(editText.getTag() == null) {
        ArgusLogger.w(TAG, "Not performing validations for this EditText");
    }

    boolean allWell = true;

    // get validations for tag
    List<Validation> validations = validationEngine.getValidationsByKey(editText.getTag().toString());
    if(validations != null && !validations.isEmpty()) {
        String errors = ValidationEngine.validate(editText.getText().toString(), validations);
        if(!TextUtils.isEmpty(errors)) {
            editText.setError(errors);
            allWell = false;
        }
    }

    return allWell;
}
 
開發者ID:moldedbits,項目名稱:argus-android,代碼行數:20,代碼來源:ValidationEngine.java

示例2: validateAndApplyArgNameChange

import android.widget.EditText; //導入方法依賴的package包/類
private void validateAndApplyArgNameChange(EditText argNameField) {
    ArgInfo argInfo = (ArgInfo) argNameField.getTag();
    String newName = argNameField.getText().toString();
    newName = mVariableNameManager.makeValidName(newName, null);
    if (newName != null && mVariableNameManager.getExisting(newName) == null) {
        argInfo.name = newName;
    }
}
 
開發者ID:Axe-Ishmael,項目名稱:Blockly,代碼行數:9,代碼來源:ProcedureDefinitionMutatorFragment.java

示例3: dismissKeyBoard

import android.widget.EditText; //導入方法依賴的package包/類
/**
 * Allows to hide keyboard and rename a project file by given view
 * from the list of projects.
 *
 * @param v    View that represents a project from the list.
 * @param hide If true - hides the keyboard.
 * @param done If true - renames given project file.
 */
private void dismissKeyBoard(View v, boolean hide, boolean done) {
    logi("dismissKeyBoard() :: ");

    int pos = (Integer) v.getTag(R.id.positionId);

    logi("dismissKeyBoard() :: pos = " + pos + " currentEditableRow=" + currentEditableRow);

    InputMethodManager imm = (InputMethodManager) mProjectActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), 0);

    if(hide) {
        hideEditTextView(v);
    }

    if(done) {
        EditText ed = (EditText) v;
        pos = (int) ed.getTag(R.id.positionId);
        String newName = ed.getText().toString();
        Project p = mProjects.get(pos);
        if(newName.length() > 0) {
            if(p.name.compareToIgnoreCase(newName) != 0) {
                mProjectActivity.renameFile(p.filePath, newName);
            }
        }
    }
}
 
開發者ID:Samsung,項目名稱:microbit,代碼行數:35,代碼來源:ProjectAdapter.java


注:本文中的android.widget.EditText.getTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。