SortableTableView
SortableTableView copied to clipboard
Records are not showing using Kotlin
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.