Various fixes

This commit is contained in:
Ilya Laktyushin
2023-11-26 20:11:40 +04:00
parent fcee7416e5
commit 6ec58eb9b4
5 changed files with 41 additions and 7 deletions

View File

@@ -10548,3 +10548,7 @@ Sorry for the inconvenience.";
"MediaEditor.VideoRemovalConfirmation" = "Are you sure you want to delete video message?";
"MediaEditor.HoldToRecordVideo" = "Hold to record video";
"Chat.ChannelRecommendation.PremiumTooltip" = "Subcribe to [Telegram Premium]() to unlock up to **100** channels.";
"Story.ForwardAuthorHiddenTooltip" = "The account was hidden by the user";

View File

@@ -563,6 +563,27 @@ static const CGFloat outerCircleMinScale = innerCircleRadius / outerCircleRadius
_hidesPanelOnLock = true;
}
+ (UIImage *)stopIconImage
{
static dispatch_once_t onceToken;
static UIImage *iconImage;
dispatch_once(&onceToken, ^
{
CGRect rect = CGRectMake(0, 0, 22.0f, 22.0f);
UIGraphicsBeginImageContextWithOptions(rect.size, false, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddPath(context, [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 22, 22) cornerRadius:7].CGPath);
CGContextSetFillColorWithColor(context, UIColorRGBA(0x0ffffff, 1.3f).CGColor);
CGContextFillPath(context);
iconImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
});
return iconImage;
}
- (void)animateLock {
if (!_animatedIn) {
return;
@@ -575,8 +596,9 @@ static const CGFloat outerCircleMinScale = innerCircleRadius / outerCircleRadius
snapshotView.frame = _innerIconView.frame;
[_innerIconWrapperView insertSubview:snapshotView atIndex:0];
UIImage *icon = _hidesPanelOnLock ? [TGModernConversationInputMicButton stopIconImage] : TGComponentsImageNamed(@"RecordSendIcon");
_previousIcon = _innerIconView.image;
[self setIcon:TGTintedImage(TGComponentsImageNamed(@"RecordSendIcon"), _pallete != nil ? _pallete.iconColor : [UIColor whiteColor])];
[self setIcon:TGTintedImage(icon, _pallete != nil && !_hidesPanelOnLock ? _pallete.iconColor : [UIColor whiteColor])];
_currentScale = 1;
_cancelTargetTranslation = 0;

View File

@@ -342,7 +342,7 @@ public class ChatMessageJoinedChannelBubbleContentNode: ChatMessageBubbleContent
let presentationData = item.context.sharedContext.currentPresentationData.with { $0 }
let controller = UndoOverlayController(
presentationData: presentationData,
content: .premiumPaywall(title: nil, text: "Subcribe to [Telegram Premium]() to unlock up to **100** channels.", customUndoText: nil, timeout: nil, linkAction: nil),
content: .premiumPaywall(title: nil, text: item.presentationData.strings.Chat_ChannelRecommendation_PremiumTooltip, customUndoText: nil, timeout: nil, linkAction: nil),
elevatedLayout: false,
action: { [weak self] action in
if case .info = action {
@@ -680,7 +680,7 @@ private final class ChannelItemComponent: Component {
self.component = component
self.state = state
self.contextContainer.isGestureEnabled = component.contextAction != nil
self.contextContainer.isGestureEnabled = true
let titleSize = self.title.update(
transition: .immediate,

View File

@@ -674,7 +674,6 @@ final class StoryContentCaptionComponent: Component {
let authorName: String
let isChannel: Bool
let text: String?
var isEnabled = true
switch forwardInfo {
case let .known(peer, _, _):
@@ -701,7 +700,6 @@ final class StoryContentCaptionComponent: Component {
authorName = name
isChannel = false
text = ""
isEnabled = false
}
if let text {
@@ -731,9 +729,16 @@ final class StoryContentCaptionComponent: Component {
action: { [weak self] in
if let self, case let .known(peer, _, _) = forwardInfo, let story = self.forwardInfoStory {
self.component?.openStory(peer, story)
} else if let controller = self?.component?.controller() as? StoryContainerScreen {
let tooltipController = TooltipController(content: .text(component.strings.Story_ForwardAuthorHiddenTooltip), baseFontSize: 17.0, dismissByTapOutside: true, dismissImmediatelyOnLayoutUpdate: true)
controller.present(tooltipController, in: .window(.root), with: TooltipControllerPresentationArguments(sourceNodeAndRect: { [weak self, weak controller] in
if let self, let controller, let forwardInfoPanel = self.forwardInfoPanel?.view {
return (controller.node, forwardInfoPanel.convert(forwardInfoPanel.bounds, to: controller.view))
}
return nil
}))
}
},
isEnabled: isEnabled
}
)
),
environment: {},

View File

@@ -10002,6 +10002,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
}, presentController: { [weak self] controller, arguments in
self?.present(controller, in: .window(.root), with: arguments)
}, presentControllerInCurrent: { [weak self] controller, arguments in
if controller is UndoOverlayController {
self?.dismissAllTooltips()
}
self?.present(controller, in: .current, with: arguments)
}, getNavigationController: { [weak self] in
return self?.navigationController as? NavigationController