Merge pull request #489 from Inhishonor/archived-toast

Fix archived toast's incorrect wording
This commit is contained in:
octoshrimpy
2025-07-18 17:05:27 -06:00
committed by GitHub
4 changed files with 14 additions and 6 deletions
@@ -440,10 +440,14 @@ class MainActivity : QkThemedActivity(), MainView {
override fun showChangelog(changelog: ChangelogManager.CumulativeChangelog) =
changelogDialog.show(changelog)
override fun showArchivedSnackbar(countConversationsArchived: Int) =
override fun showArchivedSnackbar(countConversationsArchived: Int, isArchiving: Boolean) =
Snackbar.make(
drawerLayout,
resources.getQuantityString(R.plurals.toast_archived, countConversationsArchived, countConversationsArchived),
if (isArchiving) {
resources.getQuantityString(R.plurals.toast_archived, countConversationsArchived, countConversationsArchived)
} else {
resources.getQuantityString(R.plurals.toast_unarchived, countConversationsArchived, countConversationsArchived)
},
if (countConversationsArchived < 10) Snackbar.LENGTH_LONG
else Snackbar.LENGTH_INDEFINITE
).let {
@@ -54,7 +54,7 @@ interface MainView : QkView<MainState> {
fun showDeleteDialog(conversations: List<Long>)
fun showRenameDialog(conversationName: String)
fun showChangelog(changelog: ChangelogManager.CumulativeChangelog)
fun showArchivedSnackbar(countConversationsArchived: Int)
fun showArchivedSnackbar(countConversationsArchived: Int, isArchiving: Boolean)
fun drawerToggled(opened: Boolean)
}
@@ -348,7 +348,7 @@ class MainViewModel @Inject constructor(
.withLatestFrom(view.conversationsSelectedIntent) { _, conversations ->
markArchived.execute(conversations)
lastArchivedThreadIds = conversations.toList()
view.showArchivedSnackbar(lastArchivedThreadIds.count())
view.showArchivedSnackbar(lastArchivedThreadIds.count(), true)
view.clearSelection()
}
.autoDisposable(view.scope())
@@ -358,7 +358,7 @@ class MainViewModel @Inject constructor(
.filter { itemId -> itemId == R.id.unarchive }
.withLatestFrom(view.conversationsSelectedIntent) { _, conversations ->
markUnarchived.execute(conversations.toList())
view.showArchivedSnackbar(conversations.count())
view.showArchivedSnackbar(conversations.count(), false)
view.clearSelection()
}
.autoDisposable(view.scope())
@@ -523,7 +523,7 @@ class MainViewModel @Inject constructor(
Preferences.SWIPE_ACTION_ARCHIVE ->
markArchived.execute(listOf(threadId)) {
lastArchivedThreadIds = listOf(threadId)
view.showArchivedSnackbar(1)
view.showArchivedSnackbar(1, true)
}
Preferences.SWIPE_ACTION_DELETE ->
view.showDeleteDialog(listOf(threadId))