Rework injection of monarchy instances (introduce disk and memory)

This commit is contained in:
ganfra
2018-11-26 17:09:49 +01:00
parent 660ba5436b
commit af79e1d0b5
17 changed files with 136 additions and 101 deletions

View File

@ -28,8 +28,7 @@ class HomeModule(private val homeActivity: HomeActivity) : Module {
TextItemFactory()
}
factory {
val roomId = it.get(0) as String
factory { (roomId: String) ->
TimelineEventController(roomId, get(), get(), get())
}

View File

@ -22,7 +22,7 @@ import im.vector.riotredesign.features.home.AvatarRenderer
import im.vector.riotredesign.features.home.room.detail.timeline.TimelineEventController
import kotlinx.android.synthetic.main.fragment_room_detail.*
import org.koin.android.ext.android.inject
import org.koin.core.parameter.ParameterList
import org.koin.core.parameter.parametersOf
class RoomDetailFragment : RiotFragment() {
@ -40,7 +40,7 @@ class RoomDetailFragment : RiotFragment() {
private val currentSession = matrix.currentSession
private var roomId: String by UnsafeFragmentArgumentDelegate()
private var eventId: String? by FragmentArgumentDelegate()
private val timelineEventController by inject<TimelineEventController>(parameters = { ParameterList(roomId) })
private val timelineEventController by inject<TimelineEventController> { parametersOf(roomId) }
private lateinit var room: Room
private lateinit var scrollOnNewMessageCallback: ScrollOnNewMessageCallback