Giter VIP home page Giter VIP logo

Comments (18)

BraisGabin avatar BraisGabin commented on July 20, 2024

It can not and has an explanation. If you have a table of 1000 rows and 5 columns would be necessary to measure 5000 views.

Could be implemented, but the computation time makes it impractical.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

How long will it take to implement as it will be really good if this feature is available?

from tablefixheaders.

MariuszGSL avatar MariuszGSL commented on July 20, 2024

I agree with BraisGabin that it would be totally impractical to adjust the column widths automatically, given the potentially large number of records in the table. This could slow down the display to a crawl with a detriment to the functionality of this fantastic data display tool.
A much better solution would be to allow users to manually adjust the width of each column, either through external settings, or by dragging left/right the right edge of the column header (similar to the feature implemented in Excel). I have seen it done in the Windows Mobile 6.5 table/grid application.

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

The implementation of this feature is not hard. It will not take a lot of time but it is not efficient at all. I think @MariuszGSL proposals may be a good choice.

If you keep wanting to implement it I can give you some clues.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

I also think that @MariuszGSL proposal would be good, if you can give me some clues on how to implement it that would be great. Thanks.

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

I meant clues for implementing the "bad" version.

Anyway you only need to use Adapter.notifyDataSetChanged() and the Adapter.getWidth(int position) to implement the @MariuszGSL proposal.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

And do I have to put that in the StyleTable class or somewhere in the TableFixHeaders library?

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

No need to touch the library for this. You have to control in some way the events on the edges. Can not think of what may be the best way to do this.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

Ok, I will have a look around and see if I can come up with anything.

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

Open a new issue in this case, plase.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

Ok, If I do come up with anything I will open a new issue, Thanks.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

Hey, are you able to give me some clues on how to implement the "bad" version as discussed above please?

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

Of course. All the work is in the onMeasure. Line 477.

You must create all the adapter's views and call

view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));

Then get the maximums and replace this information in the lines 490-497

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

I have entered the above method in the correct place, but I am not sure what to enter in lines 490-497? I have left those lines the same and the app runs but there is no horizontal scrolling, should I alter those lines and put the above method in?

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

you must remove those and fill the arrays widths and heights with the maximums.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

This might be a really stupid question but what do you mean by maximums? Are you able to provide me with a example about filling the arrays widths and heights please?

from tablefixheaders.

BraisGabin avatar BraisGabin commented on July 20, 2024

I think you need to read the documentation about the custom views:

http://developer.android.com/reference/android/view/View.html The size and layout paragraphs are the more important.

You have to measure the views of each column. Choose the maximum onMeasureWidth() and put that value the corresponding position in the array widths.

from tablefixheaders.

ashx1 avatar ashx1 commented on July 20, 2024

Thanks very much for all your help, really appreciated.

from tablefixheaders.

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.