fix: Honour the FAB_HIDE preference in timelines (#227)
This commit is contained in:
parent
c2292a565e
commit
392eb55485
|
@ -381,12 +381,12 @@ abstract class TimelineViewModel(
|
|||
.filter { it == PrefKeys.FAB_HIDE }
|
||||
.map {
|
||||
UiState(
|
||||
sharedPreferencesRepository.getBoolean(PrefKeys.FAB_HIDE, false),
|
||||
showFabWhileScrolling = !sharedPreferencesRepository.getBoolean(PrefKeys.FAB_HIDE, false),
|
||||
)
|
||||
}.stateIn(
|
||||
scope = viewModelScope,
|
||||
started = SharingStarted.WhileSubscribed(stopTimeoutMillis = 5000),
|
||||
initialValue = UiState(showFabWhileScrolling = true),
|
||||
initialValue = UiState(showFabWhileScrolling = !sharedPreferencesRepository.getBoolean(PrefKeys.FAB_HIDE, false)),
|
||||
)
|
||||
|
||||
if (timelineKind is TimelineKind.Home) {
|
||||
|
|
|
@ -52,7 +52,7 @@ class CachedTimelineViewModelTestUiState : CachedTimelineViewModelTestBase() {
|
|||
|
||||
// Given
|
||||
sharedPreferencesRepository.edit {
|
||||
putBoolean(PrefKeys.FAB_HIDE, false)
|
||||
putBoolean(PrefKeys.FAB_HIDE, true)
|
||||
}
|
||||
|
||||
// Then
|
||||
|
|
|
@ -52,7 +52,7 @@ class NetworkTimelineViewModelTestUiState : NetworkTimelineViewModelTestBase() {
|
|||
|
||||
// When
|
||||
sharedPreferencesRepository.edit {
|
||||
putBoolean(PrefKeys.FAB_HIDE, false)
|
||||
putBoolean(PrefKeys.FAB_HIDE, true)
|
||||
}
|
||||
|
||||
// Then
|
||||
|
|
Loading…
Reference in New Issue