Jump to content

Recommended Posts

Posted (edited)

Hello members!

 

I started learning delphi few months ago and recently i discovered that we can make really beautiful user interfaces with delphi FMX styles. 

 

I saw on the internet this animation demo ( This is just a design ) and I wanted to implement it in delphi: https://thumbs.gfycat.com/ShamelessConfusedAmbushbug-mobile.mp4

 

I was thinking to use ListView component in FMX for this with ItemApperance -> DynamicApperance.

Everything was cool but i faced one problem. Problem is that I am not sure that TlistViewItem can perform animation when it is been added to the ListView.

 

From my understandings i can only animate "Text1" and other items if i add them -> https://i.imgur.com/Y3SWIsT.jpg

There is no option ( or I dont know how to find it ) To animate whole TListItemView when is added to a ListView.

 

**WORKAROUND THAT I HAVE ON MY MIND**

I was thinking to drop a ListBox and to add on it "TListBoxItem", after that i would right click it and Go on edit custom style, and try to make it look as i want.

I tested this tutorial for editing the look of "TListBoxItem" and it is working nicely: https://www.experts-exchange.com/articles/10054/Implementing-a-ListView-in-Firemonkey.html

 

For animation i planned to use this resources ( not tested, i dont know if it will work ) :

 

 

So what is my question actually, well i would like to achieve similar design and effect from gif that i showed to you. I would like to use ListView with DynamicApperance. I would like to someone confirm me if that is possible and to give me some references or resource material where i could read more about it.. Also if there is someone who would like to give me a code example i would appreciate a lot.

 

From my tests that i performed ( loop 1000 times, and add 1000 items on ListView and ListBox )  I can say that ListBox performed a lot slower so I would prefer ListView for this, also i think that using ListView here is better practice since ListView is more suitable for this situation based on this post: http://www.delphigroups.info/2/8f/544471.html

 

At the end I just want to point out that im using FMX ONLY because i found it easier to make styles, this program is for Windows only platform. I am using Delphi Rio community ( Free version ). I would also like to add that option " Pull to refresh " that you see on that gif is not needed.

 

Thank you for your answers and help! 🙂

 

 

Edited by Tntman

Share this post


Link to post
4 hours ago, Serge_G said:

Hi,

I never thought about including animation in a ListView but, why not 😉

However my guess is TListView is not a good candidate for this sort of usage. Instead think about the ancestor, a TScrollBox.

In my mind, this Jaques Nascimento video or videos from CodeRage2019 (Paul Thoth and Adriano Santos interventions)  

Hello. Interesting approach using TScrollBox, i never used TScrollBox before but as I can see it is not that hard to get in touch with it..

 

Let me elaborate more about what I would like to create and why I think that TlistView is my best choice..

 

That animation gif that I showed u would be just one part of the application. It will represent a user list ( Part of a chat room that I will try to make with IndyTCP components ). In one field I plan to put username, image, join date and some other stuff.. SO when user joins chat room it animates like showed on picture and update list ( basically add that user ). Users can change usernames in real time, so server will push that change to other users and update their GUI.

 

From my understandings if I try to make this with TScrollBox I should make Rectangle and other components inside it ( labels, images etc... ) and on user join I in runtime add  it to TScrollBox and display on GUI. I think that problem with this approach can occur because i would have to implement my own indexes for every field ( in TlistView for example you have OnItemClick procedure that is built in and that can figure out indexes behind the scenes for you ) also i think it will become buggy after adding like 1k rectangles with all the labels and images ( not tested that and I know that I wont have that much users just saying .. ) ... Short answer is that I am afraid to code that by myself because I am scared of making it crappy and inefficient but I guess it is the learning curve ...

 

Links that you posted looks really nice, and I already see that I can learn a lot from them .. I thought that I watched every possible video related to delphi design on the youtube LOL but your links prove that I am wrong :classic_biggrin::classic_biggrin: I will watch them closely and try to pick best approach for my app :classic_cheerleader:

 

Share this post


Link to post
19 hours ago, Tntman said:

 Short answer is that I am afraid to code that by myself because I am scared of making it crappy and inefficient but I guess it is the learning curve ... 

Well don't be so afraid. I think you can use a TFrame (somewhere TFrame is like a style) for all that filling stuff. I think it was the Paul Toth approach. 

  • Like 1

Share this post


Link to post
7 hours ago, Serge_G said:

Well don't be so afraid. I think you can use a TFrame (somewhere TFrame is like a style) for all that filling stuff. I think it was the Paul Toth approach. 

I will try and see, i started yesterday developing my own design in Adobe XD so after that i will start coding :classic_cheerleader:

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×