| | |
| | | import androidx.cardview.widget.CardView |
| | | import androidx.recyclerview.widget.RecyclerView |
| | | import com.example.firstapp.R |
| | | import com.example.firstapp.entity.CardData |
| | | import com.example.firstapp.model.CardData |
| | | |
| | | |
| | | class CardAdapter(private val cardList: List<CardData>, |
| | |
| | | holder.firstMonthTag.text = data.firstMonthTag |
| | | holder.titleText.text = data.title |
| | | holder.subTitleText.text = data.subTitle |
| | | holder.priceText.text = data.price |
| | | holder.priceText.text = data.price.toString() |
| | | holder.nextPriceText.text = data.nextPrice |
| | | holder.autoRenewText.text = data.autoRenew |
| | | |
| | |
| | | val data = cardList[position] as CardData.Yearly |
| | | holder.discountTag.text = data.discountTag |
| | | holder.titleText.text = data.title |
| | | holder.priceText.text = data.price |
| | | holder.originalPriceText.text = data.originalPrice |
| | | holder.priceText.text = data.price.toString() |
| | | holder.originalPriceText.text = data.originalPrice.toString() |
| | | |
| | | // 设置中划线 |
| | | val paint = holder.originalPriceText.paint |
| | |
| | | is SingleMonthViewHolder -> { |
| | | val data = cardList[position] as CardData.SingleMonth |
| | | holder.titleText.text = data.title |
| | | holder.priceText.text = data.price |
| | | holder.priceText.text = data.price.toString() |
| | | |
| | | cardViewList.add(holder.cardView) |
| | | |