feat: more charts | code cleanup

This commit is contained in:
rebelonion 2024-03-04 00:02:41 -06:00
parent 2673b7d9bc
commit 7a1ed4f83e
9 changed files with 782 additions and 790 deletions

View 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)
}
}