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
9b011942e8
commit
779e90dffe
@ -9798,3 +9798,9 @@ Sorry for the inconvenience.";
|
|||||||
"Premium.MaxStoriesMonthlyFinalText" = "You have reached the limit of **%@** stories per month.";
|
"Premium.MaxStoriesMonthlyFinalText" = "You have reached the limit of **%@** stories per month.";
|
||||||
|
|
||||||
"MediaPicker.Recents" = "Recents";
|
"MediaPicker.Recents" = "Recents";
|
||||||
|
|
||||||
|
"Location.AddThisLocation" = "Add This Location";
|
||||||
|
"Location.AddMyLocation" = "Add My Current Location";
|
||||||
|
"Location.TypeCity" = "City";
|
||||||
|
"Location.TypeStreet" = "Street";
|
||||||
|
"Location.TypeLocation" = "Location";
|
||||||
|
@ -224,8 +224,13 @@ public final class DrawingLocationEntityView: DrawingEntityView, UITextViewDeleg
|
|||||||
case .black, .transparent, .blur:
|
case .black, .transparent, .blur:
|
||||||
textColor = .white
|
textColor = .white
|
||||||
case .custom:
|
case .custom:
|
||||||
|
let color = self.locationEntity.color.toUIColor()
|
||||||
|
if color.lightness > 0.705 {
|
||||||
|
textColor = .black
|
||||||
|
} else {
|
||||||
textColor = .white
|
textColor = .white
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
text.addAttribute(.foregroundColor, value: textColor, range: range)
|
text.addAttribute(.foregroundColor, value: textColor, range: range)
|
||||||
|
|
||||||
@ -256,8 +261,15 @@ public final class DrawingLocationEntityView: DrawingEntityView, UITextViewDeleg
|
|||||||
self.backgroundView.isHidden = false
|
self.backgroundView.isHidden = false
|
||||||
self.blurredBackgroundView.isHidden = true
|
self.blurredBackgroundView.isHidden = true
|
||||||
case .custom:
|
case .custom:
|
||||||
self.textView.textColor = .white
|
let color = self.locationEntity.color.toUIColor()
|
||||||
self.backgroundView.backgroundColor = self.locationEntity.color.toUIColor()
|
let textColor: UIColor
|
||||||
|
if color.lightness > 0.705 {
|
||||||
|
textColor = .black
|
||||||
|
} else {
|
||||||
|
textColor = .white
|
||||||
|
}
|
||||||
|
self.textView.textColor = textColor
|
||||||
|
self.backgroundView.backgroundColor = color
|
||||||
self.backgroundView.isHidden = false
|
self.backgroundView.isHidden = false
|
||||||
self.blurredBackgroundView.isHidden = true
|
self.blurredBackgroundView.isHidden = true
|
||||||
case .blur:
|
case .blur:
|
||||||
|
@ -134,7 +134,7 @@ public struct VenueIconArguments: TransformImageCustomArguments {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func venueIcon(engine: TelegramEngine, type: String, background: Bool) -> Signal<(TransformImageArguments) -> DrawingContext?, NoError> {
|
public func venueIcon(engine: TelegramEngine, type: String, flag: String? = nil, background: Bool) -> Signal<(TransformImageArguments) -> DrawingContext?, NoError> {
|
||||||
let isBuiltinIcon = ["", "home", "work"].contains(type)
|
let isBuiltinIcon = ["", "home", "work"].contains(type)
|
||||||
let data: Signal<Data?, NoError> = isBuiltinIcon ? .single(nil) : venueIconData(engine: engine, resource: VenueIconResource(type: type))
|
let data: Signal<Data?, NoError> = isBuiltinIcon ? .single(nil) : venueIconData(engine: engine, resource: VenueIconResource(type: type))
|
||||||
return data |> map { data in
|
return data |> map { data in
|
||||||
|
@ -620,10 +620,10 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
|
|||||||
case .share:
|
case .share:
|
||||||
if source == .story {
|
if source == .story {
|
||||||
if let initialLocation = strongSelf.controller?.initialLocation {
|
if let initialLocation = strongSelf.controller?.initialLocation {
|
||||||
title = "Add This Location"
|
title = presentationData.strings.Location_AddThisLocation
|
||||||
coordinate = initialLocation
|
coordinate = initialLocation
|
||||||
} else {
|
} else {
|
||||||
title = "Add My Current Location"
|
title = presentationData.strings.Location_AddMyLocation
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
title = presentationData.strings.Map_SendMyCurrentLocation
|
title = presentationData.strings.Map_SendMyCurrentLocation
|
||||||
@ -633,10 +633,10 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
|
|||||||
}
|
}
|
||||||
if source == .story {
|
if source == .story {
|
||||||
if state.city != "" {
|
if state.city != "" {
|
||||||
entries.append(.city(presentationData.theme, state.city ?? presentationData.strings.Map_Locating, "City", nil, nil, nil, coordinate, state.city, state.countryCode))
|
entries.append(.city(presentationData.theme, state.city ?? presentationData.strings.Map_Locating, presentationData.strings.Location_TypeCity, nil, nil, nil, coordinate, state.city, state.countryCode))
|
||||||
}
|
}
|
||||||
if state.street != "" {
|
if state.street != "" {
|
||||||
entries.append(.location(presentationData.theme, state.street ?? presentationData.strings.Map_Locating, state.isStreet ? "Street" : "Location", nil, nil, nil, coordinate, state.street, nil, false))
|
entries.append(.location(presentationData.theme, state.street ?? presentationData.strings.Map_Locating, state.isStreet ? presentationData.strings.Location_TypeStreet : presentationData.strings.Location_TypeLocation, nil, nil, nil, coordinate, state.street, nil, false))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
entries.append(.location(presentationData.theme, title, (userLocation?.horizontalAccuracy).flatMap { presentationData.strings.Map_AccurateTo(stringForDistance(strings: presentationData.strings, distance: $0)).string } ?? presentationData.strings.Map_Locating, nil, nil, nil, coordinate, state.street, nil, true))
|
entries.append(.location(presentationData.theme, title, (userLocation?.horizontalAccuracy).flatMap { presentationData.strings.Map_AccurateTo(stringForDistance(strings: presentationData.strings, distance: $0)).string } ?? presentationData.strings.Map_Locating, nil, nil, nil, coordinate, state.street, nil, true))
|
||||||
@ -809,7 +809,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
|
|||||||
streetName = ""
|
streetName = ""
|
||||||
}
|
}
|
||||||
if streetName == "" && cityName == "" {
|
if streetName == "" && cityName == "" {
|
||||||
streetName = "Location"
|
streetName = presentationData.strings.Location_TypeLocation
|
||||||
}
|
}
|
||||||
strongSelf.updateState { state in
|
strongSelf.updateState { state in
|
||||||
var state = state
|
var state = state
|
||||||
@ -854,7 +854,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
|
|||||||
streetName = ""
|
streetName = ""
|
||||||
}
|
}
|
||||||
if streetName == "" && cityName == "" {
|
if streetName == "" && cityName == "" {
|
||||||
streetName = "Location"
|
streetName = presentationData.strings.Location_TypeLocation
|
||||||
}
|
}
|
||||||
strongSelf.updateState { state in
|
strongSelf.updateState { state in
|
||||||
var state = state
|
var state = state
|
||||||
|
@ -86,7 +86,7 @@ final class MediaPickerTitleView: UIView {
|
|||||||
|
|
||||||
self.arrowNode = ASImageNode()
|
self.arrowNode = ASImageNode()
|
||||||
self.arrowNode.displaysAsynchronously = false
|
self.arrowNode.displaysAsynchronously = false
|
||||||
self.arrowNode.image = generateTintedImage(image: UIImage(bundleImageName: "Stories/SelectorArrowDown"), color: theme.rootController.navigationBar.secondaryTextColor)
|
self.arrowNode.image = generateTintedImage(image: UIImage(bundleImageName: "Media Editor/DownArrow"), color: theme.rootController.navigationBar.secondaryTextColor)
|
||||||
self.arrowNode.isHidden = true
|
self.arrowNode.isHidden = true
|
||||||
|
|
||||||
self.segmentedControlNode = SegmentedControlNode(theme: SegmentedControlTheme(theme: theme), items: segments.map { SegmentedControlItem(title: $0) }, selectedIndex: selectedIndex)
|
self.segmentedControlNode = SegmentedControlNode(theme: SegmentedControlTheme(theme: theme), items: segments.map { SegmentedControlItem(title: $0) }, selectedIndex: selectedIndex)
|
||||||
|
@ -743,7 +743,7 @@ final class StoryItemContentComponent: Component {
|
|||||||
if let current = self.mediaAreasEffectView {
|
if let current = self.mediaAreasEffectView {
|
||||||
mediaAreasEffectView = current
|
mediaAreasEffectView = current
|
||||||
} else {
|
} else {
|
||||||
mediaAreasEffectView = StoryItemLoadingEffectView(effectAlpha: 0.35, borderAlpha: 0.45, gradientWidth: 150.0, duration: 1.5, hasCustomBorder: false, playOnce: true)
|
mediaAreasEffectView = StoryItemLoadingEffectView(effectAlpha: 0.35, borderAlpha: 0.45, gradientWidth: 150.0, duration: 1.2, hasCustomBorder: false, playOnce: true)
|
||||||
self.mediaAreasEffectView = mediaAreasEffectView
|
self.mediaAreasEffectView = mediaAreasEffectView
|
||||||
self.addSubview(mediaAreasEffectView)
|
self.addSubview(mediaAreasEffectView)
|
||||||
}
|
}
|
||||||
|
12
submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "DownArrow.pdf",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
92
submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/DownArrow.pdf
vendored
Normal file
92
submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/DownArrow.pdf
vendored
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
%PDF-1.7
|
||||||
|
|
||||||
|
1 0 obj
|
||||||
|
<< >>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
2 0 obj
|
||||||
|
<< /Length 3 0 R >>
|
||||||
|
stream
|
||||||
|
/DeviceRGB CS
|
||||||
|
/DeviceRGB cs
|
||||||
|
q
|
||||||
|
1.000000 0.000000 0.000000 -1.000000 1.500000 7.822266 cm
|
||||||
|
0.000000 0.000000 0.000000 scn
|
||||||
|
-0.586899 2.409164 m
|
||||||
|
-0.911034 2.085029 -0.911034 1.559502 -0.586899 1.235367 c
|
||||||
|
-0.262763 0.911232 0.262763 0.911232 0.586899 1.235367 c
|
||||||
|
-0.586899 2.409164 l
|
||||||
|
h
|
||||||
|
4.500000 6.322266 m
|
||||||
|
5.086899 6.909164 l
|
||||||
|
4.762764 7.233299 4.237236 7.233299 3.913101 6.909164 c
|
||||||
|
4.500000 6.322266 l
|
||||||
|
h
|
||||||
|
8.413101 1.235367 m
|
||||||
|
8.737237 0.911232 9.262763 0.911232 9.586899 1.235367 c
|
||||||
|
9.911034 1.559502 9.911034 2.085029 9.586899 2.409164 c
|
||||||
|
8.413101 1.235367 l
|
||||||
|
h
|
||||||
|
0.586899 1.235367 m
|
||||||
|
5.086899 5.735367 l
|
||||||
|
3.913101 6.909164 l
|
||||||
|
-0.586899 2.409164 l
|
||||||
|
0.586899 1.235367 l
|
||||||
|
h
|
||||||
|
3.913101 5.735367 m
|
||||||
|
8.413101 1.235367 l
|
||||||
|
9.586899 2.409164 l
|
||||||
|
5.086899 6.909164 l
|
||||||
|
3.913101 5.735367 l
|
||||||
|
h
|
||||||
|
f
|
||||||
|
n
|
||||||
|
Q
|
||||||
|
|
||||||
|
endstream
|
||||||
|
endobj
|
||||||
|
|
||||||
|
3 0 obj
|
||||||
|
762
|
||||||
|
endobj
|
||||||
|
|
||||||
|
4 0 obj
|
||||||
|
<< /Annots []
|
||||||
|
/Type /Page
|
||||||
|
/MediaBox [ 0.000000 0.000000 12.000000 8.000000 ]
|
||||||
|
/Resources 1 0 R
|
||||||
|
/Contents 2 0 R
|
||||||
|
/Parent 5 0 R
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
5 0 obj
|
||||||
|
<< /Kids [ 4 0 R ]
|
||||||
|
/Count 1
|
||||||
|
/Type /Pages
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
6 0 obj
|
||||||
|
<< /Pages 5 0 R
|
||||||
|
/Type /Catalog
|
||||||
|
>>
|
||||||
|
endobj
|
||||||
|
|
||||||
|
xref
|
||||||
|
0 7
|
||||||
|
0000000000 65535 f
|
||||||
|
0000000010 00000 n
|
||||||
|
0000000034 00000 n
|
||||||
|
0000000852 00000 n
|
||||||
|
0000000874 00000 n
|
||||||
|
0000001046 00000 n
|
||||||
|
0000001120 00000 n
|
||||||
|
trailer
|
||||||
|
<< /ID [ (some) (id) ]
|
||||||
|
/Root 6 0 R
|
||||||
|
/Size 7
|
||||||
|
>>
|
||||||
|
startxref
|
||||||
|
1179
|
||||||
|
%%EOF
|
@ -1427,7 +1427,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let updatedImageFrame: CGRect
|
var updatedImageFrame: CGRect
|
||||||
var contextContentFrame: CGRect
|
var contextContentFrame: CGRect
|
||||||
if let _ = emojiString {
|
if let _ = emojiString {
|
||||||
updatedImageFrame = imageFrame
|
updatedImageFrame = imageFrame
|
||||||
@ -1458,7 +1458,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
strongSelf.contextSourceNode.contentRect = contextContentFrame
|
strongSelf.contextSourceNode.contentRect = contextContentFrame
|
||||||
strongSelf.containerNode.targetNodeForActivationProgressContentRect = strongSelf.contextSourceNode.contentRect
|
strongSelf.containerNode.targetNodeForActivationProgressContentRect = strongSelf.contextSourceNode.contentRect
|
||||||
|
|
||||||
let animationNodeFrame = updatedContentFrame.insetBy(dx: imageInset, dy: imageInset)
|
var animationNodeFrame = updatedContentFrame.insetBy(dx: imageInset, dy: imageInset)
|
||||||
|
if let telegramFile, telegramFile.isPremiumSticker {
|
||||||
|
animationNodeFrame = animationNodeFrame.offsetBy(dx: 0.0, dy: 20.0)
|
||||||
|
}
|
||||||
|
|
||||||
var file: TelegramMediaFile?
|
var file: TelegramMediaFile?
|
||||||
if let emojiFile = emojiFile {
|
if let emojiFile = emojiFile {
|
||||||
|
@ -117,6 +117,9 @@ public func navigateToChatControllerImpl(_ params: NavigateToChatControllerParam
|
|||||||
if let attachBotStart = params.attachBotStart {
|
if let attachBotStart = params.attachBotStart {
|
||||||
controller.presentAttachmentBot(botId: attachBotStart.botId, payload: attachBotStart.payload, justInstalled: attachBotStart.justInstalled)
|
controller.presentAttachmentBot(botId: attachBotStart.botId, payload: attachBotStart.payload, justInstalled: attachBotStart.justInstalled)
|
||||||
}
|
}
|
||||||
|
if let botAppStart = params.botAppStart, case let .peer(peer) = params.chatLocation {
|
||||||
|
controller.presentBotApp(botApp: botAppStart.botApp, botPeer: peer, payload: botAppStart.payload)
|
||||||
|
}
|
||||||
params.setupController(controller)
|
params.setupController(controller)
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user