Giter Site home page Giter Site logo

Comments (16)

evrencoskun avatar evrencoskun commented on May 22, 2024 1

Do you have the below lines on your TableViewAdapter ? If you don't have. Please check the sample TableViewAdapter

     // It is necessary to remeasure itself.
     viewHolder.cell_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
     viewHolder.cell_textview.requestLayout();

It shouldn't be necessary to call notifyDataSetChanged

And Which version are you using ?

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

Yeah,I check the code,it include that lines;
the version is 0.8.3;

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

I check the source code,In the ColumnLayoutManager.java,method measureChild(),when the column width not equal to cell width at the first time,it did not call the line:
fb1f0eca-552e-4d94-9d0f-0cf08b75a18e

from tableview.

evrencoskun avatar evrencoskun commented on May 22, 2024

m_nLastDx value will be '0' for first population process. So

if shouldFitColumns control returns true, then the below line will be called.

m_iCellLayoutManager.fitWidthSize(nPosition, false);

when the column width not equal to cell width at the first time,it did not call the line:

You can check shouldFitColumns control. If it is necessary to fit column width values, it calls at end of visible row index.

Anyway, Can you try the below codes instead using Observable.timer

tableView.getCellLayoutManager.fitWidthSize(false);

After that if you still got the same problem. Please try that;

// Force remeasure each cell header views
tableView.getColumnHeaderLayoutManager.customRequestLayout();
// Recalculate all of column width values.
`tableView.getCellLayoutManager.fitWidthSize(false);`

I will check your case on my leisure time.

See you

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

Hi,Thank you for your reply!
I use the below codes instead using Observer.timer
2017-12-28 9 11 57
and the tableview will show normal,but it will shake like that:
ezgif com-video-to-gif

from tableview.

evrencoskun avatar evrencoskun commented on May 22, 2024

Hi,
It's shaking that's because of your post runnable
Because, It goes into the main thread queue and gets executed after the other pending tasks are finished.

Let's try the below codes without using any thread process.

// Force remeasure each cell header views
tableView.getColumnHeaderLayoutManager.customRequestLayout();
// Recalculate all of column width values.
`tableView.getCellLayoutManager.fitWidthSize(false);

And let me know the result.

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

I have try he below codes without using any thread process:
2017-12-28 2 43 01
but it will cause NullPointerException:
2017-12-28 2 45 12

from tableview.

evrencoskun avatar evrencoskun commented on May 22, 2024

Can you share your TableView model with me ? I want to test your case with your model.

Actually I don't have time for this now. But, I will do that at least 8 hours later.

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

I upload the project to the dropbox,you can download the project and check that,Thanks!!
https://www.dropbox.com/s/zrjtgcxsdoytnwn/TableView-master.zip?dl=0
and I think I found the reason why the tableview show abnormality at the first time,because it did not got focus in the beginning;

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

Hi,did you try the sample code?

from tableview.

evrencoskun avatar evrencoskun commented on May 22, 2024

Hello,

Unfortunately, I haven't tried your code yet because of the celebration of new year. However, You can be sure that, in my first leisure time, I'll check it on.

Have a nice day.

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

OK,Thank you very much and wish you Happy new year!!

from tableview.

evrencoskun avatar evrencoskun commented on May 22, 2024

Happy new year to you, too! :)

from tableview.

evrencoskun avatar evrencoskun commented on May 22, 2024

Hi,
The link seems broken. Could you fix it ?

Thanks.

from tableview.

spd-heshuip avatar spd-heshuip commented on May 22, 2024

please try this:
https://www.dropbox.com/s/zrjtgcxsdoytnwn/TableView-master.zip?dl=0

from tableview.

evrencoskun avatar evrencoskun commented on May 22, 2024

I have tested your codes.

My first observation on your code, when I change

m_iTableView.postDelayed(new Runnable() {
            @Override
            public void run() {
                mStatusLayout.showContent();
            }
        }, 3000);

with

mStatusLayout.showContent();

It works perfectly.

However, let's assume you need to above lines and don't want to change it. At that time, I realised that you modified the TableView codes.

When I use the 0.8.5.1 version instead of yours, It works perfectly, even though using the above lines.

If you don't want to horizontal lines of the TableView

you can use app:show_horizontal_separator="false" like this:

 <com.evrencoskun.tableview.TableView
        android:id="@+id/tableView"
        android:layout_width="match_parent"
        app:show_horizontal_separator="false"
   ....
  >

After that, you can insert a line view both your column header layout and corner layout like I do on the sample app.

Well, why does your modified TableView have got this bug ?

Because, on CellLayoutManager

    // This below lines is for populating for the first time like fetching all data to display.
            // It shouldn't be worked when it is scrolling horizontally ."getLastDx() == 0"
            // control for it.
        } else if (m_iCellRecyclerView.getScrollState() == RecyclerView.SCROLL_STATE_IDLE &&
                childLayoutManager.getLastDx() == 0) {

            if (childLayoutManager.isNeedFit()) {
                m_bNeedFit = true;

                // all columns have been fitted.
                childLayoutManager.clearNeedFit();
            }

            if (m_bNeedFit) {
                // for the first time to populate adapter
                if (m_jRowHeaderLayoutManager.findLastVisibleItemPosition() == nPosition) {

                    // The below line helps to change left & right value of the each column
                    // header views
                    // without using requestLayout().
                    m_iColumnHeaderLayoutManager.customRequestLayout();

                    fitWidthSize(false);
                    Log.e(LOG_TAG, nPosition + " fitWidthSize populating data for the first time");

                    m_bNeedFit = false;
                }
            }
        }

Something you did causes on this control, m_jRowHeaderLayoutManager.findLastVisibleItemPosition()
returns -1 .

I strongly recommend to you use the latest version without doing any modify.

from tableview.

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.