2019-01-18 10:12:08 +00:00
|
|
|
/*
|
2019-01-25 13:04:59 +00:00
|
|
|
* Copyright 2019 New Vector Ltd
|
2019-01-18 10:12:08 +00:00
|
|
|
*
|
2019-01-25 13:04:59 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2019-01-18 10:12:08 +00:00
|
|
|
*
|
2019-01-25 13:04:59 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2019-01-18 10:12:08 +00:00
|
|
|
*/
|
|
|
|
|
2018-10-28 18:18:14 +00:00
|
|
|
package im.vector.riotredesign.features.home
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
import android.content.Context
|
|
|
|
import im.vector.riotredesign.features.home.group.GroupSummaryController
|
2019-02-19 10:16:31 +00:00
|
|
|
import im.vector.riotredesign.features.home.group.SelectedGroupStore
|
|
|
|
import im.vector.riotredesign.features.home.room.VisibleRoomStore
|
2019-02-26 18:35:47 +00:00
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.CallItemFactory
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.DefaultItemFactory
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.MessageItemFactory
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.RoomHistoryVisibilityItemFactory
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.RoomMemberItemFactory
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.RoomNameItemFactory
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.RoomTopicItemFactory
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.TimelineDateFormatter
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.TimelineEventController
|
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.TimelineItemFactory
|
2019-01-24 17:04:55 +00:00
|
|
|
import im.vector.riotredesign.features.home.room.detail.timeline.helper.TimelineMediaSizeProvider
|
2019-01-29 15:02:42 +00:00
|
|
|
import im.vector.riotredesign.features.home.room.list.RoomSummaryComparator
|
2019-01-29 13:16:22 +00:00
|
|
|
import im.vector.riotredesign.features.home.room.list.RoomSummaryController
|
2019-02-26 18:35:47 +00:00
|
|
|
import im.vector.riotredesign.features.html.EventHtmlRenderer
|
2018-10-28 18:18:14 +00:00
|
|
|
import org.koin.dsl.module.module
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
class HomeModule(context: Context) {
|
2018-10-28 18:18:14 +00:00
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
companion object {
|
|
|
|
const val HOME_SCOPE = "HOME_SCOPE"
|
|
|
|
const val ROOM_DETAIL_SCOPE = "ROOM_DETAIL_SCOPE"
|
|
|
|
const val ROOM_LIST_SCOPE = "ROOM_LIST_SCOPE"
|
|
|
|
const val GROUP_LIST_SCOPE = "GROUP_LIST_SCOPE"
|
|
|
|
}
|
2018-10-28 18:18:14 +00:00
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
val definition = module {
|
|
|
|
|
|
|
|
// Activity scope
|
2019-02-26 18:35:47 +00:00
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
2018-11-02 10:50:56 +00:00
|
|
|
TimelineDateFormatter(get())
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
|
|
|
HomeNavigator()
|
2019-02-25 14:18:36 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
|
|
|
HomePermalinkHandler(get())
|
2018-11-02 16:37:37 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
2019-01-15 14:47:03 +00:00
|
|
|
RoomNameItemFactory(get())
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
2019-01-15 14:47:03 +00:00
|
|
|
RoomTopicItemFactory(get())
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
2019-01-15 14:47:03 +00:00
|
|
|
RoomMemberItemFactory(get())
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
2019-02-20 14:47:20 +00:00
|
|
|
CallItemFactory(get())
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
2019-02-20 11:06:33 +00:00
|
|
|
RoomHistoryVisibilityItemFactory(get())
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
2019-01-15 14:47:03 +00:00
|
|
|
DefaultItemFactory()
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
|
|
|
TimelineMediaSizeProvider()
|
2018-12-20 14:44:01 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
|
|
|
EventHtmlRenderer(context, get())
|
2019-01-29 13:16:22 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
|
|
|
MessageItemFactory(get(), get(), get(), get())
|
2019-01-24 17:04:55 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(HOME_SCOPE) {
|
|
|
|
TimelineItemFactory(get(), get(), get(), get(), get(), get(), get())
|
2018-11-02 10:50:56 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
// Fragment scopes
|
2018-12-29 18:57:38 +00:00
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(ROOM_DETAIL_SCOPE) {
|
|
|
|
TimelineEventController(get(), get(), get())
|
2019-01-11 11:07:38 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(ROOM_LIST_SCOPE) {
|
|
|
|
RoomSummaryController(get())
|
2019-01-03 20:26:39 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 17:50:30 +00:00
|
|
|
scope(GROUP_LIST_SCOPE) {
|
|
|
|
GroupSummaryController()
|
2019-01-29 15:02:42 +00:00
|
|
|
}
|
|
|
|
|
2019-01-11 11:07:38 +00:00
|
|
|
|
2018-12-20 14:44:01 +00:00
|
|
|
}
|
2018-10-28 18:18:14 +00:00
|
|
|
}
|