android10 / Android-CleanArchitecture

This is a sample app that is part of a series of blog posts I have written about how to architect an android application using Uncle Bob's clean architecture approach.
Apache License 2.0
15.49k stars 3.32k forks source link

how can a int value be injected without @Provides annotation #244

Open vinci2015 opened 6 years ago

vinci2015 commented 6 years ago

@Inject public GetUserDetails(int userId, UserRepository userRepository, ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) { super(threadExecutor, postExecutionThread); this.userId = userId; this.userRepository = userRepository; } with the code abouve, i find no place where provide a int value which is annnotated with @provides,anyone helps?

pratamawijaya commented 6 years ago

you can use inner class 'Param' and set the useId right there,

check these https://github.com/android10/Android-CleanArchitecture/blob/master/domain/src/main/java/com/fernandocejas/android10/sample/domain/interactor/GetUserDetails.java