@BindViews(
R.id.keypadview_0,
R.id.keypadview_1,
R.id.keypadview_2,
R.id.keypadview_3,
R.id.keypadview_4,
R.id.keypadview_5,
R.id.keypadview_6,
R.id.keypadview_7,
R.id.keypadview_8,
R.id.keypadview_9
)
lateinit var numberButtons: List<TextView>
Butterknife throws exception @BindViews List or array type must extend from View or be an interface. Workaround is to use kotlin's MutableList or Array."
This is trivial (especially since immutable array works), but it would be nice to support an immutable list in kotlin.
Could you try it with lateinit var numberButtons: List<@JvmSuppressWildcards TextView> and see if that works? My guess is that wildcards are the issue here as they can't be used for arrays or mutable lists.
List<@JvmSuppressWildcards TextView> works!, there's always a Kotlin annotation to the rescue
Just wondering, is @BindViews(...) lateinit var foo: List<View> better for some reason than @BindViews(...) lateinit var foo: Array<View>?
No
On Thu, Aug 10, 2017, 5:45 AM Arek Olek notifications@github.com wrote:
Just wondering, is @BindViews(...) lateinit var foo: List
better
for some reason than @BindViews(...) lateinit var foo: Array? —
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/JakeWharton/butterknife/issues/880#issuecomment-321540601,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEET_XEF4UcojWl1aekefpg1pEE2exks5sWvuDgaJpZM4MHqBi
.
Most helpful comment
Could you try it with
lateinit var numberButtons: List<@JvmSuppressWildcards TextView>and see if that works? My guess is that wildcards are the issue here as they can't be used for arrays or mutable lists.