forked from upstream-mirrors/quik
Add a dedicated emoji reaction sync process
Looks better, and provides better UX
This commit is contained in:
@@ -337,6 +337,17 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
syncingProgress.isIndeterminate = state.syncing.indeterminate
|
||||
snackbar.isVisible = false
|
||||
}
|
||||
|
||||
is SyncRepository.SyncProgress.ParsingEmojis -> {
|
||||
syncing.isVisible = true
|
||||
syncingLabel.setText(getString(R.string.main_sync_emojis))
|
||||
syncingProgress.max = state.syncing.max
|
||||
progressAnimator.apply {
|
||||
setIntValues(syncingProgress.progress, state.syncing.progress)
|
||||
}.start()
|
||||
syncingProgress.isIndeterminate = state.syncing.indeterminate
|
||||
snackbar.isVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
when {
|
||||
|
||||
@@ -128,7 +128,7 @@ class MainViewModel @Inject constructor(
|
||||
Realm.getDefaultInstance().executeTransactionAsync { realm ->
|
||||
val emojiSyncNeeded = realm.where(EmojiSyncNeeded::class.java).findFirst()
|
||||
if (emojiSyncNeeded != null) {
|
||||
reactions.deleteAndReparseAllEmojiReactions(realm)
|
||||
reactions.deleteAndReparseAllEmojiReactions(realm) { /* No progress ui needed here */ }
|
||||
emojiSyncNeeded.deleteFromRealm()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,6 +214,13 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
|
||||
progressAnimator.apply { setIntValues(syncingProgress.progress, state.syncProgress.progress) }.start()
|
||||
syncingProgress.isIndeterminate = state.syncProgress.indeterminate
|
||||
}
|
||||
|
||||
is SyncRepository.SyncProgress.ParsingEmojis -> {
|
||||
syncingProgress.isVisible = true
|
||||
syncingProgress.max = state.syncProgress.max
|
||||
progressAnimator.apply { setIntValues(syncingProgress.progress, state.syncProgress.progress) }.start()
|
||||
syncingProgress.isIndeterminate = state.syncProgress.indeterminate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user