diff options
author | Aleksey Belousov <aleksey.belousov@corp.mail.ru> | 2018-05-04 18:58:55 +0300 |
---|---|---|
committer | Aleksey Belousov <aleksey.belousov@corp.mail.ru> | 2018-05-04 18:58:55 +0300 |
commit | adc5450c93c4b192ad14aacf2a556213ec9bc213 (patch) | |
tree | 61aeafb2e7bdb621088a2016822f61520b5ccf0c | |
parent | 034bf651d55891c2172eced8bd85976fe801f900 (diff) |
Fixed permission header animation on bookmarks screenbookmarks_cosmetics
Fixed show/hide all button
3 files changed, 16 insertions, 4 deletions
diff --git a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift index b48e68e167..027033e4b1 100644 --- a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift @@ -303,7 +303,17 @@ extension BMCViewController: BMCCategoryCellDelegate { extension BMCViewController: BMCPermissionsHeaderDelegate { func collapseAction(isCollapsed: Bool) { permissionsHeader.isCollapsed = !isCollapsed - update(sections: [.permissions]) + let sectionIndex = viewModel.sectionIndex(section: .permissions) + let rowsInSection = viewModel.numberOfRows(section: .permissions) + var rowIndexes = [IndexPath]() + for rowIndex in 0..<rowsInSection { + rowIndexes.append(IndexPath(row: rowIndex, section: sectionIndex)) + } + if (permissionsHeader.isCollapsed) { + tableView.deleteRows(at: rowIndexes, with: .automatic) + } else { + tableView.insertRows(at: rowIndexes, with: .automatic) + } } } diff --git a/iphone/Maps/Bookmarks/Categories/Categories/BMCCategoriesHeader.swift b/iphone/Maps/Bookmarks/Categories/Categories/BMCCategoriesHeader.swift index 029d297db1..6f9cd6faef 100644 --- a/iphone/Maps/Bookmarks/Categories/Categories/BMCCategoriesHeader.swift +++ b/iphone/Maps/Bookmarks/Categories/Categories/BMCCategoriesHeader.swift @@ -20,7 +20,9 @@ final class BMCCategoriesHeader: UIView { var isShowAll = false { didSet { let title = L(isShowAll ? "bookmarks_groups_show_all" : "bookmarks_groups_hide_all") - button.setTitle(title, for: .normal) + UIView.performWithoutAnimation { + button.setTitle(title, for: .normal) + } } } diff --git a/iphone/Maps/Bookmarks/Categories/Permissions/BMCPermissionsHeader.swift b/iphone/Maps/Bookmarks/Categories/Permissions/BMCPermissionsHeader.swift index 51592c5996..3720cd0341 100644 --- a/iphone/Maps/Bookmarks/Categories/Permissions/BMCPermissionsHeader.swift +++ b/iphone/Maps/Bookmarks/Categories/Permissions/BMCPermissionsHeader.swift @@ -28,8 +28,8 @@ final class BMCPermissionsHeader: UIView { var delegate: BMCPermissionsHeaderDelegate! private func updateButton() { - UIView.animate(withDuration: kDefaultAnimationDuration) { - self.button?.imageView?.transform = self.isCollapsed ? .init(rotationAngle: .pi) : .identity + UIView.animate(withDuration: 0.3) { + self.button?.imageView?.transform = self.isCollapsed ? .init(rotationAngle: .pi - 0.001) : .identity //fix for rotation direction on expand-collapse } } |