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