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,10 +94,12 @@ class BookmarksTableViewController: EnhancedTableViewController {
self.statuses.append(contentsOf: newStatuses.map { ($0.id, .unknown) })
DispatchQueue.main.async {
UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
}
}
}
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true

View File

@ -143,11 +143,13 @@ class NotificationsTableViewController: EnhancedTableViewController {
self.older = pagination?.older
DispatchQueue.main.async {
UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
}
}
}
}
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true
@ -224,7 +226,9 @@ class NotificationsTableViewController: EnhancedTableViewController {
let newIndexPaths = (0..<groups.count).map {
IndexPath(row: $0, section: 0)
}
UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
self.refreshControl?.endRefreshing()

View File

@ -106,11 +106,13 @@ class TimelineTableViewController: EnhancedTableViewController {
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) })
DispatchQueue.main.async {
UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .none)
}
}
}
}
}
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true
@ -142,7 +144,9 @@ class TimelineTableViewController: EnhancedTableViewController {
let newIndexPaths = (0..<newStatuses.count).map {
IndexPath(row: $0, section: 0)
}
UIView.performWithoutAnimation {
self.tableView.insertRows(at: newIndexPaths, with: .automatic)
}
self.refreshControl?.endRefreshing()