mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-09 11:48:43 +01:00
fix: zombie mode (#126)
This commit is contained in:
parent
157ffcf563
commit
5e4003aa66
@ -153,7 +153,10 @@ class CommunityDetailViewModel(
|
||||
|
||||
is CommunityDetailMviModel.Intent.StartZombieMode -> {
|
||||
mvi.updateState { it.copy(zombieModeActive = true) }
|
||||
zombieModeHelper.start(intent.index)
|
||||
zombieModeHelper.start(
|
||||
initialValue = intent.index,
|
||||
interval = settingsRepository.currentSettings.value.zombieModeInterval,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,12 +31,9 @@ class DurationBottomSheet(
|
||||
private val values: List<Duration> = listOf(
|
||||
1.seconds,
|
||||
2.seconds,
|
||||
2.5.seconds,
|
||||
3.seconds,
|
||||
3.5.seconds,
|
||||
4.seconds,
|
||||
4.5.seconds,
|
||||
5.seconds,
|
||||
10.seconds,
|
||||
),
|
||||
) : Screen {
|
||||
|
||||
|
@ -29,6 +29,6 @@ data class SettingsModel(
|
||||
val autoLoadImages: Boolean = true,
|
||||
val autoExpandComments: Boolean = true,
|
||||
val hideNavigationBarWhileScrolling: Boolean = true,
|
||||
val zombieModeInterval: Duration = 2.5.seconds,
|
||||
val zombieModeInterval: Duration = 2.seconds,
|
||||
val zombieModeScrollAmount: Float = 100f,
|
||||
) : JavaSerializable
|
||||
|
@ -109,7 +109,7 @@ internal class DefaultSettingsRepository(
|
||||
upvoteColor = if (!keyStore.containsKey(KeyStoreKeys.UpvoteColor)) null else keyStore[KeyStoreKeys.UpvoteColor, 0],
|
||||
downvoteColor = if (!keyStore.containsKey(KeyStoreKeys.DownVoteColor)) null else keyStore[KeyStoreKeys.DownVoteColor, 0],
|
||||
hideNavigationBarWhileScrolling = keyStore[KeyStoreKeys.HideNavigationBarWhileScrolling, true],
|
||||
zombieModeInterval = keyStore[KeyStoreKeys.ZombieModeInterval, 2500].milliseconds,
|
||||
zombieModeInterval = keyStore[KeyStoreKeys.ZombieModeInterval, 2000].milliseconds,
|
||||
zombieModeScrollAmount = keyStore[KeyStoreKeys.ZombieModeScrollAmount, 100f],
|
||||
)
|
||||
} else {
|
||||
|
@ -23,7 +23,7 @@ CREATE TABLE SettingsEntity (
|
||||
upvoteColor INTEGER DEFAULT NULL,
|
||||
downvoteColor INTEGER DEFAULT NULL,
|
||||
hideNavigationBarWhileScrolling INTEGER NOT NULL DEFAULT 1,
|
||||
zombieModeInterval INTEGER NOT NULL DEFAULT 2500,
|
||||
zombieModeInterval INTEGER NOT NULL DEFAULT 2000,
|
||||
zombieModeScrollAmount REAL NOT NULL DEFAULT 100,
|
||||
account_id INTEGER,
|
||||
FOREIGN KEY (account_id) REFERENCES AccountEntity(id) ON DELETE CASCADE,
|
||||
|
@ -2,4 +2,4 @@ ALTER TABLE SettingsEntity
|
||||
ADD COLUMN hideNavigationBarWhileScrolling INTEGER NOT NULL DEFAULT 1;
|
||||
|
||||
ALTER TABLE SettingsEntity
|
||||
ADD COLUMN zombieModeInterval INTEGER NOT NULL DEFAULT 2500;
|
||||
ADD COLUMN zombieModeInterval INTEGER NOT NULL DEFAULT 2000;
|
@ -206,7 +206,10 @@ class PostListViewModel(
|
||||
|
||||
is PostListMviModel.Intent.StartZombieMode -> {
|
||||
mvi.updateState { it.copy(zombieModeActive = true) }
|
||||
zombieModeHelper.start(intent.index)
|
||||
zombieModeHelper.start(
|
||||
initialValue = intent.index,
|
||||
interval = settingsRepository.currentSettings.value.zombieModeInterval,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user