Closed GraxCode closed 2 years ago
Will be added
I just checked. There are some constructors for your use case. subtitleText can be null.
constructor(
@DrawableRes drawableRes: Int,
titleText: String,
subtitleText: String? = null,
longClickListener: OptionLongClickListener? = null
) : this() {
this.drawableRes = drawableRes
this.titleText = titleText
this.subtitleText = subtitleText
this.longClickListener = longClickListener
}
constructor(
drawable: Drawable,
@StringRes titleTextRes: Int,
subtitleText: String? = null,
longClickListener: OptionLongClickListener? = null
) : this() {
this.drawable = drawable
this.titleTextRes = titleTextRes
this.subtitleText = subtitleText
this.longClickListener = longClickListener
}
So your call would look something like this:
Option(R.drawable.icon, "Title of the option") { /* onLongClick */ }
Can't find a constructor that allows specifying a long click listener without a subtitle text.