is there a way I can initialize my arrays in a loop, without them being of nullable items?
d
dknapp
08/01/2018, 1:30 AM
val imageViews: Array<TextView?> = Array(quoteContainers.size) { idx -> quoteContainers[idx].findViewById(R.id.imageView) }
as a first quick and dirty implementation. You'd have to repeat it for each array. you're looping through quote containers 3 times, but it's a pretty small list
dknapp
08/01/2018, 1:31 AM
You'd also have to do a .forEach on container to set the click listeners, too