mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
b4f359a8e7
commit
071ecf8a60
@ -8854,6 +8854,9 @@ Sorry for the inconvenience.";
|
||||
"DataUsage.TopSectionMobile" = "Mobile";
|
||||
"DataUsage.TopSectionWifi" = "Wifi";
|
||||
|
||||
"DataUsage.Title" = "Data Usage";
|
||||
"DataUsage.NoDataUsed" = "No Data Used";
|
||||
|
||||
"Translation.Language.en" = "English";
|
||||
"Translation.Language.ar" = "Arabic";
|
||||
"Translation.Language.zh" = "Chinese";
|
||||
|
@ -967,9 +967,15 @@ public class AttachmentController: ViewController {
|
||||
private var validLayout: ContainerViewLayout?
|
||||
|
||||
override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
|
||||
let previousSize = self.validLayout?.size
|
||||
super.containerLayoutUpdated(layout, transition: transition)
|
||||
|
||||
self.validLayout = layout
|
||||
if let previousSize, previousSize != layout.size {
|
||||
Queue.mainQueue().after(0.1) {
|
||||
self.node.containerLayoutUpdated(layout, transition: transition)
|
||||
}
|
||||
}
|
||||
self.node.containerLayoutUpdated(layout, transition: transition)
|
||||
}
|
||||
|
||||
|
@ -771,7 +771,14 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
return componentView.findTitleView()
|
||||
}
|
||||
|
||||
private var previousEmojiSetupTimestamp: Double?
|
||||
private func openStatusSetup(sourceView: UIView) {
|
||||
let currentTimestamp = CACurrentMediaTime()
|
||||
if let previousTimestamp = self.previousEmojiSetupTimestamp, currentTimestamp < previousTimestamp + 1.0 {
|
||||
return
|
||||
}
|
||||
self.previousEmojiSetupTimestamp = currentTimestamp
|
||||
|
||||
self.emojiStatusSelectionController?.dismiss()
|
||||
var selectedItems = Set<MediaId>()
|
||||
var topStatusTitle = self.presentationData.strings.PeerStatusSetup_NoTimerTitle
|
||||
|
@ -2115,9 +2115,17 @@ public final class StickerPackScreenImpl: ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private var validLayout: ContainerViewLayout?
|
||||
override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
|
||||
let previousSize = self.validLayout?.size
|
||||
super.containerLayoutUpdated(layout, transition: transition)
|
||||
|
||||
self.validLayout = layout
|
||||
if let previousSize, previousSize != layout.size {
|
||||
Queue.mainQueue().after(0.1) {
|
||||
self.controllerNode.containerLayoutUpdated(layout, transition: transition)
|
||||
}
|
||||
}
|
||||
self.controllerNode.containerLayoutUpdated(layout, transition: transition)
|
||||
}
|
||||
}
|
||||
|
@ -570,6 +570,17 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
|
||||
|
||||
private weak var currentUndoOverlayController: UndoOverlayController?
|
||||
|
||||
private var choosingStickerDisposable: Disposable?
|
||||
private var scrollingStickersGridPromise = Promise<Bool>(false)
|
||||
private var previewingStickersPromise = ValuePromise<Bool>(false)
|
||||
private var choosingSticker: Signal<Bool, NoError> {
|
||||
return combineLatest(self.scrollingStickersGridPromise.get(), self.previewingStickersPromise.get())
|
||||
|> map { scrollingStickersGrid, previewingStickers -> Bool in
|
||||
return scrollingStickersGrid || previewingStickers
|
||||
}
|
||||
|> distinctUntilChanged
|
||||
}
|
||||
|
||||
public init(context: AccountContext, currentInputData: InputData, updatedInputData: Signal<InputData, NoError>, defaultToEmojiTab: Bool, opaqueTopPanelBackground: Bool = false, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?, chatPeerId: PeerId?) {
|
||||
self.context = context
|
||||
self.currentInputData = currentInputData
|
||||
@ -679,7 +690,10 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
|
||||
},
|
||||
presentController: controllerInteraction.presentController,
|
||||
presentGlobalOverlayController: controllerInteraction.presentGlobalOverlayController,
|
||||
navigationController: controllerInteraction.navigationController
|
||||
navigationController: controllerInteraction.navigationController,
|
||||
updateIsPreviewing: { [weak self] value in
|
||||
self?.previewingStickersPromise.set(value)
|
||||
}
|
||||
),
|
||||
chatPeerId: chatPeerId,
|
||||
present: { c, a in
|
||||
@ -1670,6 +1684,13 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
self.choosingStickerDisposable = (self.choosingSticker
|
||||
|> deliverOnMainQueue).start(next: { [weak self] value in
|
||||
if let strongSelf = self {
|
||||
strongSelf.controllerInteraction?.updateChoosingSticker(value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
deinit {
|
||||
@ -1677,6 +1698,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
|
||||
self.hasRecentGifsDisposable?.dispose()
|
||||
self.emojiSearchDisposable.dispose()
|
||||
self.stickerSearchDisposable.dispose()
|
||||
self.choosingStickerDisposable?.dispose()
|
||||
}
|
||||
|
||||
private func reloadGifContext() {
|
||||
@ -1772,6 +1794,10 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
|
||||
stickerContent?.inputInteractionHolder.inputInteraction = self.stickerInputInteraction
|
||||
self.currentInputData.emoji?.inputInteractionHolder.inputInteraction = self.emojiInputInteraction
|
||||
|
||||
if let stickerInputInteraction = self.stickerInputInteraction {
|
||||
self.scrollingStickersGridPromise.set(stickerInputInteraction.scrollingStickersGridPromise.get())
|
||||
}
|
||||
|
||||
let startTime = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
var keyboardBottomInset = bottomInset
|
||||
@ -2466,8 +2492,9 @@ public final class EmojiContentPeekBehaviorImpl: EmojiContentPeekBehavior {
|
||||
public let presentController: (ViewController, Any?) -> Void
|
||||
public let presentGlobalOverlayController: (ViewController, Any?) -> Void
|
||||
public let navigationController: () -> NavigationController?
|
||||
public let updateIsPreviewing: (Bool) -> Void
|
||||
|
||||
public init(sendSticker: @escaping (FileMediaReference, Bool, Bool, String?, Bool, UIView, CGRect, CALayer?, [ItemCollectionId]) -> Bool, sendEmoji: @escaping (TelegramMediaFile) -> Void, setStatus: @escaping (TelegramMediaFile) -> Void, copyEmoji: @escaping (TelegramMediaFile) -> Void, presentController: @escaping (ViewController, Any?) -> Void, presentGlobalOverlayController: @escaping (ViewController, Any?) -> Void, navigationController: @escaping () -> NavigationController?) {
|
||||
public init(sendSticker: @escaping (FileMediaReference, Bool, Bool, String?, Bool, UIView, CGRect, CALayer?, [ItemCollectionId]) -> Bool, sendEmoji: @escaping (TelegramMediaFile) -> Void, setStatus: @escaping (TelegramMediaFile) -> Void, copyEmoji: @escaping (TelegramMediaFile) -> Void, presentController: @escaping (ViewController, Any?) -> Void, presentGlobalOverlayController: @escaping (ViewController, Any?) -> Void, navigationController: @escaping () -> NavigationController?, updateIsPreviewing: @escaping (Bool) -> Void) {
|
||||
self.sendSticker = sendSticker
|
||||
self.sendEmoji = sendEmoji
|
||||
self.setStatus = setStatus
|
||||
@ -2475,6 +2502,7 @@ public final class EmojiContentPeekBehaviorImpl: EmojiContentPeekBehavior {
|
||||
self.presentController = presentController
|
||||
self.presentGlobalOverlayController = presentGlobalOverlayController
|
||||
self.navigationController = navigationController
|
||||
self.updateIsPreviewing = updateIsPreviewing
|
||||
}
|
||||
}
|
||||
|
||||
@ -2772,11 +2800,12 @@ public final class EmojiContentPeekBehaviorImpl: EmojiContentPeekBehavior {
|
||||
let controller = PeekController(presentationData: presentationData, content: content, sourceView: {
|
||||
return (sourceView, sourceRect)
|
||||
})
|
||||
/*controller.visibilityUpdated = { [weak self] visible in
|
||||
self?.previewingStickersPromise.set(visible)
|
||||
self?.requestDisableStickerAnimations?(visible)
|
||||
self?.simulateUpdateLayout(isVisible: !visible)
|
||||
}*/
|
||||
controller.visibilityUpdated = { [weak self] visible in
|
||||
guard let strongSelf = self, let interaction = strongSelf.interaction else {
|
||||
return
|
||||
}
|
||||
interaction.updateIsPreviewing(visible)
|
||||
}
|
||||
strongSelf.peekController = controller
|
||||
strongSelf.present(controller, nil)
|
||||
return controller
|
||||
|
@ -2311,6 +2311,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||
public weak var externalExpansionView: UIView?
|
||||
public let useOpaqueTheme: Bool
|
||||
public let hideBackground: Bool
|
||||
public let scrollingStickersGridPromise = ValuePromise<Bool>(false)
|
||||
|
||||
public init(
|
||||
performItemAction: @escaping (AnyHashable, Item, UIView, CGRect, CALayer, Bool) -> Void,
|
||||
@ -5188,6 +5189,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||
self.visibleSearchHeader?.deactivate()
|
||||
}
|
||||
self.component?.inputInteractionHolder.inputInteraction?.onScroll()
|
||||
self.component?.inputInteractionHolder.inputInteraction?.scrollingStickersGridPromise.set(true)
|
||||
}
|
||||
|
||||
public func ensureSearchUnfocused() {
|
||||
@ -5217,11 +5219,13 @@ public final class EmojiPagerContentComponent: Component {
|
||||
public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
|
||||
if !decelerate {
|
||||
self.snapScrollingOffsetToInsets()
|
||||
self.component?.inputInteractionHolder.inputInteraction?.scrollingStickersGridPromise.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
||||
self.snapScrollingOffsetToInsets()
|
||||
self.component?.inputInteractionHolder.inputInteraction?.scrollingStickersGridPromise.set(false)
|
||||
}
|
||||
|
||||
private func updateScrollingOffset(isReset: Bool, transition: Transition) {
|
||||
|
@ -783,9 +783,9 @@ final class DataUsageScreenComponent: Component {
|
||||
|
||||
let headerText: String
|
||||
if totalSize == 0 {
|
||||
headerText = "No Data Used"
|
||||
headerText = environment.strings.DataUsage_NoDataUsed
|
||||
} else {
|
||||
headerText = "Data Usage"
|
||||
headerText = environment.strings.DataUsage_Title
|
||||
}
|
||||
let headerViewSize = self.headerView.update(
|
||||
transition: .immediate,
|
||||
@ -1125,7 +1125,7 @@ final class DataUsageScreenComponent: Component {
|
||||
transition: transition,
|
||||
component: AnyComponent(DataButtonComponent(
|
||||
theme: environment.theme,
|
||||
title: "Reset Statistics",
|
||||
title: environment.strings.NetworkUsageSettings_ResetStats,
|
||||
action: { [weak self] in
|
||||
self?.requestClear()
|
||||
}
|
||||
|
@ -391,11 +391,11 @@ class ChatMessageInstantVideoBubbleContentNode: ChatMessageBubbleContentNode {
|
||||
}
|
||||
|
||||
override func willUpdateIsExtractedToContextPreview(_ value: Bool) {
|
||||
// self.interactiveFileNode.willUpdateIsExtractedToContextPreview(value)
|
||||
self.interactiveFileNode.willUpdateIsExtractedToContextPreview(value)
|
||||
}
|
||||
|
||||
override func updateIsExtractedToContextPreview(_ value: Bool) {
|
||||
// self.interactiveFileNode.updateIsExtractedToContextPreview(value)
|
||||
self.interactiveFileNode.updateIsExtractedToContextPreview(value)
|
||||
}
|
||||
|
||||
override func tapActionAtPoint(_ point: CGPoint, gesture: TapLongTapOrDoubleTapGesture, isEstimating: Bool) -> ChatMessageBubbleContentTapAction {
|
||||
|
@ -2,6 +2,7 @@ import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
import SwiftSignalKit
|
||||
import TelegramCore
|
||||
import TelegramPresentationData
|
||||
import ContextUI
|
||||
@ -133,8 +134,15 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode {
|
||||
|
||||
private var absoluteRect: (CGRect, CGSize)?
|
||||
func updateAbsoluteRect(_ rect: CGRect, within containerSize: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
let previousContaierSize = self.absoluteRect?.1
|
||||
self.absoluteRect = (rect, containerSize)
|
||||
self.backdropNode.update(rect: rect, within: containerSize, transition: transition)
|
||||
|
||||
if let previousContaierSize, previousContaierSize != containerSize {
|
||||
Queue.mainQueue().after(0.2) {
|
||||
self.micButton.reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func updateLayout(size: CGSize, isMediaInputExpanded: Bool, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState) {
|
||||
|
@ -131,10 +131,6 @@ private final class ChatTextInputMediaRecordingButtonPresenter : NSObject, TGMod
|
||||
|
||||
func present() {
|
||||
let windowIsVisible: (UIWindow) -> Bool = { window in
|
||||
print(window.alpha)
|
||||
print(window.isHidden)
|
||||
print(window.frame)
|
||||
print(window.subviews)
|
||||
return !window.frame.height.isZero
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user