Various fixes

This commit is contained in:
Ilya Laktyushin 2022-05-01 00:43:58 +04:00
parent f0c7da8493
commit ed5f2636aa
8 changed files with 27 additions and 12 deletions

View File

@ -1365,7 +1365,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
currentSecretIconImage = PresentationResourcesChatList.secretIcon(item.presentationData.theme)
}
var credibilityIconOffset: CGFloat = 0.0
if !isPeerGroup {
if !isPeerGroup && item.index.messageIndex.id.peerId != item.context.account.peerId {
if displayAsMessage {
switch item.content {
case let .peer(messages, _, _, _, _, _, _, _, _, _, _, _, _):

View File

@ -470,8 +470,15 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
})
} else {
if let fromValue = fromValue {
if viewTreeContainsFirstResponder(view: fromValue.value.view) {
self.ignoreInputHeight = true
}
fromValue.value.viewWillLeaveNavigation()
fromValue.value.viewWillDisappear(false)
self.keyboardViewManager?.dismissEditingWithoutAnimation(view: fromValue.value.view)
fromValue.value.setIgnoreAppearanceMethodInvocations(true)
fromValue.value.displayNode.removeFromSupernode()
fromValue.value.setIgnoreAppearanceMethodInvocations(false)
@ -487,6 +494,7 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
toValue.value.displayNode.recursivelyEnsureDisplaySynchronously(true)
toValue.value.viewDidAppear(false)
}
self.ignoreInputHeight = false
}
}

View File

@ -60,7 +60,7 @@ typedef enum {
- (id<LegacyComponentsAccessChecker>)accessChecker;
- (id<SDisposable>)requestAudioSession:(TGAudioSessionType)type interrupted:(void (^)())interrupted;
- (id<SDisposable>)requestAudioSession:(TGAudioSessionType)type activated:(void (^)())activated interrupted:(void (^)())interrupted;
- (SThreadPool *)sharedMediaImageProcessingThreadPool;
- (TGMemoryImageCache *)sharedMediaMemoryImageCache;

View File

@ -367,7 +367,7 @@ const NSInteger PGCameraFrameRate = 30;
_hasAudioSession = true;
[_audioSessionQueue dispatchSync:^
{
[_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayAndRecord interrupted:nil]];
[_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayAndRecord activated:nil interrupted:nil]];
}];
}

View File

@ -1120,7 +1120,7 @@
__weak TGMediaPickerGalleryVideoItemView *weakSelf = self;
[[SQueue concurrentDefaultQueue] dispatch:^
{
[_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayVideo interrupted:^
[_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayVideo activated:nil interrupted:^
{
TGDispatchOnMainThread(^
{

View File

@ -572,10 +572,6 @@ typedef enum
[self _transitionIn];
[self _beginAudioSession:false];
[_queue dispatch:^
{
[_capturePipeline startRunning];
}];
}
- (void)viewDidAppear:(BOOL)animated
@ -1308,7 +1304,16 @@ typedef enum
_otherAudioPlaying = [[AVAudioSession sharedInstance] isOtherAudioPlaying];
__weak TGVideoMessageCaptureController *weakSelf = self;
id<SDisposable> disposable = [[LegacyComponentsGlobals provider] requestAudioSession:speaker ? TGAudioSessionTypePlayAndRecordHeadphones : TGAudioSessionTypePlayAndRecord interrupted:^
id<SDisposable> disposable = [[LegacyComponentsGlobals provider] requestAudioSession:speaker ? TGAudioSessionTypePlayAndRecordHeadphones : TGAudioSessionTypePlayAndRecord
activated:^{
__strong TGVideoMessageCaptureController *strongSelf = weakSelf;
if (strongSelf != nil) {
[strongSelf->_queue dispatch:^
{
[strongSelf->_capturePipeline startRunning];
}];
}
} interrupted:^
{
TGDispatchOnMainThread(^{
__strong TGVideoMessageCaptureController *strongSelf = weakSelf;

View File

@ -177,7 +177,7 @@ private final class LegacyComponentsGlobalsProviderImpl: NSObject, LegacyCompone
return LegacyComponentsAccessCheckerImpl(context: legacyContext)
}
public func request(_ type: TGAudioSessionType, interrupted: (() -> Void)!) -> SDisposable! {
public func request(_ type: TGAudioSessionType, activated: (() -> Void)!, interrupted: (() -> Void)!) -> SDisposable! {
if let legacyContext = legacyContext {
let convertedType: ManagedAudioSessionType
switch type {
@ -187,6 +187,7 @@ private final class LegacyComponentsGlobalsProviderImpl: NSObject, LegacyCompone
convertedType = .play
}
let disposable = legacyContext.sharedContext.mediaManager.audioSession.push(audioSessionType: convertedType, once: true, activate: { _ in
activated?()
}, deactivate: { _ in
interrupted?()
return .complete()

View File

@ -177,8 +177,8 @@ private final class StickerPackContainer: ASDisplayNode {
self.addSubnode(self.backgroundNode)
self.addSubnode(self.gridNode)
// self.addSubnode(self.actionAreaBackgroundNode)
// self.addSubnode(self.actionAreaSeparatorNode)
self.addSubnode(self.actionAreaBackgroundNode)
self.addSubnode(self.actionAreaSeparatorNode)
self.addSubnode(self.buttonNode)
self.addSubnode(self.titleBackgroundnode)