Coder Social home page Coder Social logo

View recycling about sortabletableview HOT 5 OPEN

ischwarz23 avatar ischwarz23 commented on July 18, 2024
View recycling

from sortabletableview.

Comments (5)

ISchwarz23 avatar ISchwarz23 commented on July 18, 2024

Hi @ciskeboekelo,

no, there is no explicit reason. I have created this library for a project where the amount of data was pretty small. But I can see the issue if the amount of data is growing. I'm thinking about a new TableDataAdapter which makes use of the recycler view pattern.

from sortabletableview.

rohitjagtap1991 avatar rohitjagtap1991 commented on July 18, 2024

Hi @ISchwarz23 ,
Thanks for such a great library.
Could you please do the recycling and update the library or is there any way I can do it?

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on July 18, 2024

Hi @rohitjagtap1991,

I'm glad that you like my library :)

As the core component of the tableview is a ListView and not a RecyclerView it would be a complete recreation of this library to have the 'original' Android RecyclerView in place.

If we want to hava the same concept as the recycler view in the ListView we need to have a LayoutManager that manages the adding of views that are on the screen and remove them from the list if they are off the screen (so they can be recycled with different data on a different position).

But what can be done to improve the performance (but which will consume more memory) is to create a TableDataAdapter that will cache the views, instead of creating them for every call. In this case you also need to invalidate this cache as soon as the data changed.

But in deed, the proper solution would be, to replace the ListView by a RecyclerView using a LinearLayoutManager. As this will change a main part of the TableView API there will not do this change in the near future in this library. Another idea would be, to have a parallel implementation that is using the RecyclerView instead of the ListView as independent library. As you seem to be very interested in this feature, maybe you will create such a fork :)

Best regards,
Ingo

from sortabletableview.

martinbaciga avatar martinbaciga commented on July 18, 2024

Hi @ISchwarz23 i believe that if you are implementing ArrayAdapter you can actually recycle views with the view holder implementation on the adapter.

I think this is a very important feature since not recycling views is very critical on any mobile app. I recommend you to work on that if you have time, since this is a great approach and there are not many libraries on the web to implement easily a table view the way we use lists. Also i think Android should work on this... but what ever.

Regards

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on July 18, 2024

Hi @ciskeboekelo,

your idea about the view recycling was very nice. The result is a new generation of the SortableTableView which is based on the recyclerview. If you want to have a look on it visit sortabletableview.com.

With this new table it's also possible to have one data adpater per column. Which makes you code much cleaner and improves reusability. It also imports new features like selection and others.

SortableTableView

Best regards,
Ingo

from sortabletableview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.