forked from upstream-mirrors/quik
Fix archived toast's incorrect wording
Previously it said that messages were archived when they actually were unarchived. The app no longer engages in this duplicity.
This commit is contained in:
@@ -440,10 +440,14 @@ class MainActivity : QkThemedActivity(), MainView {
|
|||||||
override fun showChangelog(changelog: ChangelogManager.CumulativeChangelog) =
|
override fun showChangelog(changelog: ChangelogManager.CumulativeChangelog) =
|
||||||
changelogDialog.show(changelog)
|
changelogDialog.show(changelog)
|
||||||
|
|
||||||
override fun showArchivedSnackbar(countConversationsArchived: Int) =
|
override fun showArchivedSnackbar(countConversationsArchived: Int, isArchiving: Boolean) =
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
drawerLayout,
|
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
|
if (countConversationsArchived < 10) Snackbar.LENGTH_LONG
|
||||||
else Snackbar.LENGTH_INDEFINITE
|
else Snackbar.LENGTH_INDEFINITE
|
||||||
).let {
|
).let {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ interface MainView : QkView<MainState> {
|
|||||||
fun showDeleteDialog(conversations: List<Long>)
|
fun showDeleteDialog(conversations: List<Long>)
|
||||||
fun showRenameDialog(conversationName: String)
|
fun showRenameDialog(conversationName: String)
|
||||||
fun showChangelog(changelog: ChangelogManager.CumulativeChangelog)
|
fun showChangelog(changelog: ChangelogManager.CumulativeChangelog)
|
||||||
fun showArchivedSnackbar(countConversationsArchived: Int)
|
fun showArchivedSnackbar(countConversationsArchived: Int, isArchiving: Boolean)
|
||||||
fun drawerToggled(opened: Boolean)
|
fun drawerToggled(opened: Boolean)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ class MainViewModel @Inject constructor(
|
|||||||
.withLatestFrom(view.conversationsSelectedIntent) { _, conversations ->
|
.withLatestFrom(view.conversationsSelectedIntent) { _, conversations ->
|
||||||
markArchived.execute(conversations)
|
markArchived.execute(conversations)
|
||||||
lastArchivedThreadIds = conversations.toList()
|
lastArchivedThreadIds = conversations.toList()
|
||||||
view.showArchivedSnackbar(lastArchivedThreadIds.count())
|
view.showArchivedSnackbar(lastArchivedThreadIds.count(), true)
|
||||||
view.clearSelection()
|
view.clearSelection()
|
||||||
}
|
}
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
@@ -358,7 +358,7 @@ class MainViewModel @Inject constructor(
|
|||||||
.filter { itemId -> itemId == R.id.unarchive }
|
.filter { itemId -> itemId == R.id.unarchive }
|
||||||
.withLatestFrom(view.conversationsSelectedIntent) { _, conversations ->
|
.withLatestFrom(view.conversationsSelectedIntent) { _, conversations ->
|
||||||
markUnarchived.execute(conversations.toList())
|
markUnarchived.execute(conversations.toList())
|
||||||
view.showArchivedSnackbar(conversations.count())
|
view.showArchivedSnackbar(conversations.count(), false)
|
||||||
view.clearSelection()
|
view.clearSelection()
|
||||||
}
|
}
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
@@ -523,7 +523,7 @@ class MainViewModel @Inject constructor(
|
|||||||
Preferences.SWIPE_ACTION_ARCHIVE ->
|
Preferences.SWIPE_ACTION_ARCHIVE ->
|
||||||
markArchived.execute(listOf(threadId)) {
|
markArchived.execute(listOf(threadId)) {
|
||||||
lastArchivedThreadIds = listOf(threadId)
|
lastArchivedThreadIds = listOf(threadId)
|
||||||
view.showArchivedSnackbar(1)
|
view.showArchivedSnackbar(1, true)
|
||||||
}
|
}
|
||||||
Preferences.SWIPE_ACTION_DELETE ->
|
Preferences.SWIPE_ACTION_DELETE ->
|
||||||
view.showDeleteDialog(listOf(threadId))
|
view.showDeleteDialog(listOf(threadId))
|
||||||
|
|||||||
@@ -477,6 +477,10 @@
|
|||||||
<item quantity="one">Archived conversation</item>
|
<item quantity="one">Archived conversation</item>
|
||||||
<item quantity="other">Archived %d conversations</item>
|
<item quantity="other">Archived %d conversations</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
|
<plurals name="toast_unarchived">
|
||||||
|
<item quantity="one">Unarchived conversation</item>
|
||||||
|
<item quantity="other">Unarchived %d conversations</item>
|
||||||
|
</plurals>
|
||||||
|
|
||||||
<string name="toast_qksms_plus">You must unlock QUIK+ to use this</string>
|
<string name="toast_qksms_plus">You must unlock QUIK+ to use this</string>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user