本文整理匯總了Java中android.widget.TextView.getTag方法的典型用法代碼示例。如果您正苦於以下問題:Java TextView.getTag方法的具體用法?Java TextView.getTag怎麽用?Java TextView.getTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.TextView
的用法示例。
在下文中一共展示了TextView.getTag方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onEditorAction
import android.widget.TextView; //導入方法依賴的package包/類
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
logi("onEditorAction() :: currentEditableRow=" + currentEditableRow);
int pos = (int) v.getTag(R.id.positionId);
Project project = mProjects.get(pos);
project.inEditMode = false;
currentEditableRow = -1;
if(actionId == EditorInfo.IME_ACTION_DONE) {
dismissKeyBoard(v, true, true);
} else if(actionId == -1) {
dismissKeyBoard(v, true, false);
}
return true;
}
示例2: checkTarget
import android.widget.TextView; //導入方法依賴的package包/類
private void checkTarget(TextView textView) {
synchronized (lock) {
//noinspection unchecked
HashSet<Cancelable> cs = (HashSet<Cancelable>) textView.getTag(TASK_TAG);
if (cs != null) {
if (cs == tasks) {
return;
}
for (Cancelable c : cs) {
c.cancel();
}
cs.clear();
}
textView.setTag(TASK_TAG, tasks);
}
}
示例3: setCurrentItemSelect
import android.widget.TextView; //導入方法依賴的package包/類
public void setCurrentItemSelect(View view) {
drawBackground();
TextView tv = (TextView) view;
tv.setTextColor(tabSelectTextColor);
int tag = (int) tv.getTag();
switch (tag) {
case TAG_LEFT_VIEW:
tv.setBackgroundDrawable(mLeftSelectDrawable);
break;
case TAG_NONE_VIEW:
tv.setBackgroundDrawable(mSimpleSelectDrawable);
break;
case TAG_RIGHT_VIEW:
tv.setBackgroundDrawable(mRightSelectDrawable);
break;
}
switchViewPager(tag);
}
示例4: setCurrentIntemSelect
import android.widget.TextView; //導入方法依賴的package包/類
private void setCurrentIntemSelect(int position) {
drawBackground();
TextView tv = (TextView) getChildAt(position);
tv.setTextColor(tabSelectTextColor);
int tag = (int) tv.getTag();
switch (tag) {
case TAG_LEFT_VIEW:
tv.setBackgroundDrawable(mLeftSelectDrawable);
break;
case TAG_NONE_VIEW:
tv.setBackgroundDrawable(mSimpleSelectDrawable);
break;
case TAG_RIGHT_VIEW:
tv.setBackgroundDrawable(mRightSelectDrawable);
break;
}
}
示例5: newListener
import android.widget.TextView; //導入方法依賴的package包/類
private AdapterView.OnItemClickListener newListener() {
return new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v, int x, long id) {
TextView t = (TextView)v;
uri = (Uri)t.getTag();
title = t.getText().toString();
((TextView)getDialog().findViewById(R.id.selected))
.setText(getString(R.string.selected) + title);
player.reset();
try {
player.setDataSource(getContext(), uri);
player.prepare();
} catch (IOException e) {
Log.e(TAG, "Failed to set data " + e);
}
player.start();
}
};
}
示例6: onEditorAction
import android.widget.TextView; //導入方法依賴的package包/類
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO
|| actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_ACTION_NEXT
|| actionId == EditorInfo.IME_ACTION_SEND
|| actionId == EditorInfo.IME_ACTION_SEARCH
|| actionId == EditorInfo.IME_NULL) {
switch ((int) v.getTag()) {
case 1:
mNoteField.requestFocus();
break;
case 2:
sendIdeaFromDialog();
break;
default:
break;
}
return true;
}
return false;
}
示例7: ItemInnerTextClick
import android.widget.TextView; //導入方法依賴的package包/類
@Override
public void ItemInnerTextClick(View v) {
TextView tvAction = (TextView) v.findViewById(R.id.tv_action);
String textValue = tvAction.getText().toString().trim();
String mJumpTag = (String) tvAction.getTag(R.id.tag_first);//值為1跳轉至詳情頁一,否則詳情頁二
String quotePriceid = (String) tvAction.getTag(R.id.tag_second);//獲取quotePriceId
if ("修改".equals(textValue) && "1".equals(mJumpTag)) {
//跳轉詳情頁1
InquiryDetailsOneFragment inquiryDetailsOneFragment = InquiryDetailsOneFragment.getInstance(quotePriceid, false);
inquiryDetailsOneFragment.setTargetFragment(InquiryFragment.this, 0);
pushFragment(R.id.fl_fragment, inquiryDetailsOneFragment, LocalContext.REFRESHREQUESTCODE);
} else if ("修改".equals(textValue) && !"1".equals(mJumpTag)) {
//跳轉詳情頁2
InquiryDetailsTwoFragment inquiryDetailsTwoFragment = InquiryDetailsTwoFragment.getInstance(quotePriceid);
inquiryDetailsTwoFragment.setTargetFragment(InquiryFragment.this, 0);
pushFragment(R.id.fl_fragment, inquiryDetailsTwoFragment, LocalContext.REFRESHREQUESTCODE);
} else if ("報價處理".equals(textValue)) {
activity.pushFragment(R.id.fl_fragment, QuoteProcessFragment.getInstance(quotePriceid));
}
}
示例8: getThreed
import android.widget.TextView; //導入方法依賴的package包/類
private static Threed getThreed(TextView view) {
if (view == null) {
throw new IllegalArgumentException("view must be non-null");
}
Object tag = view.getTag(R.id.threed);
if (tag instanceof Threed) {
return (Threed) tag;
}
Threed t = new Threed();
t.textView = view;
view.setTag(R.id.threed, t);
return t;
}
示例9: onClick
import android.widget.TextView; //導入方法依賴的package包/類
@Override
public void onClick(final View v) {
if (currentLookForWid.getText().equals(" ")) {
v.startAnimation(notItAnim);
return;
}
String symv = (String)v.getTag();
TextView wid2 = activeSyms.get(current);
if (wid2==null) return;
String symw = (String)wid2.getTag();
if (symv.equals(symw)) {
Log.d("Doda", "Found " + symv.codePointAt(0));
v.setAlpha(.6f);
v.startAnimation(wasItAnim);
final ImageView blow = new ImageView(this);
blow.setBackgroundResource(R.drawable.explosion);
Point location = symPoints.get((TextView)v);
float fac = 1.25f;
score += Math.max(100, 5000 - (System.currentTimeMillis() - findTime)) * (backgroundImage?1.5:1);
int msize = spToPx((int)(mMode.getMaxIconSize(bsize)*fac));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(msize, msize);
lp.setMargins(location.x - (int)(mMode.getMaxIconSize(bsize)*fac/2), location.y - (int)(mMode.getMaxIconSize(bsize)*fac/2), 0, 0);
lp.gravity = Gravity.START | Gravity.TOP;
blow.setLayoutParams(lp);
mSoundEffects.playPlode();
v.clearAnimation();
mMainScreen.removeView(v);
activeSyms.set(current, null);
mMainScreen.addView(blow);
AnimationDrawable ad = ((AnimationDrawable) blow.getBackground());
int time = ad.getNumberOfFrames() * ad.getDuration(0);
ad.start();
showNext(false);
mMainScreen.postDelayed(new Runnable() {
@Override
public void run() {
mMainScreen.removeView(blow);
}
}, time + 20);
} else {
v.startAnimation(notItAnim);
if (mMode.isTimed()) {
startTime -= 5000;
showMessage(getString(R.string.miss_penalty));
}
}
}
示例10: getToogleTextViewStatus
import android.widget.TextView; //導入方法依賴的package包/類
public static boolean getToogleTextViewStatus(TextView btn1){
if (btn1 == null || btn1.getTag() == null){
return false;
}else{
return (Boolean)btn1.getTag();
}
}
示例11: onScanOrCancelClick
import android.widget.TextView; //導入方法依賴的package包/類
@OnClick(R.id.tv_scan_or_cancel)
public void onScanOrCancelClick(TextView view) {
Boolean tag = (Boolean) view.getTag();
if (null==tag || !tag) {
view.setText(R.string.cancel_scan);
view.setTag(true);
mPresenter.scanMusic();
} else {
view.setTag(false);
view.setText(R.string.scan_immediately);
}
}
示例12: scaleProcessTextSize
import android.widget.TextView; //導入方法依賴的package包/類
/**
* Scale the textview's font size
*
* @param view
*/
public static void scaleProcessTextSize(TextView view) {
if (view == null)
return;
Object isScale = view.getTag(R.id.is_scale_fontsize_tag);
if (isScale instanceof Boolean) {
if ((Boolean) isScale == true) {
return;
}
}
float size = view.getTextSize();
size *= sScale;
// Size's unit use pixel,so param unit use TypedValue.COMPLEX_UNIT_PX.
view.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
}
示例13: isAlreadyAssigned
import android.widget.TextView; //導入方法依賴的package包/類
private static boolean isAlreadyAssigned(TextView textView) {
return textView.getTag(R.id.onTextChangedListener) instanceof TextWatcher;
}