Horizontal ScrollView Loop in React Native - reactjs

Checked different settings and sources, but can’t find the way to make an infinite horizontal scrolling with React Native, so that e.g. when the last image is reached, the next gesture would lead to the first image. Am I missing a setting, or is there a more sophisticated way of doing this? Please advise and if possible, share some code. Using external libraries is very undesirable.

Related

Possible to support StickyHeaders for CN1?

I really like the idea of StickyHeaders (https://www.codenameone.com/blog/sticky-headers.html), they're great for usability, but the CN1 implementation was never fully developed or included in CN1. Solutions exist for iOS and Android (https://github.com/emilsjolander/StickyListHeaders and http://applidium.github.io/HeaderListView/).
The two main features I'm missing in the old implementation are: that each header visually 'pushes' the previous out of the top of the screen (and vice-versa when scrolling down), and that the stickyheader which is 'stuck' at the top of the screen is the actual stickyheader itself, so that eg. buttons inside it will work.
Are there any plans to add this to CN1 sometime soon? Or anyone who has implemented a similar solution (I tried Chibuike Mba's alternative implementation mentioned on the original blog post but it doesn't cover the features I'd like)?
Alternatively, any pointers to how I might implement this myself?
I've already tried a couple of times, but given up since I don't master the details of CN1 graphics etc well enough. The approach mentioned here How to make sticky section headers (like iOS) in Android? sounds like a good approach (add a container on top for the stickyheader, scroll that container when the next stickyheader arrives), but then how to force the size and scrolling of such a container?)
This should be much simpler to implement today as we have two helpful features:
Scroll listener
Layered pane
You can use the scroll listener to detect the location of a header and appropriately place another component in the NORTH of a Container within the layered pane. Then as scrolling happens and you detect a new header is coming in you can just place it in an X/Y position below the existing component and use animateLayout to push it out.

FastScroll in React Native

Any suggestions on implementing quickscroll AKA fastScroll on React Native?
I'm trying to implement quick scrolling -- AKA fast scrolling -- on a FlatList in React Native and I'm running into a lot of issues.
The existing libraries, react-native-quick-scroll & react-native-alphabetlistview don't perform too well when scrolling and are rather dated.
I'm looking for something similar to the screenshot below, where the user can scroll normally by touching the list items but also scroll much faster using the scroll bar on the right side.
Does anyone have any suggestions?
Any help would be greatly appreciated!
React Native TableView might work, using the sectionIndexTitlesEnabled property, but it is iOS-only: https://github.com/aksonov/react-native-tableview

Swipe/Gestures in Codename One

In searching around, I have not been able to find information about generic support in Codename One for gestures generally, and swipe in particular.
I see I can easily set up swipe on a form to return to a prior form, and there is a way to create swipeable containers that work a specific way to rework the display of that container, but what if I just generally want to capture a swipe event - ideally on a container but if not that then on a form - and then take some specific action when that event occurs?
We don't support a high level gesture API. Most of those are inconsistent across platforms and pretty hard to work with so we never built one.
APIs such as tabs include the ability to swipe between containers, and image viewer allows swiping images. Those come up to about 90% of the use cases for swiping.
In other cases people just use a drag motion listener to detect the right level of drag and determine a swipe/pull.
Notice that drag and drop isn't swipe and we do support that with a special API.

How to step through a GIF animation based on the browser's scroll position?

I have a GIF that I will use in a React web app I am building. I want to be able to step through the animation based on the scroll position of the site.
I.e. when I have scrolled through 50% of the page, then I want the gif to display the image at its 50% position.
The gif will be in a div, position:fixed. So it will always live in the top corner of the browser.
The web app is a react app so if it's possible that there's a react library that implements this then that would be great.
Thanks!
There appears to be at least one ready made React implementation for dealing with the interaction with/playing of the GIF that may be able to assist you in your project.
React Gif Player is a React component which creates a GIF player similar to Facebook's implementation. It also comes with a pause function (and an example), which you may be able to use to programatically pause the GIF at corresponding points based on your scroll position.
Gif Frames is a pure JavaScript tool for extracting GIF frames and saving to file. You may be able to create individual frames and correspond frames with certain points of the scroll.
I'm not aware of a gif player that implements exactly what you were hoping for, although others may be able to assist in this regard. If not, you may have to use a combination of, or do a full implementation yourself.
Hopefully this helps.

CN1 how to deal with the home indicator (iPhone X and such)

When we have to deal with (native) device specific objects on the display (such as the home indicator in iPhone X) in case of having a proper layout of our app (avoiding those objects violate the layout), should I adapt the layout in native code or in CN1 specific code?
What would you suggest?
Most of our effort was around the notch and not so much on the home button but we probably should add support for iOS's safe area API. Although technically it's a pretty horrible API.
It might be better to add some device detection to the tabs component and add some padding in the bottom of the tabs by default. We can probably do it if you file an issue, you can do this manually too using a library such as this.

Resources