Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active February 1, 2021 14:56
Show Gist options
  • Save akexorcist/5670d25f87c265a3d4aacd47500c0abb to your computer and use it in GitHub Desktop.
Save akexorcist/5670d25f87c265a3d4aacd47500c0abb to your computer and use it in GitHub Desktop.
Build Coupon UI - Prepare the class
class CouponLayout : FrameLayout {
constructor(context: Context) : super(context) {
setup(context, null, 0)
}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
setup(context, attrs, 0)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
setup(context, attrs, defStyleAttr)
}
private fun setup(attrs: AttributeSet?, defStyleAttr: Int) {
setWillNotDraw(false)
// Do something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment