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


Java TextView.getId方法代码示例

本文整理汇总了Java中android.widget.TextView.getId方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.getId方法的具体用法?Java TextView.getId怎么用?Java TextView.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.TextView的用法示例。


在下文中一共展示了TextView.getId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setViewText

import android.widget.TextView; //导入方法依赖的package包/类
/**
 * Se de formatear el contenido de las distintas views de la lista. Modificaremos el texto de la fecha,
 * para que se vea con un formato más legible y el contendio de la nota para mostrar un preview.
 * @param v vista
 * @param text texto a modificar.
 */
@Override
public void setViewText(TextView v, String text) {
    switch (v.getId())
    {
        case R.id.liNoteDate :
            text = AppConstants.getStringDate(new Date(Long.parseLong(text)));
            break;
        case R.id.liNoteContent :
            if (text.length() > 100) {
                text = text.substring(0, 99);
                text = text + " ... ";
            }
    }
    super.setViewText(v, text);
}
 
开发者ID:gothalo,项目名称:Android-2017,代码行数:22,代码来源:NotesAdapter.java

示例2: onClick

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
	for (int i = 0; i < mTabViews.size(); i++) {
		TextView textView =  mTabViews.get(i);
           boolean isClickMe = textView.getId() == v.getId() ||
                   (mTabViews2 != null && mTabViews2.get(i).getId() == v.getId());
		if(isClickMe){
			textView.setTextColor(mSelectedTabColor);
			setCurrentItem(i);
		}else{
			textView.setTextColor(mTabViewDefaultColor);
		}
	}
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:15,代码来源:UnderlinePageIndicator.java

示例3: onEditorAction

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
    final int id = textView.getId();
    switch (id) {
        case R.id.key_edittext:
            if (actionId == EditorInfo.IME_ACTION_NEXT) {
                _secretEditText.requestFocus();
            }

            return true;
        case R.id.secret_edittext:
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                updateAuthenticationSettings();
            }

            return true;
    }

    return false;
}
 
开发者ID:CoryCharlton,项目名称:BittrexApi,代码行数:21,代码来源:AuthenticationActivity.java

示例4: onEditorAction

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_SEARCH) {
        switch (v.getId()) {
            case R.id.etSkuNo:
                // 当按了搜索之后关闭软键盘
                ((InputMethodManager) etSkuNo.getContext().getSystemService(Context.INPUT_METHOD_SERVICE))
                        .hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
                getSkuNoListByNo(etSkuNo.getText().toString());
                break;
            case R.id.etSkuName:
                ((InputMethodManager) etSkuName.getContext().getSystemService(Context.INPUT_METHOD_SERVICE))
                        .hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
                getSkuNoListByName(etSkuName.getText().toString());
                break;
        }


        return true;
    }
    return false;
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:23,代码来源:addSkuFragment.java

示例5: setViewText

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void setViewText(TextView textView, String text) {
    //Set font
    Typeface font = FontManager.getInstance().getFont(FontManager.Font.ROBOTO_LIGHT);
    textView.setTypeface(font);

    int id = textView.getId();

    if (id == R.id.textView_history_date) {
        setDateView(textView, text);
    } else if (id == R.id.textView_history_meat) {
        setMeatView(textView, text);
    } else if (id == R.id.textView_history_amount) {
        setAmountView(textView, text);
    }
}
 
开发者ID:mr-kojo,项目名称:Veggietizer,代码行数:17,代码来源:HistoryCursorAdapter.java

示例6: onEditorAction

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (v.getId() == nameView.getId() && actionId == EditorInfo.IME_ACTION_NEXT) {
        phoneNumberView.requestFocus();
        return true;
    }

    return false;
}
 
开发者ID:hypertrack,项目名称:hypertrack-live-android,代码行数:10,代码来源:Profile.java

示例7: setViewText

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void setViewText(TextView view, String text) {
    // para la duración, realizaremos un formateo
    if (view.getId() == R.id.liCallDuration) {
        long longVal = Long.parseLong(text);
        text = AppUtils.secondsToHoutMinSecond(longVal);
    }
    super.setViewText(view, text);

}
 
开发者ID:gothalo,项目名称:Android-2017,代码行数:11,代码来源:CallLogAdapter.java

示例8: onEditorAction

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
    if (EditorInfo.IME_ACTION_SEND == actionId) {
        onPushAction();
        return true;
    }
    else
    if ( (EditorInfo.IME_ACTION_SEARCH == actionId ) && ( textView.getId() == R.id.et_contract_account) ){
        onContractEntered( mEtContract.getText().toString());
    }

    return false;
}
 
开发者ID:mithrilcoin-io,项目名称:EosCommander,代码行数:14,代码来源:PushFragment.java

示例9: onEllipsizeChange

import android.widget.TextView; //导入方法依赖的package包/类
@Override
public void onEllipsizeChange(TextView view, boolean ellipsized) {
    switch (view.getId()) {
        case R.id.text1:
            view.setBackgroundColor(getResources().getColor(R.color.white));
            break;
        case R.id.text2:
            if (!ellipsized) {
                Toast.makeText(this, "ellipsized=false", Toast.LENGTH_LONG).show();
            }
            break;
    }
}
 
开发者ID:samelody,项目名称:threed,代码行数:14,代码来源:MainActivity.java


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