Comments (16)
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.
Yeah,I check the code,it include that lines;
the version is 0.8.3;
from tableview.
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:
from tableview.
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.
Hi,Thank you for your reply!
I use the below codes instead using Observer.timer
and the tableview will show normal,but it will shake like that:
from tableview.
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.
I have try he below codes without using any thread process:
but it will cause NullPointerException:
from tableview.
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.
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.
Hi,did you try the sample code?
from tableview.
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.
OK,Thank you very much and wish you Happy new year!!
from tableview.
Happy new year to you, too! :)
from tableview.
Hi,
The link seems broken. Could you fix it ?
Thanks.
from tableview.
please try this:
https://www.dropbox.com/s/zrjtgcxsdoytnwn/TableView-master.zip?dl=0
from tableview.
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)
- java.lang.IndexOutOfBoundsException in setRowHeaderItems HOT 1
- Help HOT 1
- Set a default void implementation on Cell, HeaderCell, RowCell event listeners
- onCellClicked returns correct cellView but incorrect row after sorting HOT 4
- cellviewholder with edit Text is not working after scroll
- How to color the whole row when selecting a cell??
- Column header not match cell when to reload HOT 1
- Forcing sticky column header
- Wrong number of cells in a row crashes
- setColumnWidth function is buggy when implemented in dialog fragment
- I wonder how to exchange rows and columns
- Implement performClick in cellRecyclerView and etc
- Multiline text in cells HOT 1
- how to filter in rowheader / cornerview
- while building -Failed to resolve: com.evrencoskun.library:tableview:0.8.9.4 HOT 2
- Help needed for configurating in build.gradle.kts
- The column width follows the adapter that was first opened
- add(Cell) causing mis alignment align
- I have created the table and i have put an edit text and some text views when i try to click the edit text to write it goes to the first item in the table
- Add Datagrid Support for Kotlin Multiplatform
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tableview.