Coder Social home page Coder Social logo

Comments (9)

Sineth-N avatar Sineth-N commented on July 17, 2024 2

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.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

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.

JulienDev avatar JulienDev commented on July 17, 2024

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.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

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.

JulienDev avatar JulienDev commented on July 17, 2024

Sorry for the delay, it works fine :)
Thanks !

from sortabletableview.

CoolCommando avatar CoolCommando commented on July 17, 2024

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.

Sineth-N avatar Sineth-N commented on July 17, 2024

I'm afraid that I too see the exact same issue as well.
I did what is explained by @CoolCommando . Check the screenshot please

device-2017-01-28-131223

from sortabletableview.

ISchwarz23 avatar ISchwarz23 commented on July 17, 2024

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.

softwaresunleashed avatar softwaresunleashed commented on July 17, 2024

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)

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.