JavaFX ListView with touch events for scrolling up and down

This is what I’ve made public class CustomListCell extends ListCell<Document>{ private double lastYposition = 0; public CustomListCell(){ setOnMousePressed(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { lastYposition = event.getSceneY(); } }); setOnMouseDragged(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { double newYposition = event.getSceneY(); double diff = newYposition – lastYposition; lastYposition = newYposition; CustomScrollEvent cse … Read more

Windows 8 ListView with horizontal item flow

You can use a ListView this way: <ListView Height=”500″ VerticalAlignment=”Center” ScrollViewer.HorizontalScrollBarVisibility=”Auto” ScrollViewer.VerticalScrollBarVisibility=”Disabled” ScrollViewer.HorizontalScrollMode=”Enabled” ScrollViewer.VerticalScrollMode=”Disabled” ScrollViewer.ZoomMode=”Disabled” SelectionMode=”None”> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel Orientation=”Horizontal” /> </ItemsPanelTemplate> </ListView.ItemsPanel> — that gives it a horizontal panel and the right ScrollBars for horizontal scrolling. Both ListView and GridView can cause problems when you get larger items. I think by default the items … Read more

ListView grid in React Native

You need to use a combination of flexbox, and the knowledge that ListView wraps ScrollView and so takes on its properties. With that in mind you can use the ScrollView’s contentContainerStyle prop to style the items. var TestCmp = React.createClass({ getInitialState: function() { var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); var … Read more

flutter ListView KeepAlive after some scroll

For automaticKeepAlive to work, each item that needs to be kept alive must send a specific notification. A typical way to fire such notification is using AutomaticKeepAliveClientMixin class Foo extends StatefulWidget { @override FooState createState() { return new FooState(); } } class FooState extends State<Foo> with AutomaticKeepAliveClientMixin { @override Widget build(BuildContext context) { return Container( … Read more