Java Code Examples for android.widget.TextView.getTag()

The following are Jave code examples for showing how to use getTag() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: microbit   File: ProjectAdapter.java   View Source Code Vote up 7 votes
@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;
}
 
Example 2
Project: Aequorea   File: DefaultImageGetter.java   View Source Code Vote up 6 votes
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);
    }
}
 
Example 3
Project: Bailan   File: SubTabNavigator.java   View Source Code Vote up 6 votes
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);

    }
 
Example 4
Project: Bailan   File: SubTabNavigator.java   View Source Code Vote up 6 votes
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;
    }
}
 
Example 5
Project: buildAPKsApps   File: MediaPicker.java   View Source Code Vote up 6 votes
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();
    }
  };
}
 
Example 6
Project: IdeaTrackerPlus   File: MainActivity.java   View Source Code Vote up 6 votes
@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;
}
 
Example 7
Project: CXJPadProject   File: InquiryFragment.java   View Source Code Vote up 6 votes
@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));
    }

}
 
Example 8
Project: threed   File: Threed.java   View Source Code Vote up 6 votes
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;
}
 
Example 9
Project: DodaTheExploda   File: MainActivity.java   View Source Code Vote up 5 votes
@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));
        }

    }

}
 
Example 10
Project: Huochexing12306   File: MyUtils.java   View Source Code Vote up 5 votes
public static boolean getToogleTextViewStatus(TextView btn1){
	if (btn1 == null || btn1.getTag() == null){
		return false;
	}else{
		return (Boolean)btn1.getTag();
	}
}
 
Example 11
Project: NeteaseCloudMusic   File: ScanMusicActivity.java   View Source Code Vote up 5 votes
@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);
    }


}
 
Example 12
Project: ShortcutMenu   File: ScreenUtil.java   View Source Code Vote up 5 votes
/**
 * 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);
}
 
Example 13
Project: BlueTape   File: TextChangedBindingFunction.java   View Source Code Vote up 4 votes
private static boolean isAlreadyAssigned(TextView textView) {
    return textView.getTag(R.id.onTextChangedListener) instanceof TextWatcher;
}