feat: open stat in new window

This commit is contained in:
rebelonion
2024-03-04 18:26:12 -06:00
parent 49dc9d55b5
commit d181dcf837
7 changed files with 88 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
package ani.dantotsu.profile
import android.content.Intent
import android.view.View
import ani.dantotsu.R
import ani.dantotsu.databinding.ItemChartBinding
@@ -8,12 +9,19 @@ import com.xwray.groupie.viewbinding.BindableItem
class ChartItem(
private val title: String,
private val aaOptions: AAOptions): BindableItem<ItemChartBinding>() {
private val aaOptions: AAOptions,
private val activity: ProfileActivity): 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)
binding.openButton.setOnClickListener {
SingleStatActivity.chartOptions = aaOptions
activity.startActivity(
Intent(activity, SingleStatActivity::class.java)
)
}
}
override fun getLayout(): Int {