Markwon icon indicating copy to clipboard operation
Markwon copied to clipboard

Feature/configurable table odd row alpha

Open ntomasevic-vfy opened this issue 3 years ago • 4 comments

Odd rows of a table by default has set alpha channel (value is 22) but it should be configurable.

ntomasevic-vfy avatar Apr 16 '21 07:04 ntomasevic-vfy

Hello @ntomasevic-vfy ,

First of all, I appreciate your effort. But let me just ask - why would you need a special setting for alpha when you can specify color via tableOddRowBackgroundColor with alpha component directly?

noties avatar Apr 16 '21 20:04 noties

Hi @noties , It is because your condition is not right, if you set tableOddRowBackgroundColor as completely transparent (@andorid:color/transparent) it won't be, you will have black color with opacity of TABLE_ODD_ROW_DEF_ALPHA

if (tableOddRowBackgroundColor == 0) { color = ColorUtils.applyAlpha(paint.getColor(), TABLE_ODD_ROW_DEF_ALPHA); } else { color = tableOddRowBackgroundColor; }

ntomasevic-vfy avatar Apr 19 '21 07:04 ntomasevic-vfy

It seems, @ntomasevic-vfy , that you describe a bug that should be fixed 😉 It is better to fix current implementation (to allow transparent color) then putting a temporary plaster of adding an alpha setting (why not adding alpha for other color values?). You intend to use tableOddRowBackgroundColorOpacity with always 0 value, right?

noties avatar Apr 19 '21 12:04 noties

Yes, I used it as zero but now I use a workaround (I set any color with opacity 0 but not Color.TRANSPARENT or @android:color/transparent). I was in a hurry and didn't fix the project as it should be. I assume that you should use different condition for checking weather you should use TABLE_ODD_ROW_DEF_ALPHA or not.

ntomasevic-vfy avatar Apr 19 '21 14:04 ntomasevic-vfy