I am trying to add a new activity it is giving me error on this please help !
`
@module
class SignupActivityModule {
@provides
internal fun provideSignupInteractor(interactor: SignupInteractor): SignupMVPInteractor = interactor
@Provides
internal fun provideSignupPresenter(presenter: SignupPresenter<SignupMVPView,SignupMVPInteractor>)
: SignupMVPPresenter<SignupMVPView, SignupMVPInteractor> = presenter
}
interface SignupMVPView : MVPView {
fun showValidationMessage(errorCode: Int)
fun openMainActivity()
fun showResponseToast(response:String)
}
class SignupActivity : BaseActivity(), SignupMVPView {
@Inject
internal lateinit var presenter: SignupMVPPresenter<SignupMVPView, SignupMVPInteractor>
override fun showResponseToast(response: String) {
toast(message = response)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_signup)
presenter.onAttach(this)
}
override fun onDestroy() {
presenter.onDetach()
super.onDestroy()
}
override fun showValidationMessage(errorCode: Int) {
}
override fun openMainActivity() {
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
override fun onFragmentAttached() {
}
override fun onFragmentDetached(tag: String) {
}
fun toast(message: CharSequence) =
Toast.makeText(this@SignupActivity, message, Toast.LENGTH_SHORT).show()
}
class SignupPresenter<V : SignupMVPView, I : SignupMVPInteractor> @Inject internal constructor(interactor: I, schedulerProvider: SchedulerProvider, disposable: CompositeDisposable) : BasePresenter<V, I>(interactor = interactor, schedulerProvider = schedulerProvider, compositeDisposable = disposable), SignupMVPPresenter<V, I> {
override fun onServerSignupClicked(username: String, password: String, confirmPassword: String, fullName: String, phone: String, role: String) {
when {
username.isEmpty() -> getView()?.showValidationMessage(AppConstants.EMPTY_EMAIL_ERROR)
password.isEmpty() -> getView()?.showValidationMessage(AppConstants.EMPTY_PASSWORD_ERROR)
else -> {
getView()?.showProgress()
interactor?.let {
compositeDisposable.add(it.doServerSignupApiCall(username, password, confirmPassword, fullName, phone, role)
.compose(schedulerProvider.ioToMainObservableScheduler())
.subscribe({ loginResponse ->
getView()?.showResponseToast(loginResponse.message!!)
}, { err -> println(err) }))
}}}}}
interface SignupMVPPresenter<V : SignupMVPView, I : SignupMVPInteractor> : MVPPresenter<V, I> {
fun onServerSignupClicked(username: String, password: String, confirmPassword: String, fullName: String, phone: String, role: String)
}
interface SignupMVPInteractor : MVPInteractor {
fun doServerSignupApiCall(username: String, password: String, confirmPassword: String, fullName: String, phone: String, role: String): Observable
}
class SignupInteractor @Inject internal constructor(preferenceHelper: PreferenceHelper, apiHelper: ApiHelper) : BaseInteractor(preferenceHelper, apiHelper), SignupMVPInteractor {
override fun doServerSignupApiCall(username: String, password: String,
confirmPassword: String, fullName: String,
phone: String, role: String) =
apiHelper.performServerSignup(SignupRequest.ServerSignupRequest(username = username,
password = password, confirPassword = confirmPassword, fullName = fullName,
phone = phone, role = role))
}`
I am following same as login but getting error in activity builder
`@Module
abstract class ActivityBuilder {
@ContributesAndroidInjector(modules = [(SplashActivityModule::class)])
abstract fun bindSplashActivity(): SplashMVPActivity
@ContributesAndroidInjector(modules = [(SignupActivity::class)])
abstract fun bindSignupActivity(): SignupActivity
@ContributesAndroidInjector(modules = [(MainActivityModule::class), (RateUsDialogFragmentProvider::class), (AboutFragmentProvider::class)])
abstract fun bindMainActivity(): MainActivity
@ContributesAndroidInjector(modules = [(LoginActivityModule::class)])
abstract fun bindLoginActivity(): LoginActivity
@ContributesAndroidInjector(modules = [(BlogFragmentProvider::class), (OpenSourceFragmentProvider::class)])
abstract fun bindFeedActivity(): FeedActivity}`
I am getting this error
di\builder\ActivityBuilder.java:17: error: .ui.signup.view.SignupActivity is not a @module
@dagger.android.ContributesAndroidInjector(modules = {.ui.signup.view.SignupActivity.class})
^
code is in png images also