From 0afde3b0216ff35ff7523e970deab260b30befd7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 11:07:09 +0200 Subject: [PATCH] Rename class member for code clarity --- .../im/vector/matrix/android/api/session/sync/SyncState.kt | 2 +- .../matrix/android/internal/session/sync/job/SyncThread.kt | 6 +++--- .../im/vector/riotx/features/home/HomeDetailFragment.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt index a2af70f4..cc1c3f1a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt @@ -18,7 +18,7 @@ package im.vector.matrix.android.api.session.sync sealed class SyncState { object IDLE : SyncState() - data class RUNNING(val catchingUp: Boolean) : SyncState() + data class RUNNING(val afterPause: Boolean) : SyncState() object PAUSED : SyncState() object KILLING : SyncState() object KILLED : SyncState() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt index 6a54ad33..6f002164 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt @@ -62,7 +62,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, fun restart() = synchronized(lock) { if (state is SyncState.PAUSED) { Timber.v("Resume sync...") - updateStateTo(SyncState.RUNNING(catchingUp = true)) + updateStateTo(SyncState.RUNNING(afterPause = true)) lock.notify() } } @@ -98,7 +98,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, } } else { if (state !is SyncState.RUNNING) { - updateStateTo(SyncState.RUNNING(catchingUp = true)) + updateStateTo(SyncState.RUNNING(afterPause = true)) } Timber.v("[$this] Execute sync request with timeout $DEFAULT_LONG_POOL_TIMEOUT") val latch = CountDownLatch(1) @@ -140,7 +140,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, latch.await() if (state is SyncState.RUNNING) { - updateStateTo(SyncState.RUNNING(catchingUp = false)) + updateStateTo(SyncState.RUNNING(afterPause = false)) } Timber.v("Waiting for $DEFAULT_LONG_POOL_DELAY delay before new pool...") diff --git a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt index db8ae359..bd4b2ca4 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt @@ -209,7 +209,7 @@ class HomeDetailFragment : VectorBaseFragment(), KeysBackupBanner.Delegate { unreadCounterBadgeViews[INDEX_PEOPLE].render(UnreadCounterBadgeView.State(it.notificationCountPeople, it.notificationHighlightPeople)) unreadCounterBadgeViews[INDEX_ROOMS].render(UnreadCounterBadgeView.State(it.notificationCountRooms, it.notificationHighlightRooms)) syncProgressBar.visibility = when (it.syncState) { - is SyncState.RUNNING -> if (it.syncState.catchingUp) View.VISIBLE else View.GONE + is SyncState.RUNNING -> if (it.syncState.afterPause) View.VISIBLE else View.GONE else -> View.GONE } syncProgressBarWrap.visibility = syncProgressBar.visibility