mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 11:50:56 +00:00
Disable tab animations on tablets
This commit is contained in:
parent
f56ab00c95
commit
ea3ad1ae8e
@ -111,8 +111,8 @@ open class TabBarControllerImpl: ViewController, TabBarController {
|
|||||||
}
|
}
|
||||||
} set(value) {
|
} set(value) {
|
||||||
let index = max(0, min(self.controllers.count - 1, value))
|
let index = max(0, min(self.controllers.count - 1, value))
|
||||||
if _selectedIndex != index {
|
if self._selectedIndex != index {
|
||||||
_selectedIndex = index
|
self._selectedIndex = index
|
||||||
|
|
||||||
self.updateSelectedIndex(animated: true)
|
self.updateSelectedIndex(animated: true)
|
||||||
}
|
}
|
||||||
@ -349,6 +349,11 @@ open class TabBarControllerImpl: ViewController, TabBarController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var animated = animated
|
||||||
|
if let layout = self.validLayout, case .regular = layout.metrics.widthClass {
|
||||||
|
animated = false
|
||||||
|
}
|
||||||
|
|
||||||
var tabBarSelectedIndex = self.selectedIndex
|
var tabBarSelectedIndex = self.selectedIndex
|
||||||
if let (cameraItem, _) = self.cameraItemAndAction {
|
if let (cameraItem, _) = self.cameraItemAndAction {
|
||||||
if let cameraItemIndex = self.tabBarControllerNode.tabBarNode.tabBarItems.firstIndex(where: { $0.item === cameraItem }) {
|
if let cameraItemIndex = self.tabBarControllerNode.tabBarNode.tabBarItems.firstIndex(where: { $0.item === cameraItem }) {
|
||||||
@ -389,7 +394,9 @@ open class TabBarControllerImpl: ViewController, TabBarController {
|
|||||||
let commit = self.tabBarControllerNode.setCurrentControllerNode(currentController.displayNode)
|
let commit = self.tabBarControllerNode.setCurrentControllerNode(currentController.displayNode)
|
||||||
if animated {
|
if animated {
|
||||||
currentController.view.layer.animateScale(from: transitionSale, to: 1.0, duration: 0.15, delay: 0.15, timingFunction: kCAMediaTimingFunctionSpring)
|
currentController.view.layer.animateScale(from: transitionSale, to: 1.0, duration: 0.15, delay: 0.15, timingFunction: kCAMediaTimingFunctionSpring)
|
||||||
|
currentController.view.layer.allowsGroupOpacity = true
|
||||||
currentController.view.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.15, completion: { _ in
|
currentController.view.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.15, completion: { _ in
|
||||||
|
currentController.view.layer.allowsGroupOpacity = false
|
||||||
commit()
|
commit()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user