Comments (9)
Hi @ISchwarz23 ,
I'm testing it on Nougat and it works now YAY!!!.. Awesome work done by you here, keep up the good work mate.... Cheers!!!
from sortabletableview.
I just tested your scenario and it worked for me. I was using this layout file (modification of the activity-main.xml following your description):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="de.codecrafters.tableviewexample.MainActivity">
<de.codecrafters.tableviewexample.SortableCarTableView
android:id="@+id/tableView"
android:layout_width="match_parent"
android:layout_height="match_parent"
custom:columnCount="4"
custom:headerElevation="10"
custom:headerColor="?attr/colorPrimary" />
</LinearLayout>
Can you ensure that the issue is caused by the layout the TableView is in? Or maybe the error is in a different place? Please tell me if you have some new knowledge. I will also do some investigations.
from sortabletableview.
Hi, I was able to reproduce the issue by creating 1 activity : HomeActivity & 2 fragments : HomeFragment & TableFragment
HomeActivity has a FrameLayout container R.id.container
I have 2 scenarios :
- Inside onCreate I add the HomeFragment then when I select the entry menu in my drawerlayout I replace the fragment by TableFragment : Header does not appear. The only way workaround I found is adding the fakeView as explained yesterday.
- Inside onCreate I add the TableFragment : Header does appear
I really don't understand why the issue happens. Some informations about my project:
compileSdkVersion 22
buildToolsVersion "22.0.1"
minSdkVersion 21
targetSdkVersion 22
I use https://github.com/mikepenz/MaterialDrawer
from sortabletableview.
I think that I fixed the issue.
Please try the version 0.9.4 and give some feedback if the issue is really fixed.
from sortabletableview.
Sorry for the delay, it works fine :)
Thanks !
from sortabletableview.
Hi, I have the same/similar problem with the latest version(2.4.1)- Header text does not appear when the SortableTableView is used in a fragment. The header is just a blank space. I can set the Header background color using the sortableTableView.setHeaderBackgroundColor(). No methods in the SimpleTableHeaderAdapter class seem to be working.
Note that if I use the older version- 0.9.4 the the header text does appear.
My code inside the onCreateView of the Fragment:
SimpleTableHeaderAdapter headerAdapter = new SimpleTableHeaderAdapter(mContext, "A", "B", "C", "D");
headerAdapter.setTextColor(Color.parseColor("#000000"));
TableView<String[]> sortableTableView = (TableView<String[]>) rootView.findViewById(R.id.tableView);
sortableTableView.setDataAdapter(new SimpleTableDataAdapter(mContext, DATA_TO_SHOW));
sortableTableView.setColumnCount(4);
sortableTableView.setHeaderBackgroundColor(Color.parseColor("#FFFFFF"));
sortableTableView.setHeaderElevation(10);
sortableTableView.setHeaderAdapter(headerAdapter);
Layout:
<de.codecrafters.tableview.SortableTableView
android:id="@+id/tableView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:background="#dafdea"
/>
Please let me know if I'm doing anything incorrectly.
Thanks,
Sujith
from sortabletableview.
I'm afraid that I too see the exact same issue as well.
I did what is explained by @CoolCommando . Check the screenshot please
from sortabletableview.
Hi @Sineth-N,
could you please try your code with the new TableView version 2.5.0 and report if this issue is fixed?
Best regards,
Ingo
from sortabletableview.
For me , getView() is not being hit....I have put breakpoints and they are not being hit.
Is this a known issue? And hence, my custom data adapter views (TextView) are not being populated
The custom adapter is as follows
public class CountryTableDataAdapter extends TableDataAdapter {
public CountryTableDataAdapter(Context context, List<CountryTableCols> data) {
super(context, data);
}
@Override
public View getCellView(int rowIndex, int columnIndex, ViewGroup parentView) {
CountryTableCols tableCols = getRowData(rowIndex);
View renderedView = null;
RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams
((int) ViewGroup.LayoutParams.MATCH_PARENT,(int) ViewGroup.LayoutParams.MATCH_PARENT);
switch (columnIndex) {
case 0:
renderedView = new TextView(parentView.getContext());
((TextView)renderedView).setText(tableCols.desc);
((TextView)renderedView).setLayoutParams(params);
((TextView)renderedView).setTextColor(getResources().getColor(R.color.black));
((TextView)renderedView).setBackgroundColor(Color.parseColor("#FF0000"));
break;
case 1:
renderedView = new TextView(parentView.getContext());
((TextView)renderedView).setText(tableCols.detail);
((TextView)renderedView).setLayoutParams(params);
((TextView)renderedView).setTextColor(getResources().getColor(R.color.black));
((TextView)renderedView).setBackgroundColor(Color.parseColor("#FF0000"));
break;
}
return renderedView;
}
}
from sortabletableview.
Related Issues (20)
- Apply sorting on date column: HOT 8
- table responsiveness HOT 3
- How do I get the cell content? HOT 1
- "Mark" selected row without using a custom TableView Adapter? HOT 2
- where use simpletabledataadapter#setTextsize HOT 3
- Horizontal Scroll and Vertical Scroll HOT 2
- CheckBox to TableHeaderAdapter HOT 1
- Text alignment in the SortableTableView HOT 1
- Implement custom TableDataRowBackgroundProvider without re-populate table HOT 2
- Table Scrolling HOT 2
- Add footer view HOT 4
- Part of row's background gets white after long click
- inflating class de.codecrafters.tableview.TableView HOT 1
- Merge cells in a row HOT 1
- SortTableView scroll problem
- I want just find solution this. onclickData problem. - read one single cell value. If you can tell tips HOT 3
- Records are not showing using Kotlin
- reference Tableview is null
- onDataClickListener and onDataLongClickListener HOT 2
- Getting Duplicate class found error after adding this dependency HOT 1
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 sortabletableview.