evrencoskun / tableview Goto Github PK
View Code? Open in Web Editor NEWTableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
License: MIT License
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
License: MIT License
Function onRowClicked just like onItemClick of ListView.
thanks
Hello,
Firstly let me thank you for putting together this lovely example. I've been trying a lot of options with lot of different approaches none of them work as smooth as your approach.
Once extension to current example is I wanted to be able toggle visibility of the rows. What would be the best way of doing it. One solution I've thought about is is modifying "TableViewAdapter" to have a hashmap of hiddenRows
which is a lookup of Integer {corresponding to row indicies}. And then use setVisibility
on respective sections of onBindCellViewHolder
and onBindRowHeaderViewHolder
. This works at theoretical level, but it chunks/truncates random row headers. Can you suggest what would be the approach you'd take on this one?
Thank you once again.
With my Code i can create the Corner, Column Header and Row header however I can't create the cells. The onCreateCellViewHolder won't be called.
My Layouts and Holders are the same as in the sample app.
My Adapter:
`public class TVAdapterTimetable extends AbstractTableAdapter<ColumnHeader, RowHeader, Cell> {
public TVAdapterTimetable(Context context) {
super(context);
}
@Override
public RecyclerView.ViewHolder onCreateCellViewHolder(ViewGroup parent, int viewType) {
System.out.println("Create Cell View Holder...");
// Get cell xml layout
View layout = LayoutInflater.from(mContext).inflate(R.layout.table_view_cell_layout,
parent, false);
// Create a Custom ViewHolder for a Cell item.
return new CellViewHolder(layout);
}
@Override
public void onBindCellViewHolder(AbstractViewHolder holder, Object cellItemModel, int
columnPosition, int rowPosition) {
Cell cell = (Cell) cellItemModel;
System.out.println("Set Attributes for the Cell");
// Get the holder to update cell item text
CellViewHolder viewHolder = (CellViewHolder) holder;
viewHolder.cell_textview.setText(cell.getData().toString());
// If your TableView should have auto resize for cells & columns.
// Then you should consider the below lines. Otherwise, you can ignore them.
// It is necessary to remeasure itself.
viewHolder.itemView.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
viewHolder.cell_textview.requestLayout();
}
@Override
public RecyclerView.ViewHolder onCreateColumnHeaderViewHolder(ViewGroup parent, int viewType) {
System.out.println("Create ColumnHeader View Holder...");
// Get Column Header xml Layout
View layout = LayoutInflater.from(mContext).inflate(R.layout
.table_view_column_header_layout, parent, false);
// Create a ColumnHeader ViewHolder
return new ColumnHeaderViewHolder(layout, getTableView());
}
@Override
public void onBindColumnHeaderViewHolder(AbstractViewHolder holder, Object columnHeaderItemModel, int
position) {
ColumnHeader columnHeader = (ColumnHeader) columnHeaderItemModel;
// Get the holder to update cell item text
ColumnHeaderViewHolder columnHeaderViewHolder = (ColumnHeaderViewHolder) holder;
columnHeaderViewHolder.column_header_textview.setText(columnHeader.getData().toString());
// If your TableView should have auto resize for cells & columns.
// Then you should consider the below lines. Otherwise, you can ignore them.
// It is necessary to remeasure itself.
columnHeaderViewHolder.column_header_container.getLayoutParams().width = LinearLayout
.LayoutParams.WRAP_CONTENT;
columnHeaderViewHolder.column_header_textview.requestLayout();
}
@Override
public RecyclerView.ViewHolder onCreateRowHeaderViewHolder(ViewGroup parent, int viewType) {
// Get Row Header xml Layout
View layout = LayoutInflater.from(mContext).inflate(R.layout
.table_view_row_header_layout, parent, false);
// Create a Row Header ViewHolder
return new RowHeaderViewHolder(layout);
}
@Override
public void onBindRowHeaderViewHolder(AbstractViewHolder holder, Object rowHeaderItemModel, int
position) {
RowHeader rowHeader = (RowHeader) rowHeaderItemModel;
// Get the holder to update row header item text
RowHeaderViewHolder rowHeaderViewHolder = (RowHeaderViewHolder) holder;
rowHeaderViewHolder.row_header_textview.setText(rowHeader.getData().toString());
}
@Override
public View onCreateCornerView() {
// Get Corner xml layout
return LayoutInflater.from(mContext).inflate(R.layout.table_view_corner_layout, null);
}
@Override
public int getColumnHeaderItemViewType(int columnPosition) {
// The unique ID for this type of column header item
// If you have different items for Cell View by X (Column) position,
// then you should fill this method to be able create different
// type of CellViewHolder on "onCreateCellViewHolder"
return 0;
}
@Override
public int getRowHeaderItemViewType(int rowPosition) {
// The unique ID for this type of row header item
// If you have different items for Row Header View by Y (Row) position,
// then you should fill this method to be able create different
// type of RowHeaderViewHolder on "onCreateRowHeaderViewHolder"
return 0;
}
@Override
public int getCellItemViewType(int columnPosition) {
// The unique ID for this type of cell item
// If you have different items for Cell View by X (Column) position,
// then you should fill this method to be able create different
// type of CellViewHolder on "onCreateCellViewHolder"
return 0;
}
}
`
There is no "Create Cell View Holder..." and i always get this message:
02-28 16:34:02.954 2676-2676/de.tk.annapp W/View: requestLayout() improperly called by com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView{6b3989d VFED..... ......I. 0,98-0,98 #62} during layout: running second layout pass
Table view cell gets distorted when changing orientation from portrait to landscape
Is there any method available to hide columns?
"Thank you for the TableView!I feel bad to add data to the view cell by cell. Could do this job line by line?
Thanks @ZhangXinmin528
Could you explain in more detail ?
Hi again, this issue is completely unrelated to any extended feature (row/column hiding/showing, scrollingTo row/column, sorting, filtering or pagination) of the TableView. This happens when the TableView is scrolled too fast to the right. The data of cells can all be strings or in my case, there are cells that displays a drawable.
One thing I can suggest is to use setItemViewCacheSize(int size)
method of the RecyclerView for the data cells to preserve the layout and data of "offscreen views". The size to be set should be the number of items in the adapter.
Once again, no pressure, take your time man. I just want to help in improving your library.
I think for support widely Android devices it will be very great to manipulate or extends your beautiful ,new and useful table view to support API+15, and as question ,Is it in your plan and if yes when?
The sort functionality works great but when paging is enabled, only the items of the selected page are sorted when you sort a column but sometimes a user might want to sort all items of that column. Is this possible right now?
Thanks.
As of now i have to provide the tableView a corner layout, and row headers which i don't need in some cases. I just want my column headers only which i can populate from my datasets. Can this be done or is there any way to hide the row headers and corner layout ?
Thanks.
On version 0.8.5.1 this issue was not, but when I updated library version to 0.8.5.5 I had encountered this problem.
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v7.widget.RecyclerView$Adapter com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView.getAdapter()' on a null object reference
at com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerViewAdapter.notifyCellDataSetChanged(CellRecyclerViewAdapter.java:173)
at com.evrencoskun.tableview.adapter.AbstractTableAdapter.notifyDataSetChanged(AbstractTableAdapter.java:232)
Hi,
thanks for this awesome library. However, I believe Row Header should be sortable, cause most of the time the first column of a dataset is the actual row header.
Merhaba,
Tableview projenizde çoklu seçim var mıdır acaba? yada yapılabilir mi?
Hi I would like to share this feature that I am currently working on for the TableView which is pagination, currently the pagination works fine for basic data loading, but I still continue to fix conflicting issues with sorting and filtering.
I was trying you demo app and when i scroll table view vertically it judders (it doesn't move smoothly) when i try to get to bottom of table really quickly. I tried using setHasFixedWidth() but it didnt help. Is this known issue ?
We are developing new app(not released yet)
While searching found TableView and it is very interesting and matching our usecase.
While testing with TableView
We are getting NPE when we try to tap on empty table for second time.
E/RecyclerView: No adapter attached; skipping layout
I/View: Key up dispatch to android.support.v7.widget.AppCompatEditText{8e559f9 VFED..CL. .F...... 0,0-166,140 #7f0900f4 app:id/registered_farmer_id}, event = KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x68, repeatCount=0, eventTime=475379957, downTime=475379866, deviceId=-1, source=0x101 }
E/CellRecyclerView: mIsVerticalScrollListenerRemoved has been tried to remove itself before add new one
E/CellRecyclerView: mIsVerticalScrollListenerRemoved has been tried to remove itself before add new one
E/InputEventReceiver: Exception dispatching input event.
E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI: java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v7.widget.RecyclerView$ViewHolder com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView.findViewHolderForAdapterPosition(int)' on a null object reference
at com.evrencoskun.tableview.layoutmanager.CellLayoutManager.getVisibleCellViewsByColumnPosition(CellLayoutManager.java:432)
at com.evrencoskun.tableview.handler.SelectionHandler.changeVisibleCellViewsBackgroundForColumn(SelectionHandler.java:320)
at com.evrencoskun.tableview.handler.SelectionHandler.selectedColumnHeader(SelectionHandler.java:221)
at com.evrencoskun.tableview.handler.SelectionHandler.setSelectedColumnPosition(SelectionHandler.java:75)
at com.evrencoskun.tableview.listener.itemclick.ColumnHeaderRecyclerViewItemClickListener.clickAction(ColumnHeaderRecyclerViewItemClickListener.java:54)
at com.evrencoskun.tableview.listener.itemclick.AbstractItemClickListener.onInterceptTouchEvent(AbstractItemClickListener.java:76)
at android.support.v7.widget.RecyclerView.dispatchOnItemTouch(RecyclerView.java:2771)
at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2899)
at android.view.View.dispatchTouchEvent(View.java:9483)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2665)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2309)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2671)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2323)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2476)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1777)
at android.app.Activity.dispatchTouchEvent(Activity.java:2818)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2437)
at android.view.View.dispatchPointerEvent(View.java:9714)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4861)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4703)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4208)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4261)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4227)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4373)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4235)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4430)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4208)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4261)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4227)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4235)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4208)
at android.view.Vie
ColumnHeaderLongPressPopup.java,line.82 missing something.
When the column number exceeds 15, am getting below given error. Why ?
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.glowsis.glowmetric, PID: 18632 java.lang.ArrayIndexOutOfBoundsException: length=15; index=15 at com.theah64.retrokit.utils.tableview.holder.CellViewHolder.setCellModel(CellViewHolder.java:31) at com.theah64.retrokit.utils.tableview.BaseTableAdapter.onBindCellViewHolder(BaseTableAdapter.java:52) at com.evrencoskun.tableview.adapter.recyclerview.CellRowRecyclerViewAdapter.onBindViewHolder(CellRowRecyclerViewAdapter.java:48) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6508) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6541) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5484) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5750) at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:285) at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:342) at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:358) at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:365) at android.support.v7.widget.GapWorker.run(GapWorker.java:396) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
one question: for your TableView library, how do you scroll to a column say column 20?
Hi @sidharthshah,
It is actually pretty simple. If you checked the source code, you can see TableView occurs from 3 Skilled RecyclerViews.
If you want to scroll horizontally, you can use scrollToPosition
method of LayoutManager.
For example:
int position = 10;
scrollCell(position);
scrollColumnHeader(position);
Below helper methods will be on the new version too. For now, you can insert them on your project.
private void scrollCell(int columnPosition) {
CellLayoutManager cellLayoutManager = tableView.getCellLayoutManager();
for (int i = cellLayoutManager.findFirstVisibleItemPosition(); i < cellLayoutManager
.findLastVisibleItemPosition() + 1; i++) {
ColumnLayoutManager columnLayoutManager = (ColumnLayoutManager) ((RecyclerView)
cellLayoutManager.findViewByPosition(i)).getLayoutManager();
columnLayoutManager.scrollToPosition(columnPosition);
}
}
private void scrollColumnHeader(int columnPosition) {
tableView.getColumnHeaderLayoutManager().scrollToPosition(columnPosition);
}
I use the TableView in the fragment which was added to the ViewPager,and init the TableView when the fragment is visible(lazy load),when I first scroll the TableView,the Column header will shake(I think it is redraw),how should I do to solve this problem?
Hi, will this support column freezing function? Example: like disabling horizontal scrolling on the first column?
I am very appreciate for your hardwork and it is well implemented into my work.
Is there any ways to scroll oblique (horizontal and vertical at the same time), just like below gif
https://raw.githubusercontent.com/Cleveroad/AdaptiveTableLayout/master/images/demo.gif
I found out there is performance issue when scroll to the end , my table is (20 column x 56 row ), the table show some lag until the end, is there any way to adjust the scroll speed just like override "fling" in recycle view like the link below?
Hi dear,
i set a color in cell layout for background but when i run it is still white?
Merhabalar,
Buton click olayı ile açılmasını istediğim sayfa bir fragment ve layout kısmında ayrı bir framelayout a sahibim.
Açılan sayfada doldurulması gereken yerler ve ona göre dolan bir grid görseli olacak.
Şimdi yaptığınız tableview yapısında activity sayfasından bir fragment çağırılmış.
Kendi projeme uyarlayamadım çünkü benim bir tane activity sayfam var sonrasındaki sayfa ilerlemelerim fragment ile bunun üzerine yine bir fragment ten başka fragment a geçtiğim sayfamın görselinde grid e ayırdığım kısmın(framelayout) tableview görseli ile açılması için ne yapabilirim?
Not:Tableview kendi projemde bir grid yapısıdır.
Thanks for answering it
Your work really perfect. It took a long time for understanding, but the result is excellent.
I have a problem with CellHolder. I want to change cell text color for some situations. But I could not. Where I can change cell text color in your sample project?
Thanks.
public void addItemRange(int positionStart, int itemCount, List<T> items) {
if (m_jItemList.size() > positionStart + itemCount && items != null) {
for (int i = positionStart; i < positionStart + itemCount + 1; i++) {
if (i != RecyclerView.NO_POSITION) {
m_jItemList.add(i, items.get(i));
}
}
notifyItemRangeInserted(positionStart, itemCount);
}
}
What i am change is
positionStart is the where to adding the item
itemCount is the total of the New item you want to add,
items is the new list of the item.
public void addItemRange(int positionStart, int itemCount, List<T> items) {
if (m_jItemList.size() >= positionStart && items != null) {
for (int i = positionStart; i < positionStart + itemCount; i++) {
if (i != RecyclerView.NO_POSITION) {
m_jItemList.add(i, items.get(i - positionStart));
}
}
notifyItemRangeInserted(positionStart, itemCount);
}
}
Also there is issue with removeRowRange.
public void deleteItemRange(int positionStart, int itemCount) {
if (m_jItemList.size() >= positionStart + itemCount) {
for (int i = positionStart; i < positionStart + itemCount; i++) {
if (i != RecyclerView.NO_POSITION) {
m_jItemList.remove(positionStart);
}
}
notifyItemRangeRemoved(positionStart, itemCount);
}
}
Do u think it should be remove the Same position not the i because the List getting smaller. otherwise it gonna out of position
Hi!
I encountered following two bugs, when the table has no / empty cell data:
1. the table alignment is not correct
2. following NullPointerException gets thrown when clicking on columnheader
E/InputEventReceiver: Exception dispatching input event.
E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI: java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v7.widget.RecyclerView$ViewHolder com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView.findViewHolderForAdapterPosition(int)' on a null object reference
at com.evrencoskun.tableview.layoutmanager.CellLayoutManager.getVisibleCellViewsByColumnPosition(CellLayoutManager.java:417)
at com.evrencoskun.tableview.handler.SelectionHandler.changeVisibleCellViewsBackgroundForColumn(SelectionHandler.java:291)
at com.evrencoskun.tableview.handler.SelectionHandler.selectedColumnHeader(SelectionHandler.java:191)
at com.evrencoskun.tableview.handler.SelectionHandler.setSelectedColumnPosition(SelectionHandler.java:47)
at com.evrencoskun.tableview.listener.itemclick.ColumnHeaderRecyclerViewItemClickListener.clickAction(ColumnHeaderRecyclerViewItemClickListener.java:37)
at com.evrencoskun.tableview.listener.itemclick.AbstractItemClickListener.onInterceptTouchEvent(AbstractItemClickListener.java:45)
at android.support.v7.widget.RecyclerView.dispatchOnItemTouch(RecyclerView.java:2771)
at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2899)
at android.view.View.dispatchTouchEvent(View.java:11776)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2962)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2643)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:448)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1829)
at android.app.Activity.dispatchTouchEvent(Activity.java:3307)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:410)
at android.view.View.dispatchPointerEvent(View.java:12015)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4795)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4609)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4293)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4350)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
at android.view.ViewRootImpl$InputStage.onDeliv
Expectation: if table view has setIgnoreSelectionColors(true)
, all its views should retain their background colors no matter what.
Problem: column header views change their background color permanently after going offscreen
Steps to reproduce:
setIgnoreSelectionColors(true)
;Why it happens: onViewDetachedFromWindow
handler in ColumnHeaderRecyclerViewAdapter
does not check IsIgnoreSelectionColors()
setting of its table view when changing view's background color. Result: if a column header ever goes offscreen, its background color is changed permanently to "unselected color".
Suggestion: must view's background color even change on detach? It's getting changed in onViewAttachedToWindow
handler already anyway - and with proper IsIgnoreSelectionColors()
check, too. Same for its selected
status.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/cell_line_color">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="200dp"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
>
</FrameLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#ffffff"
/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
</android.support.v4.view.ViewPager>
</android.support.design.widget.CoordinatorLayout>
HI,this is my layout file ,I put the TableView on the fragment,and fragment was added to the ViewPager,now I want to hide the FrameLayout which in the CoordinatorLayout,when scroll the TableView,but it is not work .so what should I do to solve this problem?please help me,Thanks you very much!
Hi!
First of all...thanks for this great library. I encountered following problem:
When the table contains data with different sizes, the cell measurement is not working correctly.
1. Initial call. Cells have same data size.
2. After scrolling down to some larger data the view looks like this
My CellViewHolder:
public class CellViewHolder extends AbstractViewHolder
{
public final TextView textViewCell;
public final LinearLayout cellContainer;
public CellViewHolder(View itemView)
{
super(itemView);
textViewCell = itemView.findViewById(R.id.cell_data);
cellContainer = itemView.findViewById(R.id.cell_container);
}
public void bind(final Cell cell)
{
textViewCell.setText(String.valueOf(cell.getData()));
// If your TableView should have auto resize for cells & columns.
// Then you should consider the below lines. Otherwise, you can ignore them.
// It is necessary to remeasure itself.
cellContainer.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
textViewCell.requestLayout();
}
}
Can you replicate this bug or am i doing something wrong?
Greets
1.Öncelikle kütüphane olarak gradle ile projemize ekleyebilir miyiz?
2. Kolonlara ve satırlara click olayını nasıl yapabiliriz?
Hello,
Thanks for this view. I'm trying to set the column widths so the tableview matching the parent width.
I tried to set the columnheader widths in your example but they are overruled by the cell widths atm. removing the row to set the width at the cell did not work as well.
I think the width of the column header should be the main value. Only when it is set to WRAP_CONTENT it should use the max width of the cells.
What i also love to see is an option that allows the following; By default when the viewtable's layout_width is set to match_parent the last column would be sized to fill the space to the right.
To allow stretching an other column we should introduce a new property named something like "StretchColumn".
Is this easy to implement? I Love to help by i haven't got around yet how everything is working yet.
Hello,
I'm developing a software where I show a table from a DB. The issue is that i have 16 colums to show, but somehow it crashes when it tries to render the last (15) column, the log says that the length is 15 and size too, but doing the debug i find out that my array it is 16; plus it happens at the CellViewHolderModel and TableAdapter. When i comment the last ColumHeaderModel, works fine. I have no clue what is going on actually... i was trying to debug to understand, but no conclusion yet. I wanted to know if there's a limit of colums or is it a bug?
I'll try to figure it out.
Also, i tried to add a new column on the TableViewSampleApp2 that works with fragments and Web Service. Same, it crashes when reaching column 16.
02-28 17:44:22.748 19899-19899/com.gigex.fitosoft.analizador E/AndroidRuntime: FATAL EXCEPTION: main Process: com.gigex.fitosoft.analizador, PID: 19899 java.lang.ArrayIndexOutOfBoundsException: length=15; index=15 at com.gigex.fitosoft.analizador.TableView.holder.CellViewHolder.setCellModel(CellViewHolder.java:30) at com.gigex.fitosoft.analizador.TableView.MyTableAdapter.onBindCellViewHolder(MyTableAdapter.java:53) at com.evrencoskun.tableview.adapter.recyclerview.CellRowRecyclerViewAdapter.onBindViewHolder(CellRowRecyclerViewAdapter.java:48) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6508) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6541) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5484) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5750) at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:285) at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:342) at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:358) at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:365) at android.support.v7.widget.GapWorker.run(GapWorker.java:396) at android.os.Handler.handleCallback(Handler.java:746) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Merhabalar,
Hücrenin click olayında yada en önemlisi satırın click olayında satırda yer alan hücresel verilerin hepsini birden elde edebildiğimiz bir metot? yada veriyi gösteren bir yöntem var mıdır?
How to code for communicating tableview with SQLite?
Merhaba, satır ve sütunda bulunan "on..LongPressed" metodu, hücrede aktif değil (yada ben göremedim). Bu konuyu nasıl halledebilirim?
Error:(53, 69) error: cannot find symbol variable m_jContext
where C is a type-variable:
C extends Object declared in class CellRecyclerViewAdapter
////////////////////////////////////////////////////////
Error:(99, 37) error: cannot find symbol variable m_jItemList
where C is a type-variable:
C extends Object declared in class CellRecyclerViewAdapter
Merhabalar,
Github da bulunan projenizde kütüphaneyi bulamadım projemede ekleyemedim.
Tableview kontrolü projemdeki palette yok.Grid mantığıyla boğuşuyorum bulduğum en iyi proje, bir şekilde adım adım ilerlemek istiyorum.
İlk olarak bir kontrol atayım dedim sonrasında bir kütüphane ihtiyacım mı varki diye araştırmaya koyuldum.Bana yardımcı olabilirseniz sevinirim.
İyi çalışmalar
Hi @evrencoskun , good day! Are you planning on having a port of your library for Kotlin?
Using ITableViewListener
I added a delete button for every record in the table that uses the row index to call removeRow().
After calling removeRow()
though the ITableViewListener
doesn't update the indexes of the table.
So for example
if you remove row 1 it will remove row 1, but if you then try to remove the new first row (originally row 2) it will delete the row after (originally row 3).
I image the same issue exists for removeColumn()
but i haven't tested it
i want to fill table from right to left and horizontal scrolling same way.
Gradle file fail to sync when targeting Oreo. Below is my build.gradle file. The error is 'All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.1.0, 25.3.1. '
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.evrencoskun.library:tableview:0.8.3'
}
Hey,
Is it possible to have cells with different widths inside the table with the column headers?
If I don't set column headers then each call can have a different size but once column headers are added the width becomes fixed.
Is it possible to change this behaviour?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.