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


Java TextView.getTag方法代码示例

本文整理汇总了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;
}
 
开发者ID:Samsung,项目名称:microbit,代码行数:18,代码来源:ProjectAdapter.java

示例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);
    }
}
 
开发者ID:nichbar,项目名称:Aequorea,代码行数:17,代码来源:DefaultImageGetter.java

示例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);

    }
 
开发者ID:guzhigang001,项目名称:Bailan,代码行数:22,代码来源:SubTabNavigator.java

示例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;
    }
}
 
开发者ID:guzhigang001,项目名称:Bailan,代码行数:18,代码来源:SubTabNavigator.java

示例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();
    }
  };
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:22,代码来源:MediaPicker.java

示例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;
}
 
开发者ID:IdeaTrackerPlus,项目名称:IdeaTrackerPlus,代码行数:27,代码来源:MainActivity.java

示例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));
    }

}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:24,代码来源:InquiryFragment.java

示例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;
}
 
开发者ID:samelody,项目名称:threed,代码行数:14,代码来源:Threed.java

示例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));
        }

    }

}
 
开发者ID:quaap,项目名称:DodaTheExploda,代码行数:69,代码来源:MainActivity.java

示例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();
	}
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:8,代码来源:MyUtils.java

示例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);
    }


}
 
开发者ID:piyell,项目名称:NeteaseCloudMusic,代码行数:15,代码来源:ScanMusicActivity.java

示例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);
}
 
开发者ID:qsyj,项目名称:ShortcutMenu,代码行数:20,代码来源:ScreenUtil.java

示例13: isAlreadyAssigned

import android.widget.TextView; //导入方法依赖的package包/类
private static boolean isAlreadyAssigned(TextView textView) {
    return textView.getTag(R.id.onTextChangedListener) instanceof TextWatcher;
}
 
开发者ID:dmitry-zaitsev,项目名称:BlueTape,代码行数:4,代码来源:TextChangedBindingFunction.java


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