Disable row insertion animations

This commit is contained in:
Shadowfacts 2020-01-26 18:23:18 -05:00
parent f2e08e96f3
commit 20c602f911
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
3 changed files with 16 additions and 6 deletions

View File

@ -94,7 +94,9 @@ class BookmarksTableViewController: EnhancedTableViewController {
self.statuses.append(contentsOf: newStatuses.map { ($0.id, .unknown) }) self.statuses.append(contentsOf: newStatuses.map { ($0.id, .unknown) })
DispatchQueue.main.async { DispatchQueue.main.async {
self.tableView.insertRows(at: newIndexPaths, with: .automatic) UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
} }
} }
} }

View File

@ -143,7 +143,9 @@ class NotificationsTableViewController: EnhancedTableViewController {
self.older = pagination?.older self.older = pagination?.older
DispatchQueue.main.async { DispatchQueue.main.async {
self.tableView.insertRows(at: newIndexPaths, with: .automatic) UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
} }
} }
} }
@ -224,7 +226,9 @@ class NotificationsTableViewController: EnhancedTableViewController {
let newIndexPaths = (0..<groups.count).map { let newIndexPaths = (0..<groups.count).map {
IndexPath(row: $0, section: 0) IndexPath(row: $0, section: 0)
} }
self.tableView.insertRows(at: newIndexPaths, with: .automatic) UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
self.refreshControl?.endRefreshing() self.refreshControl?.endRefreshing()

View File

@ -106,7 +106,9 @@ class TimelineTableViewController: EnhancedTableViewController {
let newIndexPaths = newRows.map { IndexPath(row: $0, section: self.timelineSegments.count - 1) } let newIndexPaths = newRows.map { IndexPath(row: $0, section: self.timelineSegments.count - 1) }
self.timelineSegments[self.timelineSegments.count - 1].append(contentsOf: newStatuses.map { ($0.id, .unknown) }) self.timelineSegments[self.timelineSegments.count - 1].append(contentsOf: newStatuses.map { ($0.id, .unknown) })
DispatchQueue.main.async { DispatchQueue.main.async {
self.tableView.insertRows(at: newIndexPaths, with: .none) UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .none)
}
} }
} }
} }
@ -142,7 +144,9 @@ class TimelineTableViewController: EnhancedTableViewController {
let newIndexPaths = (0..<newStatuses.count).map { let newIndexPaths = (0..<newStatuses.count).map {
IndexPath(row: $0, section: 0) IndexPath(row: $0, section: 0)
} }
self.tableView.insertRows(at: newIndexPaths, with: .automatic) UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
self.refreshControl?.endRefreshing() self.refreshControl?.endRefreshing()