mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Diffable fade animations (#1343)
* animate only 2 seconds after the appearence * scrolling is stable * code improvement * comment and removing code that is not necessary anymore * feature flag * comment * better code * the day divider ID is the timestamp itself as ISO * Apply suggestions from code review Co-authored-by: Alfonso Grillo <alfogrillo@gmail.com> * format fix --------- Co-authored-by: Alfonso Grillo <alfogrillo@gmail.com>
This commit is contained in:
+2
@@ -32,6 +32,7 @@ struct DeveloperOptionsScreenViewStateBindings {
|
||||
var locationEventsEnabled: Bool
|
||||
var shareLocationEnabled: Bool
|
||||
var notificationSettingsEnabled: Bool
|
||||
var timelineDiffableAnimationsEnabled: Bool
|
||||
}
|
||||
|
||||
enum DeveloperOptionsScreenViewAction {
|
||||
@@ -42,5 +43,6 @@ enum DeveloperOptionsScreenViewAction {
|
||||
case changedLocationEventsEnabled
|
||||
case changedShareLocationEnabled
|
||||
case changedNotificationSettingsEnabled
|
||||
case changedTimelineDiffableAnimationsEnabled
|
||||
case clearCache
|
||||
}
|
||||
|
||||
+4
-1
@@ -32,7 +32,8 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
|
||||
isEncryptionSyncEnabled: appSettings.isEncryptionSyncEnabled,
|
||||
locationEventsEnabled: appSettings.locationEventsEnabled,
|
||||
shareLocationEnabled: appSettings.shareLocationEnabled,
|
||||
notificationSettingsEnabled: appSettings.notificationSettingsEnabled)
|
||||
notificationSettingsEnabled: appSettings.notificationSettingsEnabled,
|
||||
timelineDiffableAnimationsEnabled: appSettings.timelineDiffableAnimationsEnabled)
|
||||
let state = DeveloperOptionsScreenViewState(bindings: bindings)
|
||||
|
||||
super.init(initialViewState: state)
|
||||
@@ -58,6 +59,8 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
|
||||
appSettings.shareLocationEnabled = state.bindings.shareLocationEnabled
|
||||
case .changedNotificationSettingsEnabled:
|
||||
appSettings.notificationSettingsEnabled = state.bindings.notificationSettingsEnabled
|
||||
case .changedTimelineDiffableAnimationsEnabled:
|
||||
appSettings.timelineDiffableAnimationsEnabled = state.bindings.timelineDiffableAnimationsEnabled
|
||||
case .clearCache:
|
||||
callback?(.clearCache)
|
||||
}
|
||||
|
||||
+7
@@ -79,6 +79,13 @@ struct DeveloperOptionsScreen: View {
|
||||
.onChange(of: context.userSuggestionsEnabled) { _ in
|
||||
context.send(viewAction: .changedUserSuggestionsEnabled)
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.timelineDiffableAnimationsEnabled) {
|
||||
Text("Enable diffable animations in the timeline")
|
||||
}
|
||||
.onChange(of: context.timelineDiffableAnimationsEnabled) { _ in
|
||||
context.send(viewAction: .changedTimelineDiffableAnimationsEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
|
||||
Reference in New Issue
Block a user