Skip to content

Instantly share code, notes, and snippets.

@minibugdev
Last active July 18, 2019 04:43
Show Gist options
  • Save minibugdev/a10a42b8605e9da10e66a0bb6e64e914 to your computer and use it in GitHub Desktop.
Save minibugdev/a10a42b8605e9da10e66a0bb6e64e914 to your computer and use it in GitHub Desktop.
@ModelView(defaultLayout = R.layout.row_image_ratio, fullSpan = false)
class BannerEpoxy @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
@ModelProp
fun setImageUrl(imageUrl: String?) {
Glide.with(imageViewBanner)
.load(imageUrl)
.centerCrop()
.placeholder(R.color.colorPrimary)
.into(imageViewBanner)
}
@CallbackProp
fun clickListener(listener: OnClickListener?) {
setOnClickListener(listener)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment