Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
MovieHunt blog part5. epoxy model custom view sample
@ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
class DropdownItemView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
var itemText: CharSequence? = null
fun selected(selected: Boolean = false) {
textMenuItem.isSelected = selected
var clickListener: OnClickListener? = null
private val textMenuItem: TextView
init {
View.inflate(context, R.layout.item_dropdown_menu, this)
orientation = VERTICAL
textMenuItem = findViewById(
fun userProps() {
textMenuItem.text = itemText
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment