List of usage examples for android.graphics Paint STRIKE_THRU_TEXT_FLAG
int STRIKE_THRU_TEXT_FLAG
To view the source code for android.graphics Paint STRIKE_THRU_TEXT_FLAG.
Click Source Link
From source file:Main.java
public static void setPaintFlags(TextView textView) { textView.setPaintFlags(textView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); }
From source file:Main.java
/** * Remove strike through text view text flag. * @param textView/*from ww w . ja v a 2 s . c o m*/ * @return */ public static TextView removeStrikeThroughTextView(TextView textView) { textView.setPaintFlags(textView.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG)); return textView; }
From source file:Main.java
public static void setStrikeThrough(TextView tv) { tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); }
From source file:de.schildbach.wallet.ui.CurrencyTextView.java
public void setStrikeThru(final boolean strikeThru) { if (strikeThru) setPaintFlags(getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); else/*from w w w .j av a 2 s.com*/ setPaintFlags(getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); }
From source file:org.iota.wallet.ui.adapter.WalletAddressCardAdapter.java
@Override public void onBindViewHolder(final ViewHolder holder, int position) { int adapterPosition = holder.getAdapterPosition(); Address address = getItem(adapterPosition - 1); holder.isUsed = address.isUsed();//from w ww. j a va2 s .com holder.setIsRecyclable(false); holder.addressLabel.setText(address.getAddress()); if (address.isUsed()) { holder.addressImage.setColorFilter(ContextCompat.getColor(context, R.color.flatRed)); holder.addressLabel.setPaintFlags(holder.addressLabel.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); } else if (!address.isUsed()) { holder.addressImage.setColorFilter(ContextCompat.getColor(context, R.color.flatGreen)); } }
From source file:de.azapps.mirakel.new_ui.adapter.AutoCompleteAdapter.java
@Override public void bindView(View view, Context context, Cursor cursor) { final AutocompleteViewHolder viewHolder = (AutocompleteViewHolder) view.getTag(); final SearchObject searchObject = new SearchObject(cursor); // This is ok for tasks and a fallback variant for tags viewHolder.taskName.setText(searchObject.getName()); switch (searchObject.getAutocompleteType()) { case TASK://w w w. ja v a 2 s. c o m if (searchObject.isDone()) { viewHolder.taskName .setPaintFlags(viewHolder.taskName.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); } else { viewHolder.taskName .setPaintFlags(viewHolder.taskName.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); } break; case TAG: final Tag tag = new Tag(searchObject.getObjId(), searchObject.getName(), searchObject.getBackgroundColor(), false); TagSpan tagSpan = new TagSpan(tag, context); SpannableStringBuilder stringBuilder = new SpannableStringBuilder(); stringBuilder.append(new SpannableString(tag.getName())); stringBuilder.setSpan(tagSpan, 0, tag.getName().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); viewHolder.taskName.setText(stringBuilder, TextView.BufferType.SPANNABLE); break; } }
From source file:com.juanvvc.fschecklistreader.ChecklistFragment.java
@Override public void onListItemClick(ListView l, View v, int position, long id) { // if the fragment is showing checklists, pass the event if (mode == MODE_CHECKLISTS) { if (this.listener != null) { this.listener.onChecklistClick(position); }/*from w ww .j av a2s. com*/ } // the the fragment is showing items, strike the item if (mode == MODE_ITEMS) { TextView tv = (TextView) v.findViewById(R.id.name); tv.setPaintFlags(tv.getPaintFlags() ^ Paint.STRIKE_THRU_TEXT_FLAG); tv = (TextView) v.findViewById(R.id.value); tv.setPaintFlags(tv.getPaintFlags() ^ Paint.STRIKE_THRU_TEXT_FLAG); } }
From source file:com.maxleap.mall.activities.ProductDetailActivity.java
private void initViews() { Toolbar toolbar = mBinding.toolbar;//www. j av a 2s .c o m toolbar.setTitle(R.string.activity_product_detail_title); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); TextView tv = mBinding.originPrice; tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); mBinding.review.setOnClickListener(this); mBinding.spec.setOnClickListener(this); mBinding.detail.setOnClickListener(this); mBinding.increaseQuantity.setOnClickListener(this); mBinding.decreaseQuantity.setOnClickListener(this); mBinding.fav.setOnClickListener(this); mBinding.cart.setOnClickListener(this); mBinding.addToCart.setOnClickListener(this); mBinding.info1Layout.setOnClickListener(this); mBinding.info2Layout.setOnClickListener(this); mBinding.info3Layout.setOnClickListener(this); checkFav(); initViewPager(); mBinding.cartNum.setVisibility(View.GONE); CartPreferenceUtil cartPreferenceUtil = CartPreferenceUtil.getComplexPreferences(getApplicationContext()); // CartList cartList = cartPreferenceUtil.getObject(CartPreferenceUtil.KEY, CartList.class); List<ProductData> dataList = cartPreferenceUtil.getProductData(); if (dataList != null && dataList.size() > 0) { mBinding.cartNum.setVisibility(View.VISIBLE); mBinding.cartNum.setText(dataList.size() + ""); } }
From source file:com.pyxistech.android.rabbitreminder.adaptaters.AlertListAdapter.java
private void strikeThroughtItemIfDone(int position, AlertViewWrapper wrapper) { if (isDone(position)) { wrapper.getCheckedTextView()//from ww w.jav a 2 s. c om .setPaintFlags(wrapper.getCheckedTextView().getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); } else { wrapper.getCheckedTextView() .setPaintFlags(wrapper.getCheckedTextView().getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG)); } }
From source file:com.g11x.checklistapp.ChecklistItemActivity.java
private void createUI() { TextView name = (TextView) findViewById(R.id.name); name.setText(checklistItem.getName(language)); TextView description = (TextView) findViewById(R.id.description); description.setText(checklistItem.getDescription(language)); Button getDirections = (Button) findViewById(R.id.directions); getDirections.setOnClickListener(new View.OnClickListener() { @Override/* ww w .j a v a 2 s .c o m*/ public void onClick(View view) { ChecklistItemActivity.this.onClickGetDirections(); } }); Button doneness = (Button) findViewById(R.id.doneness); if (checklistItem.isDone()) { doneness.setTextColor(ContextCompat.getColor(ChecklistItemActivity.this, R.color.primary)); doneness.setPaintFlags(doneness.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); doneness.setText(getResources().getString(R.string.complete)); doneness.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_check_box_accent_24dp, 0, 0, 0); } else { doneness.setTextColor(Color.BLACK); doneness.setPaintFlags(doneness.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG)); doneness.setText(getResources().getString(R.string.mark_as_done)); doneness.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_check_box_outline_blank_black_24dp, 0, 0, 0); } doneness.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ChecklistItemActivity.this.onClickIsDone(); } }); Button sendEmail = (Button) findViewById(R.id.send_email); if (checklistItem.getEmail() != null && !checklistItem.getEmail().equals("")) { sendEmail.setVisibility(View.VISIBLE); sendEmail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setData(Uri.parse("mailto:")); intent.putExtra(Intent.EXTRA_EMAIL, checklistItem.getEmail()); intent.putExtra(Intent.EXTRA_TEXT, getResources().getString(R.string.sent_from_rst_checklist_app)); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(Intent.createChooser(intent, "Send e-mail")); } } }); } else { sendEmail.setVisibility(View.GONE); } Button call = (Button) findViewById(R.id.call); if (checklistItem.getPhone() != null && !checklistItem.getPhone().equals("")) { call.setVisibility(View.VISIBLE); call.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(Intent.ACTION_DIAL); intent.setData(Uri.parse("tel:" + checklistItem.getPhone())); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } } }); } else { call.setVisibility(View.GONE); } }