Remove "showAnimations" methods from 'K9'

This commit is contained in:
cketti 2019-05-22 00:11:45 +02:00
parent aad830ff9e
commit 8ba651501b
3 changed files with 8 additions and 16 deletions

View file

@ -181,7 +181,8 @@ object K9 : KoinComponent {
@JvmStatic
var backgroundOps = BACKGROUND_OPS.WHEN_CHECKED_AUTO_SYNC
private var animations = true
@JvmStatic
var isShowAnimations = true
private var confirmDelete = false
private var confirmDiscardMessage = true
@ -310,15 +311,6 @@ object K9 : KoinComponent {
updateLoggingStatus()
}
@JvmStatic
fun showAnimations(): Boolean {
return animations
}
fun setAnimations(animations: Boolean) {
K9.animations = animations
}
@JvmStatic
fun messageListPreviewLines(): Int {
return messageListPreviewLines
@ -570,7 +562,7 @@ object K9 : KoinComponent {
val storage = prefs.storage
isDebug = storage.getBoolean("enableDebugLogging", DEVELOPER_MODE)
DEBUG_SENSITIVE = storage.getBoolean("enableSensitiveLogging", false)
animations = storage.getBoolean("animations", true)
isShowAnimations = storage.getBoolean("animations", true)
isGesturesEnabled = storage.getBoolean("gesturesEnabled", false)
isUseVolumeKeysForNavigation = storage.getBoolean("useVolumeKeysForNavigation", false)
isUseVolumeKeysForListNavigation = storage.getBoolean("useVolumeKeysForListNavigation", false)
@ -692,7 +684,7 @@ object K9 : KoinComponent {
editor.putBoolean("enableDebugLogging", DEBUG)
editor.putBoolean("enableSensitiveLogging", DEBUG_SENSITIVE)
editor.putString("backgroundOperations", K9.backgroundOps.name)
editor.putBoolean("animations", animations)
editor.putBoolean("animations", isShowAnimations)
editor.putBoolean("gesturesEnabled", isGesturesEnabled)
editor.putBoolean("useVolumeKeysForNavigation", isUseVolumeKeysForNavigation)
editor.putBoolean("useVolumeKeysForListNavigation", isUseVolumeKeysForListNavigation)

View file

@ -18,7 +18,7 @@ class GeneralSettingsDataStore(
override fun getBoolean(key: String, defValue: Boolean): Boolean {
return when (key) {
"fixed_message_view_theme" -> K9.isFixedMessageViewTheme
"animations" -> K9.showAnimations()
"animations" -> K9.isShowAnimations
"measure_accounts" -> K9.measureAccounts()
"count_search" -> K9.countSearchMessages()
"hide_special_accounts" -> K9.isHideSpecialAccounts
@ -52,7 +52,7 @@ class GeneralSettingsDataStore(
override fun putBoolean(key: String, value: Boolean) {
when (key) {
"fixed_message_view_theme" -> K9.isFixedMessageViewTheme = value
"animations" -> K9.setAnimations(value)
"animations" -> K9.isShowAnimations = value
"measure_accounts" -> K9.setMeasureAccounts(value)
"count_search" -> K9.setCountSearchMessages(value)
"hide_special_accounts" -> K9.isHideSpecialAccounts = value

View file

@ -49,7 +49,7 @@ public class ViewSwitcher extends ViewAnimator implements AnimationListener {
}
private void setupAnimations(Animation in, Animation out) {
if (K9.showAnimations()) {
if (K9.isShowAnimations()) {
setInAnimation(in);
setOutAnimation(out);
out.setAnimationListener(this);
@ -60,7 +60,7 @@ public class ViewSwitcher extends ViewAnimator implements AnimationListener {
}
private void handleSwitchCompleteCallback() {
if (!K9.showAnimations()) {
if (!K9.isShowAnimations()) {
onAnimationEnd(null);
}
}