ExpandableStackViewAdapter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExpandableStackViewAdapter( | |
private val models: List<String>, | |
private val context: Context | |
) : BaseAdapter() { | |
override fun getCount(): Int = models.size | |
override fun getItem(position: Int): String = models[position] | |
override fun getItemId(position: Int): Long = position.toLong() | |
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { | |
val view = LayoutInflater.from(context).inflate(R.layout.card, parent, false) | |
view.findViewById<AppCompatTextView>(R.id.text).text = position.toString() | |
return view | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment