feat: more charts | code cleanup
This commit is contained in:
parent
2673b7d9bc
commit
7a1ed4f83e
9 changed files with 782 additions and 790 deletions
26
app/src/main/java/ani/dantotsu/profile/ChartItem.kt
Normal file
26
app/src/main/java/ani/dantotsu/profile/ChartItem.kt
Normal file
|
@ -0,0 +1,26 @@
|
|||
package ani.dantotsu.profile
|
||||
|
||||
import android.view.View
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.databinding.ItemChartBinding
|
||||
import com.github.aachartmodel.aainfographics.aachartcreator.AAOptions
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
|
||||
class ChartItem(
|
||||
private val title: String,
|
||||
private val aaOptions: AAOptions): BindableItem<ItemChartBinding>() {
|
||||
private lateinit var binding: ItemChartBinding
|
||||
override fun bind(viewBinding: ItemChartBinding, position: Int) {
|
||||
binding = viewBinding
|
||||
binding.typeText.text = title
|
||||
binding.chartView.aa_drawChartWithChartOptions(aaOptions)
|
||||
}
|
||||
|
||||
override fun getLayout(): Int {
|
||||
return R.layout.item_chart
|
||||
}
|
||||
|
||||
override fun initializeViewBinding(view: View): ItemChartBinding {
|
||||
return ItemChartBinding.bind(view)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue