Skip to content

Records are not showing using Kotlin #205

Open
@alcarazolabs

Description

@alcarazolabs

Hi I implement this library using kotlin however the records are not showing only the headers.

 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
    implementation 'com.github.ISchwarz23:SortableTableView:2.8.1'

layout.xml

  <de.codecrafters.tableview.SortableTableView
                        android:layout_marginTop="5dp"
                        xmlns:table="http://schemas.android.com/apk/res-auto"
                        android:id="@+id/tableView"
                        table:tableView_columnCount="2"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        />

Fragment.kt

 private lateinit var tableViewSalesPerMonth: SortableTableView<Array<String>>
onViewCreated(...){
  tableViewSalesPerMonth = binding.tableView as SortableTableView<Array<String>>
        tableViewSalesPerMonth.headerAdapter = SimpleTableHeaderAdapter(requireContext(),"Mes","Cantidad Ventas")

        var data = arrayOf(arrayOf("may", "33"), arrayOf("jun","32"))
        tableViewSalesPerMonth.dataAdapter = SimpleTableDataAdapter(requireContext(), data)

}

I will appreciate any idea to fix this problem. Thanks so much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions