How to move list item given source index and destination index with animation in flutter - list

I am building a leaderboard screen in the flutter application, whenever the user comes to the leaderboard screen, I want to show the animation of his old position to a new position in the leaderboard, so I need an animation of this row to go up or down based on his standings, please someone help me which widget to use to get this functionality working. Thanks

AnimatedList is the widget you are looking for. It automatically generates entrance and exit animation when items are added/deleted. Combined that with SizeTransition, and you will get a nice "growing/shrinking" effect.
There are some really good examples (and even a video tutorial) on the official docs as well.
You can also look at this answer for a more complex example of using 2 of them.

Related

Change the order of ColumnLayout or ListView and save / restore it

I'm working on a stream overlay that extracts information out of a game (flight simulator) and displays it on the screen. Right now I'm using Qt in conjunction with a *.html to render the overlay. It is all working really well, however I wanted to add some customization options for the users of my overlay software and I figured the best way would be to render the Overlay in QML.
The main part of the overlay is a row that contains around 8 "elements" that display the relevant data.
One thing that should be customized is the order of the elements in the row. But I really have no idea how to implement this feature. I've seen a few posts and tutorials on how to customize the order in a View using the DelegateModel. However right now it's not a view but QML Components inserted in a RowLayout due to the fact that they are all different components (e.g. some of the images are actually animated for which I'm using a component that uses Canvas2D to draw the images). I guess I could figure out a way to store those elements in a model using the Loader Component to display the content in QML. But even then I'm not entirely sure how to store and restore the order of the elements. As far as I can tell the DelegateModel only changes the View and not the underlying model.
Any suggestion or best practice to accomplish my goal would be highly appreciated.

codename one - no way to set background image in list

I am new to codename one and I have tried for one and half day to fix my issue of,
a list with background image in each row.
Let me explain, I am having a list with some items(entries), I created renderer and name it appropriately. I set background correctly which is reflecting in designer (see image)
but when I run it on simulator/device , all formatting and designs are just invisible..!! (see red arrow pointing to simulator in image)
anyone have any idea ? why this is happening ?
Thanks,
Akash
It seems you didn't set the background correctly in the designer. Since the list items in the model within the designer are strings the renderer entries don't get overriden and so you see a separate UI.
To reproduce the issue in the designer click the items entry in the list property, remove everything and add a sample key/value hashtable pair. You would see all your design entries disappearing.
This might help you understand how to customize images and backgrounds here: http://www.codenameone.com/3/post/2013/12/deeper-in-the-renderer.html

How do I create a slider in the GDK?

Programming the GDK a few weeks now, the CardScrollView is a pretty nice interface for displaying cards. However one issue with the UI is showing the user how far along they are in the card stack. In the Mirror API, this is nicely handled by the Slider view at the bottom of the screen as described on the Glass Design page:
https://developers.google.com/glass/design/style/metrics-grids
Unfortunately, I have not been able to get this Slider object to display on the CardScrollView and instead have resorted to a klugey 1 of n text.
Is there any way to get this Slider view to display in the GDK?
This is not yet supported by our API but is currently tracked with Issue #256.
For future reference, this feature has been already implemented as described in the original issue.
You can use the method setHorizontalScrollBarEnabled to show the bar, e.g.
mCardScrollView.setHorizontalScrollBarEnabled(true);

C++ Image Flow/Slider

I have a software which displays small image thumbnails at the bottom of the screen:
But these sample 5 are just a small portion of all the available ones. I am looking for ideas of libraries or just available open source code that would let me animate them as they switch to the previous/next ones in the list when the arrow button is pressed or the user flicks them left/right like on an ipod.
I am NOT using Qt (as another answer suggests using it).
Hey my be you need this one, has got nice animations and its native
http://www.codeproject.com/Articles/21006/Not-just-a-image-list-control-Neat-3D-iTunes-style

creating squares and rectangles in wxwidgets

I'm working on an application, and part of it is making the user create a shapes such as squares or rectangles. I'm wondering if there is a function in wxwidgets that enable the user to do that. What i want to do is the user will click this button then he/she can draw a square or rectangle in his/her desired size. It is like in paint where you can make your own size in your desired size. Is that possible in wxwidgets and codeblocks? maybe some related links or tutorials or anything that will help. thanks !!
You should use this contrib library:
Object Graphics Library
OGL defines an API for applications that need to display objects connected by lines. The objects can be moved around and interacted with. You can find this in contrib/src/ogl, contrib/include/wx/ogl, and contrib/samples/ogl.
This is the link:
http://docs.wxwidgets.org/2.8/wx_utilities.html
Max
Titles sais context here is "drawing", ok.
But in case you are talking about user-created rectangles as means of selecting stuff (or users end up here while searching for that context), jargon for that is rectangles as selection is "marquee selection", and you would look into Wx::Overlay to accomplish that.