iOS 13 style segmented control

iPad UI improvements
This commit is contained in:
Ilya Laktyushin
2019-09-07 09:13:07 +03:00
parent e99a9e8d99
commit c8837e04f8
52 changed files with 1483 additions and 265 deletions

View File

@@ -283,7 +283,7 @@ open class ItemListController<Entry: ItemListNodeEntry>: ViewController, KeyShor
if let segmentedTitleView = strongSelf.segmentedTitleView, segmentedTitleView.segments == sections {
segmentedTitleView.index = index
} else {
let segmentedTitleView = ItemListControllerSegmentedTitleView(segments: sections, index: index, color: controllerState.theme.rootController.navigationBar.accentTextColor)
let segmentedTitleView = ItemListControllerSegmentedTitleView(theme: controllerState.theme, segments: sections, selectedIndex: index)
strongSelf.segmentedTitleView = segmentedTitleView
strongSelf.navigationItem.titleView = strongSelf.segmentedTitleView
segmentedTitleView.indexUpdated = { index in
@@ -406,7 +406,7 @@ open class ItemListController<Entry: ItemListNodeEntry>: ViewController, KeyShor
strongSelf.navigationBar?.updatePresentationData(NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: strongSelf.theme), strings: NavigationBarStrings(presentationStrings: strongSelf.strings)))
strongSelf.statusBar.statusBarStyle = strongSelf.theme.rootController.statusBarStyle.style
strongSelf.segmentedTitleView?.color = controllerState.theme.rootController.navigationBar.accentTextColor
strongSelf.segmentedTitleView?.theme = controllerState.theme
var items = strongSelf.navigationItem.rightBarButtonItems ?? []
for i in 0 ..< strongSelf.rightNavigationButtonTitleAndStyle.count {