Android:Strike Out Text With Bold or Thicker Line Than Default Strike_Thru_Text_Flag

Android : Strike out Text with bold or thicker line than default STRIKE_THRU_TEXT_FLAG

You can't change the thickness of the strikethrough line.

As you can see from the docs its just a flag. Either on or off.

There are a couple of options though (more hacks than solutions):

  1. Make the text bold or stroke it. This will automatically stroke the strikethrough too which will make it more visible

  2. Manually draw the line with drawLine. (This would be really difficult to do accurately though)

Is there an easy way to strike through text in an app widget?

You can use this:

remoteviews.setInt(, "setPaintFlags", Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);

Of course you can also add other flags from the class.

Animating strike-through on a TextView

You have a couple of options:

  • Extend TextView and make a custom view which checks if the STRIKE_THRU_TEXT_FLAG is set and fires off an animation that will draw a small line on the text incrementing it's width on each frame of the animation.

  • Use an empty view and place it on your TextView (using RelativeLayout, FrameLayout etc). Make sure the dimensions of this view match exactly with your TextView. Then animate this view following the same strategy as before: Draw a horizontal line at the center of the view whose width is incremented at each frame of the animation.

If you want to know how to the animation itself, then you can look up Animator, AnimatorSet etc and their related guides.

How to add strike through on Text in react native?

With :

<Text style={{textDecorationLine: 'line-through', textDecorationStyle: 'solid'}}>
Solid line-through

How could this manner of writing code be called?

I would call it 'twice is better'. It's made like that to be sure that the runtime really understood the question ;).

(although in multi-threaded, not-safe environment, the result may differ between the two variants.)

Find two consecutive rows

Assuming the rows have sequential IDs, something like this may be what you're looking for:

select top 1 * 
Bills b1
inner join Bills b2 on = - 1
b1.IsEstimate = 1 and b2.IsEstimate = 1
order by
b1.BillDate desc

Related Topics

Leave a reply