mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Transcription animation improvements
This commit is contained in:
parent
f581695640
commit
7cb9f925bd
@ -4239,9 +4239,9 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
|
||||
if itemNode.apparentFrame.maxY <= visualInsets.top {
|
||||
offsetRanges.offset(IndexRange(first: 0, last: index), offset: -apparentHeightDelta)
|
||||
} else if invertOffsetDirection {
|
||||
if itemNode.apparentFrame.minY - apparentHeightDelta < visualInsets.top {
|
||||
let overflowOffset = visualInsets.top - (itemNode.apparentFrame.minY - apparentHeightDelta)
|
||||
} else if invertOffsetDirection /*&& itemNode.frame.height < self.visibleSize.height*/ {
|
||||
if self.scroller.contentOffset.y < 1.0 {
|
||||
/*let overflowOffset = visualInsets.top - (itemNode.apparentFrame.minY - apparentHeightDelta)
|
||||
let remainingOffset = apparentHeightDelta - overflowOffset
|
||||
offsetRanges.offset(IndexRange(first: 0, last: index), offset: -remainingOffset)
|
||||
|
||||
@ -4255,6 +4255,18 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
}
|
||||
}
|
||||
|
||||
offsetRanges.offset(IndexRange(first: index + 1, last: Int.max), offset: offsetDelta)*/
|
||||
|
||||
var offsetDelta = apparentHeightDelta
|
||||
if offsetDelta < 0.0 {
|
||||
let maxDelta = visualInsets.top - itemNode.apparentFrame.maxY
|
||||
if maxDelta > offsetDelta {
|
||||
let remainingOffset = maxDelta - offsetDelta
|
||||
offsetRanges.offset(IndexRange(first: 0, last: index), offset: remainingOffset)
|
||||
offsetDelta = maxDelta
|
||||
}
|
||||
}
|
||||
|
||||
offsetRanges.offset(IndexRange(first: index + 1, last: Int.max), offset: offsetDelta)
|
||||
} else {
|
||||
offsetRanges.offset(IndexRange(first: 0, last: index), offset: -apparentHeightDelta)
|
||||
|
@ -812,7 +812,7 @@ struct ListViewState {
|
||||
for node in self.nodes {
|
||||
i += 1
|
||||
if node.index == itemIndex {
|
||||
if isAnimated {
|
||||
if !isAnimated {
|
||||
let offsetDirection: ListViewInsertionOffsetDirection
|
||||
if let direction = direction {
|
||||
offsetDirection = ListViewInsertionOffsetDirection(direction)
|
||||
|
@ -42,7 +42,11 @@ private func transcribedText(message: Message) -> TranscribedText? {
|
||||
if !attribute.text.isEmpty {
|
||||
return .success(text: attribute.text, isPending: attribute.isPending)
|
||||
} else {
|
||||
return .error
|
||||
if attribute.isPending {
|
||||
return nil
|
||||
} else {
|
||||
return .error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user