mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Add another performance check for cold start time until the cached room list is displayed
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
e1bd189ba0
commit
daf7bea39e
@@ -28,6 +28,7 @@ setupDependencyInjection()
|
||||
|
||||
dependencies {
|
||||
implementation(projects.appconfig)
|
||||
implementation(projects.appnav)
|
||||
implementation(projects.libraries.core)
|
||||
implementation(projects.libraries.androidutils)
|
||||
implementation(projects.libraries.architecture)
|
||||
|
||||
+4
@@ -25,6 +25,7 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.runtime.snapshotFlow
|
||||
import dev.zacsweers.metro.Inject
|
||||
import im.vector.app.features.analytics.plan.Interaction
|
||||
import io.element.android.appnav.analytics.AnalyticsColdStartWatcher
|
||||
import io.element.android.features.announcement.api.Announcement
|
||||
import io.element.android.features.announcement.api.AnnouncementService
|
||||
import io.element.android.features.home.impl.datasource.RoomListDataSource
|
||||
@@ -86,6 +87,7 @@ class RoomListPresenter(
|
||||
private val appPreferencesStore: AppPreferencesStore,
|
||||
private val seenInvitesStore: SeenInvitesStore,
|
||||
private val announcementService: AnnouncementService,
|
||||
private val coldStartWatcher: AnalyticsColdStartWatcher,
|
||||
) : Presenter<RoomListState> {
|
||||
private val encryptionService = client.encryptionService
|
||||
|
||||
@@ -236,6 +238,8 @@ class RoomListPresenter(
|
||||
)
|
||||
showSkeleton -> RoomListContentState.Skeleton(count = 16)
|
||||
else -> {
|
||||
coldStartWatcher.onRoomListVisible()
|
||||
|
||||
RoomListContentState.Rooms(
|
||||
securityBannerState = securityBannerState,
|
||||
showNewNotificationSoundBanner = showNewNotificationSoundBanner,
|
||||
|
||||
+10
@@ -13,6 +13,7 @@ import app.cash.molecule.moleculeFlow
|
||||
import app.cash.turbine.test
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import im.vector.app.features.analytics.plan.Interaction
|
||||
import io.element.android.appnav.analytics.AnalyticsColdStartWatcher
|
||||
import io.element.android.features.announcement.api.Announcement
|
||||
import io.element.android.features.announcement.api.AnnouncementService
|
||||
import io.element.android.features.home.impl.FakeDateTimeObserver
|
||||
@@ -673,5 +674,14 @@ class RoomListPresenterTest {
|
||||
appPreferencesStore = appPreferencesStore,
|
||||
seenInvitesStore = seenInvitesStore,
|
||||
announcementService = announcementService,
|
||||
coldStartWatcher = FakeAnalyticsColdStartWatcher(),
|
||||
)
|
||||
}
|
||||
|
||||
private class FakeAnalyticsColdStartWatcher : AnalyticsColdStartWatcher {
|
||||
override fun start() {}
|
||||
|
||||
override fun whenLoggingIn() {}
|
||||
|
||||
override fun onRoomListVisible() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user