litho icon indicating copy to clipboard operation
litho copied to clipboard

HorizontalScroll should provide the ability to fade edges

Open Fs00 opened this issue 3 years ago • 3 comments

Version

Litho 0.41.2

Issues and Steps to Reproduce

The HorizontalScroll component doesn't have the ability to fade edges when the content overflows, which is a bit surprising considering that the VerticalScroll component already has it. In my case, fading edges in HorizontalScroll would be useful to improve the appearance of a toolbar that has several buttons which cannot fit in the screen.

Expected Behavior

I would expect the HorizontalScroll component to have the horizontalFadingEdgeEnabled and fadingEdgeLength* props to provide the same fading edge functionality that VerticalScroll has.

Fs00 avatar Jul 18 '22 16:07 Fs00

Hi @Fs00 - I agree, I think this was probably an oversight. Would you be interested in sending a PR to expose this for HorizontalScroll in the same way it's been exposed for VerticalScroll?

astreet avatar Jul 28 '22 10:07 astreet

I've taken a quick look and this doesn't seem something straightforward to do... HorizontalScroll and VerticalScroll seem to have quite different underlying implementations as far as I can tell.

I'd be happier if this could be done by someone more experienced in Litho and Android development than me 😅

Fs00 avatar Jul 28 '22 14:07 Fs00

The setVerticalFadingEdgeEnabled/setHorizontalFadingEdgeEnabled calls are just on View so even though the impls are different, you should be able to make basically the same call as in VerticalScroll (i.e. setHorizontalFadingEdgeEnabled on the view in onMount)!

astreet avatar Jul 28 '22 14:07 astreet