Skip to content

Commit c4013c3

Browse files
committed
Various improvements
1 parent 6b528aa commit c4013c3

File tree

22 files changed

+331
-165
lines changed

22 files changed

+331
-165
lines changed

submodules/FeaturedStickersScreen/Sources/FeaturedStickersScreen.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ private final class FeaturedPaneSearchContentNode: ASDisplayNode {
12441244

12451245
let query = text.trimmingCharacters(in: .whitespacesAndNewlines)
12461246
if query.isSingleEmoji {
1247-
signals = .single([context.engine.stickers.searchStickers(query: [text.basicEmoji.0])
1247+
signals = .single([context.engine.stickers.searchStickers(query: nil, emoticon: [text.basicEmoji.0], inputLanguageCode: "")
12481248
|> map { (nil, $0.items) }])
12491249
} else if query.count > 1, let languageCode = languageCode, !languageCode.isEmpty && languageCode != "emoji" {
12501250
var signal = context.engine.stickers.searchEmojiKeywords(inputLanguageCode: languageCode, query: query.lowercased(), completeMatch: query.count < 3)
@@ -1260,17 +1260,11 @@ private final class FeaturedPaneSearchContentNode: ASDisplayNode {
12601260
)
12611261
}
12621262
}
1263-
12641263
signals = signal
12651264
|> map { keywords -> [Signal<(String?, [FoundStickerItem]), NoError>] in
1266-
var signals: [Signal<(String?, [FoundStickerItem]), NoError>] = []
1267-
let emoticons = keywords.flatMap { $0.emoticons }
1268-
for emoji in emoticons {
1269-
signals.append(context.engine.stickers.searchStickers(query: [emoji.basicEmoji.0])
1270-
|> take(1)
1271-
|> map { (emoji, $0.items) })
1272-
}
1273-
return signals
1265+
let emoticon = keywords.flatMap { $0.emoticons }.map { $0.basicEmoji.0 }
1266+
return [context.engine.stickers.searchStickers(query: query, emoticon: emoticon, inputLanguageCode: languageCode)
1267+
|> map { (nil, $0.items) }]
12741268
}
12751269
}
12761270

submodules/LegacyComponents/Sources/TGMediaPickerGalleryInterfaceView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
14281428
|| [view isDescendantOfView:_landscapeToolbarView]
14291429
|| [view isDescendantOfView:_selectedPhotosView]
14301430
|| [view isDescendantOfView:_captionMixin.inputPanelView]
1431-
|| [view isDescendantOfView:_captionMixin.dismissView]
1431+
|| ([view isDescendantOfView:_captionMixin.dismissView] && _captionMixin.dismissView.alpha > 0.0)
14321432
|| [view isKindOfClass:[TGMenuButtonView class]])
14331433

14341434
{

submodules/LegacyComponents/Sources/TGMediaPickerGalleryVideoScrubber.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ - (instancetype)initWithFrame:(CGRect)frame
100100
_currentTimeLabel.text = @"0:00";
101101
_currentTimeLabel.textColor = [UIColor whiteColor];
102102
_currentTimeLabel.layer.shadowOffset = CGSizeMake(0.0, 0.0);
103-
_currentTimeLabel.layer.shadowRadius = 2.0;
103+
_currentTimeLabel.layer.shadowRadius = 4.0;
104104
_currentTimeLabel.layer.shadowColor = [UIColor blackColor].CGColor;
105-
_currentTimeLabel.layer.shadowOpacity = 0.4;
105+
_currentTimeLabel.layer.shadowOpacity = 0.6;
106106
_currentTimeLabel.layer.rasterizationScale = TGScreenScaling();
107107
_currentTimeLabel.layer.shouldRasterize = true;
108108
[self addSubview:_currentTimeLabel];
@@ -115,9 +115,9 @@ - (instancetype)initWithFrame:(CGRect)frame
115115
_inverseTimeLabel.textAlignment = NSTextAlignmentRight;
116116
_inverseTimeLabel.textColor = [UIColor whiteColor];
117117
_inverseTimeLabel.layer.shadowOffset = CGSizeMake(0.0, 0.0);
118-
_inverseTimeLabel.layer.shadowRadius = 2.0;
118+
_inverseTimeLabel.layer.shadowRadius = 4.0;
119119
_inverseTimeLabel.layer.shadowColor = [UIColor blackColor].CGColor;
120-
_inverseTimeLabel.layer.shadowOpacity = 0.4;
120+
_inverseTimeLabel.layer.shadowOpacity = 0.6;
121121
_inverseTimeLabel.layer.rasterizationScale = TGScreenScaling();
122122
_inverseTimeLabel.layer.shouldRasterize = true;
123123
[self addSubview:_inverseTimeLabel];

submodules/LegacyComponents/Sources/TGPhotoCaptionInputMixin.m

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ - (void)createInputPanelIfNeeded
6161
_inputPanel.sendPressed = ^(NSAttributedString *string) {
6262
__strong TGPhotoCaptionInputMixin *strongSelf = weakSelf;
6363
[TGViewController enableAutorotation];
64-
strongSelf->_dismissView.hidden = true;
6564

6665
strongSelf->_editing = false;
6766

@@ -74,9 +73,7 @@ - (void)createInputPanelIfNeeded
7473
[TGViewController disableAutorotation];
7574

7675
[strongSelf beginEditing];
77-
78-
strongSelf->_dismissView.hidden = false;
79-
76+
8077
if (strongSelf.panelFocused != nil)
8178
strongSelf.panelFocused();
8279

@@ -129,12 +126,13 @@ - (void)createDismissViewIfNeeded
129126

130127
_dismissView = [[UIView alloc] initWithFrame:parentView.bounds];
131128
_dismissView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
129+
_dismissView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.4];
132130

133131
_dismissTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDismissTap:)];
134132
_dismissTapRecognizer.enabled = false;
135133
[_dismissView addGestureRecognizer:_dismissTapRecognizer];
136134

137-
//[parentView insertSubview:_dismissView belowSubview:_backgroundView];
135+
[parentView insertSubview:_dismissView belowSubview:_inputPanelView];
138136
}
139137

140138
- (void)setCaption:(NSAttributedString *)caption
@@ -168,6 +166,12 @@ - (void)beginEditing
168166

169167
[self createDismissViewIfNeeded];
170168
[self createInputPanelIfNeeded];
169+
170+
_dismissView.alpha = 0.0;
171+
[UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
172+
_dismissView.alpha = 1.0f;
173+
} completion:^(BOOL finished) {
174+
}];
171175
}
172176

173177
- (void)enableDismissal
@@ -184,9 +188,7 @@ - (void)handleDismissTap:(UITapGestureRecognizer *)gestureRecognizer
184188

185189
if ([self.inputPanel dismissInput]) {
186190
_editing = false;
187-
188-
[_dismissView removeFromSuperview];
189-
191+
190192
if (self.finishedWithCaption != nil)
191193
self.finishedWithCaption([_inputPanel caption]);
192194
}
@@ -228,6 +230,19 @@ - (void)keyboardWillChangeFrame:(NSNotification *)notification
228230

229231
_keyboardHeight = keyboardHeight;
230232

233+
CGFloat fadeAlpha = 1.0;
234+
if (keyboardHeight < FLT_EPSILON) {
235+
fadeAlpha = 0.0;
236+
}
237+
238+
if (ABS(_dismissView.alpha - fadeAlpha) > FLT_EPSILON) {
239+
[UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
240+
_dismissView.alpha = fadeAlpha;
241+
} completion:^(BOOL finished) {
242+
243+
}];
244+
}
245+
231246
if (!UIInterfaceOrientationIsPortrait([[LegacyComponentsGlobals provider] applicationStatusBarOrientation]) && !TGIsPad())
232247
return;
233248

submodules/ReactionSelectionNode/Sources/ReactionContextNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ public final class ReactionContextNode: ASDisplayNode, ASScrollViewDelegate {
20282028
))
20292029
return .single(resultGroups)
20302030
} else {
2031-
let remoteSignal = context.engine.stickers.searchEmoji(emojiString: Array(allEmoticons.keys))
2031+
let remoteSignal = context.engine.stickers.searchEmoji(query: query, emoticon: Array(allEmoticons.keys), inputLanguageCode: languageCode)
20322032

20332033
return combineLatest(
20342034
context.account.postbox.itemCollectionsView(orderedItemListCollectionIds: [], namespaces: [Namespaces.ItemCollection.CloudEmojiPacks], aroundIndex: nil, count: 10000000) |> take(1),

submodules/StatisticsUI/Sources/ChannelStatsController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,9 +1608,9 @@ private func monetizationEntries(
16081608

16091609
if canViewRevenue {
16101610
entries.append(.adsTonBalanceTitle(presentationData.theme, isBot ? presentationData.strings.Monetization_Bot_BalanceTitle : presentationData.strings.Monetization_TonBalanceTitle))
1611-
entries.append(.adsTonBalance(presentationData.theme, data, isCreator && data.balances.availableBalance > 0, data.balances.withdrawEnabled))
1611+
entries.append(.adsTonBalance(presentationData.theme, data, (isCreator || isBot) && data.balances.availableBalance > 0, data.balances.withdrawEnabled))
16121612

1613-
if isCreator {
1613+
if isCreator || isBot {
16141614
let withdrawalInfoText: String
16151615
if data.balances.availableBalance == 0 {
16161616
withdrawalInfoText = presentationData.strings.Monetization_Balance_ZeroInfo

submodules/TelegramCore/Sources/State/Serialization.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public class BoxedMessage: NSObject {
210210

211211
public class Serialization: NSObject, MTSerialization {
212212
public func currentLayer() -> UInt {
213-
return 193
213+
return 195
214214
}
215215

216216
public func parseMessage(_ data: Data!) -> Any! {

0 commit comments

Comments
 (0)