public void clickTextView(final TextView textView, final int skillId) { textView.setMaxLines(1); textView.setSingleLine(true); textView.setEms(13); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setClickable(true); textView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { skillPageFlag = true; sellerSkillId = skillId; new regTask().execute("SellerMarket profile"); } }); }
@Override public View newView(Context context, Cursor cursor, ViewGroup parent) { View v = super.newView(context, cursor, parent); ViewHolder holder = new ViewHolder(); View colorContainer = v.findViewById(R.id.colorContainer); View colorAccount = v.findViewById(R.id.colorAccount); holder.colorContainer = colorContainer; holder.colorAccount = colorAccount; holder.amount = (TextView) v.findViewById(R.id.amount); holder.category = (TextView) v.findViewById(R.id.category); holder.color1 = v.findViewById(R.id.color1); if (mAccount.type.equals(Type.CASH)) { colorContainer.setVisibility(View.GONE); } if (mAccount.getId() < 0) { colorAccount.setLayoutParams(new LayoutParams(4, LayoutParams.FILL_PARENT)); } TextView tv = (TextView) v.findViewById(R.id.date); tv.setEms(dateEms); v.setTag(holder); return v; }
/** * Turns on fixed size for the TextView containing the indicatortext. Do not use with setSize()! * This mode looks good if the indicatortext length is fixed, e.g. it's always two characters * long. * * <p> * * @param sizeEMS number of characters in the indicatortext */ public void setFixedSize(final int sizeEMS) { mScrollIndicatorText.setEms(sizeEMS); }