Commit 874ae7e4 authored by Aniket Singh's avatar Aniket Singh

minor changes in dagger

parent 571f80bf
package chat.rocket.android.createChannel.addMembers.di
import chat.rocket.android.createChannel.addMembers.ui.AddMembersActivity
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class AddMembersProvider {
@ContributesAndroidInjector(modules = [AddMembersModule::class])
abstract fun provideNewChannelActivity(): AddMembersActivity
}
\ No newline at end of file
......@@ -2,7 +2,9 @@ package chat.rocket.android.createChannel.di
import android.arch.lifecycle.LifecycleOwner
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.createChannel.presentation.CreateNewChannelView
import chat.rocket.android.createChannel.ui.CreateNewChannelActivity
import chat.rocket.android.dagger.scope.PerActivity
import dagger.Module
import dagger.Provides
import kotlinx.coroutines.experimental.Job
......@@ -14,6 +16,12 @@ class CreateNewChannelModule {
return activity
}
@Provides
@PerActivity
fun createChannelView(activity: CreateNewChannelActivity): CreateNewChannelView {
return activity
}
@Provides
fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy {
return CancelStrategy(owner, jobs)
......
......@@ -12,6 +12,7 @@ import chat.rocket.android.chatroom.di.PinnedMessagesFragmentProvider
import chat.rocket.android.chatroom.ui.ChatRoomActivity
import chat.rocket.android.chatroom.ui.PinnedMessagesActivity
import chat.rocket.android.chatrooms.di.ChatRoomsFragmentProvider
import chat.rocket.android.createChannel.di.CreateNewChannelModule
import chat.rocket.android.createChannel.di.CreateNewChannelProvider
import chat.rocket.android.createChannel.ui.CreateNewChannelActivity
import chat.rocket.android.dagger.scope.PerActivity
......@@ -63,7 +64,7 @@ abstract class ActivityBuilder {
abstract fun bindChangeServerActivity(): ChangeServerActivity
@PerActivity
@ContributesAndroidInjector(modules = [CreateNewChannelProvider::class])
@ContributesAndroidInjector(modules = [CreateNewChannelModule::class])
abstract fun bindCreateNewChannelActivity(): CreateNewChannelActivity
}
\ No newline at end of file
......@@ -11,8 +11,6 @@ import android.view.MenuItem
import android.view.View
import chat.rocket.android.BuildConfig
import chat.rocket.android.R
import chat.rocket.android.authentication.ui.AuthenticationActivity
import chat.rocket.android.main.adapter.AccountSelector
import chat.rocket.android.main.adapter.Selector
import chat.rocket.android.main.adapter.AccountsAdapter
import chat.rocket.android.main.presentation.MainPresenter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment