Comments (7)
Did you code these behavior somewhere?
Because just rendering the new item positions would move all existing item down by the size of the inserted element.
from famous-flex.
When you insert at the top, it typically shouldn't scroll unless there are less items than would fit on the screen (this will cause the scrollview to ensure that no items are accidentally hidden from view).
Actually, now you mention it, I'm seeing sort of a bug with inserting at the top. It always seems to scroll down which isn't correct. When you manually scroll down a couple items, and then press + to insert, it works as expected and it doesn't influence the scroll position.
I'll have a look at this as it used to work, but must have gotten broken along the way,
from famous-flex.
For my project i tried to implement some kind of function which needs to compensate flickering by changing the scroll position. In the end the code was too complicated to get it production ready, when elements can be inserted at any position and other elements can also change size.
So i'm very keen on understanding your solution :)
from famous-flex.
Ah I see :)
Well, the FlexScrollView is a completely new ScrollView implementation, it bares little resemblance to the stock famo.us ScrollView. I wrote it out of a necessity to support more flexible layouts such as multiple columns and sticky column-headers. The FlexScrollView is based on ScrollController which in turn is based on LayoutController. I also wrote it support better handling for true-size renderables and making bottom alignment possible for scrollviews.
I'm not even sure where to begin explaining how it all works :)
Basically, the FlexScrollView takes care of the scrolling behavior and rendering and the ListLayout takes care of the layouting. The ListLayout tells the scrollview where to place an item, and when the scrollview sees that an item is at a new position, it uses particles & springs to move the renderable to the new position.
from famous-flex.
"when the scrollview sees that an item is at a new position" where can i find such code?
from famous-flex.
So when flow-mode is enabled, the ListLayout writes the new translate coordinates to a FlowLayoutNode. FlowLayoutNode is derived from LayoutNode and contains properties such as: size, translate, origin, align, opacity, skew, scale & rotate. it basically holds the new intended state for a layout item. FlowLayoutNode contains a particle and a spring for each of these properties. It sets the end-state of the spring (e.g. for the translate coordinates) which causes the particle to move towards that new end-state. The scrollView then asks the FlowLayoutNode (which are managed by LayoutNodeManager) for the current render-spec every render-cycle (getSpec).
from famous-flex.
I fixed the bug I mentioned earlier. When the view was at the top, and you inserted an item at index 0 (before the first item), it would always scroll to the newly inserted item, which is incorrect. It should not scroll at all when inserting. This problem has been fixed.
from famous-flex.
Related Issues (20)
- velocity limit HOT 10
- Scrollview is only partially shown (after blurring an input element, window scroll position isnt reset) HOT 9
- Pull to refresh on desktop HOT 3
- any plans to support https://github.com/Famous/engine/tree/v1.0.0? HOT 7
- Scrollview: scroll without animation HOT 3
- Invalid bower version HOT 2
- FlexScrollView - mousepad two finger scrolling doesn't work in paginated view
- LayoutController insert 0 not working HOT 6
- CollectionLayout last row just partial visible HOT 1
- WheelLayout (DatePicker) sometimes wrong number sequence HOT 7
- Possible Bug in CollectionLayout HOT 5
- Is mixed-mode really good(right) ? HOT 7
- What is the state of Famous-Flex? HOT 6
- Surface leakage issue because of Entity.register HOT 2
- Bug in DatePicker.Component.FullDay HOT 7
- SamsaraJS support
- Error: HOT 6
- Correction in documentation HOT 2
- Use famous-sizeconstraint with FlexScrollView
- Changes to LinkedListViewSequence does not get reflected in FlexScrollView
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from famous-flex.