当前位置: 首页>>代码示例>>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;未经允许,请勿转载。