-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7206 from thundernest/post_delete_action
Combine settings for navigation action after removing a message
- Loading branch information
Showing
63 changed files
with
127 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
app/core/src/main/java/com/fsck/k9/preferences/upgrader/GeneralSettingsUpgraderTo89.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.fsck.k9.preferences.upgrader | ||
|
||
import com.fsck.k9.preferences.Settings.SettingsUpgrader | ||
|
||
/** | ||
* Combine `messageViewReturnToList` and `messageViewShowNext` into `messageViewPostDeleteAction`. | ||
*/ | ||
class GeneralSettingsUpgraderTo89 : SettingsUpgrader { | ||
override fun upgrade(settings: MutableMap<String, Any>): Set<String> { | ||
val messageViewReturnToList = settings["messageViewReturnToList"] as? Boolean | ||
val messageViewShowNext = settings["messageViewShowNext"] as? Boolean | ||
|
||
if (messageViewReturnToList == true) { | ||
settings["messageViewPostDeleteAction"] = "ReturnToMessageList" | ||
} else if (messageViewShowNext == true) { | ||
settings["messageViewPostDeleteAction"] = "ShowNextMessage" | ||
} else { | ||
settings["messageViewPostDeleteAction"] = "ShowPreviousMessage" | ||
} | ||
|
||
return setOf("messageViewReturnToList", "messageViewShowNext") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrationTo21.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.fsck.k9.preferences.migrations | ||
|
||
import android.database.sqlite.SQLiteDatabase | ||
|
||
/** | ||
* Combine `messageViewReturnToList` and `messageViewShowNext` into `messageViewPostDeleteAction`. | ||
*/ | ||
class StorageMigrationTo21( | ||
private val db: SQLiteDatabase, | ||
private val migrationsHelper: StorageMigrationsHelper, | ||
) { | ||
fun createPostRemoveNavigationSetting() { | ||
val messageViewReturnToList = migrationsHelper.readValue(db, "messageViewReturnToList").toBoolean() | ||
val messageViewShowNext = migrationsHelper.readValue(db, "messageViewShowNext").toBoolean() | ||
|
||
val postRemoveNavigation = when { | ||
messageViewReturnToList -> "ReturnToMessageList" | ||
messageViewShowNext -> "ShowNextMessage" | ||
else -> "ShowPreviousMessage" | ||
} | ||
|
||
migrationsHelper.writeValue(db, "messageViewPostDeleteAction", postRemoveNavigation) | ||
migrationsHelper.writeValue(db, "messageViewReturnToList", null) | ||
migrationsHelper.writeValue(db, "messageViewShowNext", null) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
app/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/Direction.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.