mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Update input field progress indicator
This commit is contained in:
parent
3c8bf2986b
commit
4c3fdb2733
@ -207,7 +207,7 @@ public final class ActivityIndicator: ASDisplayNode {
|
|||||||
indicatorSize = CGSize(width: diameter, height: diameter)
|
indicatorSize = CGSize(width: diameter, height: diameter)
|
||||||
shouldScale = !forceDefault
|
shouldScale = !forceDefault
|
||||||
}
|
}
|
||||||
self.indicatorNode.frame = CGRect(origin: CGPoint(x: floor((size.width - indicatorSize.width) / 2.0), y: floor((size.height - indicatorSize.height) / 2.0)), size: indicatorSize)
|
self.indicatorNode.frame = CGRect(origin: CGPoint(x: ((size.width - indicatorSize.width) / 2.0), y: ((size.height - indicatorSize.height) / 2.0)), size: indicatorSize)
|
||||||
if shouldScale, let indicatorView = self.indicatorView {
|
if shouldScale, let indicatorView = self.indicatorView {
|
||||||
let intrinsicSize = indicatorView.bounds.size
|
let intrinsicSize = indicatorView.bounds.size
|
||||||
self.subnodeTransform = CATransform3DMakeScale(min(1.0, indicatorSize.width / intrinsicSize.width), min(1.0, indicatorSize.height / intrinsicSize.height), 1.0)
|
self.subnodeTransform = CATransform3DMakeScale(min(1.0, indicatorSize.width / intrinsicSize.width), min(1.0, indicatorSize.height / intrinsicSize.height), 1.0)
|
||||||
|
@ -1433,19 +1433,18 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
|||||||
func updateIsProcessingInlineRequest(_ value: Bool) {
|
func updateIsProcessingInlineRequest(_ value: Bool) {
|
||||||
if value {
|
if value {
|
||||||
if self.searchActivityIndicator == nil, let currentState = self.presentationInterfaceState {
|
if self.searchActivityIndicator == nil, let currentState = self.presentationInterfaceState {
|
||||||
let searchActivityIndicator = ActivityIndicator(type: .custom(currentState.theme.list.itemAccentColor, 11.0, 1.0, false))
|
let searchActivityIndicator = ActivityIndicator(type: .custom(currentState.theme.list.itemAccentColor, 20.0, 1.5, true))
|
||||||
searchActivityIndicator.isUserInteractionEnabled = false
|
searchActivityIndicator.isUserInteractionEnabled = false
|
||||||
self.searchActivityIndicator = searchActivityIndicator
|
self.searchActivityIndicator = searchActivityIndicator
|
||||||
let indicatorSize = searchActivityIndicator.measure(CGSize(width: 100.0, height: 100.0))
|
let indicatorSize = searchActivityIndicator.measure(CGSize(width: 100.0, height: 100.0))
|
||||||
let size = self.searchLayoutClearButton.bounds.size
|
let size = self.searchLayoutClearButton.bounds.size
|
||||||
searchActivityIndicator.frame = CGRect(origin: CGPoint(x: floor((size.width - indicatorSize.width) / 2.0), y: floor((size.height - indicatorSize.height) / 2.0) + 1.0), size: indicatorSize)
|
searchActivityIndicator.frame = CGRect(origin: CGPoint(x: floor((size.width - indicatorSize.width) / 2.0) + 0.0, y: floor((size.height - indicatorSize.height) / 2.0) - 0.0), size: indicatorSize)
|
||||||
self.searchLayoutClearImageNode.isHidden = true
|
//self.searchLayoutClearImageNode.isHidden = true
|
||||||
self.searchLayoutClearButton.addSubnode(searchActivityIndicator)
|
self.searchLayoutClearButton.addSubnode(searchActivityIndicator)
|
||||||
//searchActivityIndicator.layer.sublayerTransform = CATransform3DMakeScale(0.5, 0.5, 1.0)
|
|
||||||
}
|
}
|
||||||
} else if let searchActivityIndicator = self.searchActivityIndicator {
|
} else if let searchActivityIndicator = self.searchActivityIndicator {
|
||||||
self.searchActivityIndicator = nil
|
self.searchActivityIndicator = nil
|
||||||
self.searchLayoutClearImageNode.isHidden = false
|
//self.searchLayoutClearImageNode.isHidden = false
|
||||||
searchActivityIndicator.removeFromSupernode()
|
searchActivityIndicator.removeFromSupernode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user