From 3f291303325b4143491c3cf3dbbea9589a97c3cf Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Tue, 30 Nov 2021 17:06:47 +0000 Subject: [PATCH 1/2] Remove requestModelBuild() from epoxy Controllers init block --- .../app/features/contactsbook/ContactsBookController.kt | 4 ---- .../app/features/devtools/RoomDevToolRootController.kt | 4 ---- .../features/home/room/breadcrumbs/BreadcrumbsController.kt | 6 ------ .../app/features/settings/devices/DevicesController.kt | 4 ---- .../app/features/settings/ignored/IgnoredUsersController.kt | 4 ---- .../app/features/signout/soft/SoftLogoutController.kt | 6 ------ .../im/vector/app/features/spaces/SpaceSummaryController.kt | 4 ---- 7 files changed, 32 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookController.kt b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookController.kt index 05a2bf641b..219be0abeb 100644 --- a/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookController.kt +++ b/vector/src/main/java/im/vector/app/features/contactsbook/ContactsBookController.kt @@ -41,10 +41,6 @@ class ContactsBookController @Inject constructor( var callback: Callback? = null - init { - requestModelBuild() - } - fun setData(state: ContactsBookViewState) { this.state = state requestModelBuild() diff --git a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolRootController.kt b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolRootController.kt index ed52deeade..be77354754 100644 --- a/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolRootController.kt +++ b/vector/src/main/java/im/vector/app/features/devtools/RoomDevToolRootController.kt @@ -26,10 +26,6 @@ class RoomDevToolRootController @Inject constructor( private val stringProvider: StringProvider ) : EpoxyController() { - init { - requestModelBuild() - } - var interactionListener: DevToolsInteractionListener? = null override fun buildModels() { diff --git a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsController.kt b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsController.kt index 50d5478ba1..9a1b6486da 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsController.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/breadcrumbs/BreadcrumbsController.kt @@ -30,12 +30,6 @@ class BreadcrumbsController @Inject constructor( private var viewState: BreadcrumbsViewState? = null - init { - // We are requesting a model build directly as the first build of epoxy is on the main thread. - // It avoids to build the whole list of breadcrumbs on the main thread. - requestModelBuild() - } - fun update(viewState: BreadcrumbsViewState) { this.viewState = viewState requestModelBuild() diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/DevicesController.kt b/vector/src/main/java/im/vector/app/features/settings/devices/DevicesController.kt index a446e9646e..ab63ad0894 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/DevicesController.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/DevicesController.kt @@ -46,10 +46,6 @@ class DevicesController @Inject constructor(private val errorFormatter: ErrorFor var callback: Callback? = null private var viewState: DevicesViewState? = null - init { - requestModelBuild() - } - fun update(viewState: DevicesViewState) { this.viewState = viewState requestModelBuild() diff --git a/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersController.kt b/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersController.kt index ce84366ef3..286379986d 100644 --- a/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersController.kt +++ b/vector/src/main/java/im/vector/app/features/settings/ignored/IgnoredUsersController.kt @@ -31,10 +31,6 @@ class IgnoredUsersController @Inject constructor(private val stringProvider: Str var callback: Callback? = null private var viewState: IgnoredUsersViewState? = null - init { - requestModelBuild() - } - fun update(viewState: IgnoredUsersViewState) { this.viewState = viewState requestModelBuild() diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt index 8aad6e2b77..0cd9cde547 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt @@ -45,12 +45,6 @@ class SoftLogoutController @Inject constructor( private var viewState: SoftLogoutViewState? = null - init { - // We are requesting a model build directly as the first build of epoxy is on the main thread. - // It avoids to build the whole list of breadcrumbs on the main thread. - requestModelBuild() - } - fun update(viewState: SoftLogoutViewState) { this.viewState = viewState requestModelBuild() diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt index d9d4058534..a334548cfc 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt @@ -47,10 +47,6 @@ class SpaceSummaryController @Inject constructor( private val subSpaceComparator: Comparator = compareBy { it.order }.thenBy { it.childRoomId } - init { - requestModelBuild() - } - fun update(viewState: SpaceListViewState) { this.viewState = viewState requestModelBuild() From ff0cf9b3943a2f9048c097eb8e02cc4c63ef2792 Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Tue, 30 Nov 2021 17:16:53 +0000 Subject: [PATCH 2/2] Add changelog file --- changelog.d/4591.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4591.misc diff --git a/changelog.d/4591.misc b/changelog.d/4591.misc new file mode 100644 index 0000000000..29d4139840 --- /dev/null +++ b/changelog.d/4591.misc @@ -0,0 +1 @@ +Remove requestModelBuild() from epoxy Controllers init{} block