0

trackableCollection is properly injecting in Fragment and Activity that has @AndroidEntryPoint. Now I need to inject this in CustomView but in constructor

@WithFragmentBindings
@AndroidEntryPoint
class TrackableRecyclerView @JvmOverloads constructor(context: Context, attrs: AttributeSet, private val trackableCollection: TrackableCollection = TrackableCollection()) : RecyclerView(context, attrs),
    ITrackableCollection by trackableCollection,
    IPresenceAware by trackableCollection {

}

As IPresenceAware and ITrackableColleciton require trackableCollection

But I am not able to inject trackableCollection to TrackableRecyclerView

Is there any way to pass trackableCollection delegate inside class not on Constructor level.

I want to achieve this but not working in my scenario as my class isn't singleton.

Taimoor Khan
  • 541
  • 4
  • 20

0 Answers0