facebook/litho

HorizontalScroll should provide the ability to fade edges

Fs00 opened this issue · 3 comments

Fs00 commented

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.

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?

Fs00 commented

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 😅

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)!