diff --git a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift index ddf175d5a8..104e0b57c6 100644 --- a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift +++ b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift @@ -3451,6 +3451,8 @@ final class ChatListSearchListPaneNode: ASDisplayNode, ChatListSearchPaneNode { break case let .peer(peerData): if let peer = peerData.peer.peer, let message = peerData.messages.first { + let _ = context.engine.peers.ensurePeerIsLocallyAvailable(peer: peer).startStandalone() + peerContextAction(peer, .search(message.id), node, gesture, location) } case .groupReference: diff --git a/submodules/Svg/PublicHeaders/Svg/Svg.h b/submodules/Svg/PublicHeaders/Svg/Svg.h index 5df838a162..ec08bd75f8 100755 --- a/submodules/Svg/PublicHeaders/Svg/Svg.h +++ b/submodules/Svg/PublicHeaders/Svg/Svg.h @@ -7,6 +7,6 @@ NSData * _Nullable prepareSvgImage(NSData * _Nonnull data, bool pattern); UIImage * _Nullable renderPreparedImage(NSData * _Nonnull data, CGSize size, UIColor * _Nonnull backgroundColor, CGFloat scale, bool fit); -UIImage * _Nullable drawSvgImage(NSData * _Nonnull data, CGSize size, UIColor * _Nullable backgroundColor, UIColor * _Nullable foregroundColor, bool opaque); +UIImage * _Nullable drawSvgImage(NSData * _Nonnull data, CGSize size, UIColor * _Nullable backgroundColor, UIColor * _Nullable foregroundColor, CGFloat scale, bool opaque); #endif /* Lottie_h */ diff --git a/submodules/Svg/Sources/Svg.m b/submodules/Svg/Sources/Svg.m index bb242235c5..f425c9c968 100755 --- a/submodules/Svg/Sources/Svg.m +++ b/submodules/Svg/Sources/Svg.m @@ -88,8 +88,7 @@ CGSize aspectFitSize(CGSize size, CGSize bounds) { @end -UIImage * _Nullable drawSvgImage(NSData * _Nonnull data, CGSize size, UIColor *backgroundColor, UIColor *foregroundColor, bool opaque) { - NSDate *startTime = [NSDate date]; +UIImage * _Nullable drawSvgImage(NSData * _Nonnull data, CGSize size, UIColor *backgroundColor, UIColor *foregroundColor, CGFloat canvasScale, bool opaque) { NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; if (parser == nil) { @@ -119,16 +118,13 @@ UIImage * _Nullable drawSvgImage(NSData * _Nonnull data, CGSize size, UIColor *b if (CGSizeEqualToSize(size, CGSizeZero)) { size = CGSizeMake(image->width, image->height); } - - double deltaTime = -1.0f * [startTime timeIntervalSinceNow]; - printf("parseTime = %f\n", deltaTime); - - startTime = [NSDate date]; - UIGraphicsBeginImageContextWithOptions(size, opaque, 1.0); + UIGraphicsBeginImageContextWithOptions(size, opaque, canvasScale); CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSetFillColorWithColor(context, backgroundColor.CGColor); - CGContextFillRect(context, CGRectMake(0.0f, 0.0f, size.width, size.height)); + if (backgroundColor != nil) { + CGContextSetFillColorWithColor(context, backgroundColor.CGColor); + CGContextFillRect(context, CGRectMake(0.0f, 0.0f, size.width, size.height)); + } CGSize svgSize = CGSizeMake(image->width, image->height); CGSize drawingSize = aspectFillSize(svgSize, size); @@ -231,9 +227,6 @@ UIImage * _Nullable drawSvgImage(NSData * _Nonnull data, CGSize size, UIColor *b UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); - deltaTime = -1.0f * [startTime timeIntervalSinceNow]; - printf("drawingTime %fx%f = %f\n", size.width, size.height, deltaTime); - nsvgDelete(image); return resultImage; diff --git a/submodules/TelegramCore/Sources/State/AccountViewTracker.swift b/submodules/TelegramCore/Sources/State/AccountViewTracker.swift index d7afc205b5..653d8ebf64 100644 --- a/submodules/TelegramCore/Sources/State/AccountViewTracker.swift +++ b/submodules/TelegramCore/Sources/State/AccountViewTracker.swift @@ -2261,7 +2261,7 @@ public final class AccountViewTracker { return -1 } }, next: { [weak self] next, viewId in - if let strongSelf = self, let account = strongSelf.account, updateData { + if let strongSelf = self, let account = strongSelf.account { strongSelf.updateCachedPeerData(peerId: peerId, accountPeerId: account.peerId, viewId: viewId, hasCachedData: next.cachedData != nil) } }, disposed: { [weak self] viewId in diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/BUILD b/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/BUILD index 3d4e6b32e0..4870ecc5a0 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/BUILD +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/BUILD @@ -13,11 +13,7 @@ swift_library( "//submodules/Display", "//submodules/ComponentFlow", "//submodules/Components/MultilineTextComponent", - "//submodules/TelegramUI/Components/TextLoadingEffect", - "//submodules/Components/ComponentDisplayAdapters", - "//submodules/TooltipUI", - "//submodules/AccountContext", - "//submodules/UIKitRuntimeUtils", + "//submodules/Svg", ], visibility = [ "//visibility:public", diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/Sources/PeerInfoRatingComponent.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/Sources/PeerInfoRatingComponent.swift index d0e013b307..952be535a4 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/Sources/PeerInfoRatingComponent.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoRatingComponent/Sources/PeerInfoRatingComponent.swift @@ -3,131 +3,72 @@ import UIKit import Display import ComponentFlow import MultilineTextComponent -import TextLoadingEffect -import ComponentDisplayAdapters -import TooltipUI -import AccountContext -import UIKitRuntimeUtils +import Svg public final class PeerInfoRatingComponent: Component { - let context: AccountContext let backgroundColor: UIColor + let borderColor: UIColor let foregroundColor: UIColor - let tooltipBackgroundColor: UIColor - let isExpanded: Bool - let compactLabel: String - let fraction: CGFloat - let label: String - let nextLabel: String - let tooltipLabel: String + let level: Int let action: () -> Void public init( - context: AccountContext, backgroundColor: UIColor, + borderColor: UIColor, foregroundColor: UIColor, - tooltipBackgroundColor: UIColor, - isExpanded: Bool, - compactLabel: String, - fraction: CGFloat, - label: String, - nextLabel: String, - tooltipLabel: String, + level: Int, action: @escaping () -> Void ) { - self.context = context self.backgroundColor = backgroundColor + self.borderColor = borderColor self.foregroundColor = foregroundColor - self.tooltipBackgroundColor = tooltipBackgroundColor - self.isExpanded = isExpanded - self.compactLabel = compactLabel - self.fraction = fraction - self.label = label - self.nextLabel = nextLabel - self.tooltipLabel = tooltipLabel + self.level = level self.action = action } public static func ==(lhs: PeerInfoRatingComponent, rhs: PeerInfoRatingComponent) -> Bool { - if lhs.context !== rhs.context { + if lhs.backgroundColor != rhs.backgroundColor { return false } - if lhs.backgroundColor != rhs.backgroundColor { + if lhs.borderColor != rhs.borderColor { return false } if lhs.foregroundColor != rhs.foregroundColor { return false } - if lhs.tooltipBackgroundColor != rhs.tooltipBackgroundColor { - return false - } - if lhs.isExpanded != rhs.isExpanded { - return false - } - if lhs.compactLabel != rhs.compactLabel { - return false - } - if lhs.fraction != rhs.fraction { - return false - } - if lhs.label != rhs.label { - return false - } - if lhs.nextLabel != rhs.nextLabel { - return false - } - if lhs.tooltipLabel != rhs.tooltipLabel { + if lhs.level != rhs.level { return false } return true } - public final class View: UIView { - private let backgroundView: UIImageView - private let foregroundView: UIImageView - private let foregroundMaskView: UIView - private let foregroundClippedView: UIView - private let foregroundClippedMaskView: UIView - private let foregroundClippedShapeView: UIImageView - private let compactLabel = ComponentView() - private let expandedLabel = ComponentView() - private let expandedClippedLabel = ComponentView() - private let nextLabel = ComponentView() + private struct TextLayout { + var size: CGSize + var opticalBounds: CGRect - private var shimmerEffectView: TextLoadingEffectView? + init(size: CGSize, opticalBounds: CGRect) { + self.size = size + self.opticalBounds = opticalBounds + } + } + + public final class View: UIView { + private let borderLayer: SimpleLayer + private let backgroundLayer: SimpleLayer + + private var tempLevel: Int = 1 private var component: PeerInfoRatingComponent? - - private var tooltipController: TooltipScreen? + private weak var state: EmptyComponentState? override public init(frame: CGRect) { - self.backgroundView = UIImageView() - - self.foregroundView = UIImageView() - self.foregroundMaskView = UIView() - self.foregroundMaskView.backgroundColor = .white - self.foregroundView.mask = self.foregroundMaskView - if let filter = CALayer.luminanceToAlpha() { - self.foregroundMaskView.layer.filters = [filter] - } - - self.foregroundClippedView = UIView() - self.foregroundClippedMaskView = UIView() - self.foregroundClippedMaskView.backgroundColor = .black - self.foregroundClippedView.mask = self.foregroundClippedMaskView - if let filter = CALayer.luminanceToAlpha() { - self.foregroundClippedMaskView.layer.filters = [filter] - } - - self.foregroundClippedShapeView = UIImageView() - self.foregroundClippedMaskView.addSubview(self.foregroundClippedShapeView) - + self.borderLayer = SimpleLayer() + self.backgroundLayer = SimpleLayer() super.init(frame: frame) - self.addSubview(self.backgroundView) - self.addSubview(self.foregroundClippedView) - self.addSubview(self.foregroundView) + self.layer.addSublayer(self.borderLayer) + self.layer.addSublayer(self.backgroundLayer) self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.onTapGesture(_:)))) } @@ -139,203 +80,172 @@ public final class PeerInfoRatingComponent: Component { @objc private func onTapGesture(_ recognizer: UITapGestureRecognizer) { if case .ended = recognizer.state { self.component?.action() + + if self.tempLevel < 10 { + self.tempLevel += 1 + } else { + self.tempLevel += 10 + } + if self.tempLevel >= 110 { + self.tempLevel = 1 + } + self.state?.updated(transition: .immediate) } } func update(component: PeerInfoRatingComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: ComponentTransition) -> CGSize { - self.component = component - - let previousBackgroundFrame = self.backgroundView.frame + let size = CGSize(width: 30.0, height: 30.0) let alphaTransition: ComponentTransition = transition.animation.isImmediate ? .immediate : .easeInOut(duration: 0.2) - let baseHeight: CGFloat = 20.0 - let innerInset: CGFloat = 2.0 + let previousComponent = self.component + self.component = component + self.state = state - let compactLabelSize = self.compactLabel.update( - transition: .immediate, - component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: component.compactLabel, font: Font.medium(11.0), textColor: .black)) - )), - environment: {}, - containerSize: CGSize(width: 100.0, height: 100.0) - ) + //TODO:localize + //let level = component.level + let level = self.tempLevel - let expandedSize = CGSize(width: 174.0, height: baseHeight) - let collapsedSize = CGSize(width: max(baseHeight, compactLabelSize.width + 6.0 * 2.0), height: baseHeight) + let iconSize = CGSize(width: 26.0, height: 26.0) - if self.backgroundView.image == nil { - self.backgroundView.image = generateStretchableFilledCircleImage(diameter: baseHeight, color: .white)?.withRenderingMode(.alwaysTemplate) - } - if self.foregroundView.image == nil { - self.foregroundView.image = generateStretchableFilledCircleImage(diameter: baseHeight - innerInset * 2.0, color: .white)?.withRenderingMode(.alwaysTemplate) - } - if self.foregroundClippedShapeView.image == nil { - self.foregroundClippedShapeView.image = generateStretchableFilledCircleImage(diameter: baseHeight - innerInset * 2.0, color: .black) - } - - self.backgroundView.tintColor = component.backgroundColor - self.foregroundView.tintColor = component.foregroundColor - - let size = component.isExpanded ? expandedSize : collapsedSize - let backgroundFrame = CGRect(origin: CGPoint(), size: size) - - transition.setFrame(view: self.backgroundView, frame: backgroundFrame) - - let foregroundFrame: CGRect - if component.isExpanded { - let foregroundWidth = floorToScreenPixels(backgroundFrame.insetBy(dx: innerInset, dy: innerInset).width * component.fraction) - foregroundFrame = CGRect(origin: CGPoint(x: innerInset, y: innerInset), size: CGSize(width: foregroundWidth, height: backgroundFrame.height - innerInset * 2.0)) - } else { - foregroundFrame = backgroundFrame.insetBy(dx: innerInset, dy: innerInset) - } - - transition.setFrame(view: self.foregroundView, frame: foregroundFrame) - transition.setFrame(view: self.foregroundMaskView, frame: CGRect(origin: CGPoint(), size: foregroundFrame.size)) - - transition.setFrame(view: self.foregroundClippedView, frame: CGRect(origin: CGPoint(), size: size)) - transition.setFrame(view: self.foregroundClippedMaskView, frame: CGRect(origin: CGPoint(), size: size)) - self.foregroundClippedView.backgroundColor = component.foregroundColor - transition.setFrame(view: self.foregroundClippedShapeView, frame: foregroundFrame) - - if let compactLabelView = self.compactLabel.view { - if compactLabelView.superview == nil { - self.foregroundMaskView.addSubview(compactLabelView) - } - compactLabelView.frame = CGRect(origin: CGPoint(x: floorToScreenPixels((collapsedSize.width - innerInset * 2.0 - compactLabelSize.width) * 0.5), y: floorToScreenPixels((baseHeight - innerInset * 2.0 - compactLabelSize.height) * 0.5) + UIScreenPixel), size: compactLabelSize) - alphaTransition.setAlpha(view: compactLabelView, alpha: component.isExpanded ? 0.0 : 1.0) - } - - let expandedLabelSize = self.expandedLabel.update( - transition: .immediate, - component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: component.label, font: Font.medium(11.0), textColor: .black)) - )), - environment: {}, - containerSize: CGSize(width: 100.0, height: 100.0) - ) - if let expandedLabelView = self.expandedLabel.view { - if expandedLabelView.superview == nil { - self.foregroundMaskView.addSubview(expandedLabelView) - } - expandedLabelView.frame = CGRect(origin: CGPoint(x: 4.0, y: floorToScreenPixels((baseHeight - innerInset * 2.0 - expandedLabelSize.height) * 0.5) + UIScreenPixel), size: expandedLabelSize) - alphaTransition.setAlpha(view: expandedLabelView, alpha: component.isExpanded ? 1.0 : 0.0) - } - - let expandedClippedLabelSize = self.expandedClippedLabel.update( - transition: .immediate, - component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: component.label, font: Font.medium(11.0), textColor: .white)) - )), - environment: {}, - containerSize: CGSize(width: 100.0, height: 100.0) - ) - if let expandedClippedLabelView = self.expandedClippedLabel.view { - if expandedClippedLabelView.superview == nil { - self.foregroundClippedMaskView.insertSubview(expandedClippedLabelView, belowSubview: self.foregroundClippedShapeView) - } - expandedClippedLabelView.frame = CGRect(origin: CGPoint(x: innerInset + 4.0, y: innerInset + floorToScreenPixels((baseHeight - innerInset * 2.0 - expandedClippedLabelSize.height) * 0.5) + UIScreenPixel), size: expandedClippedLabelSize) - alphaTransition.setAlpha(view: expandedClippedLabelView, alpha: component.isExpanded ? 1.0 : 0.0) - } - - let nextLabelSize = self.nextLabel.update( - transition: .immediate, - component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: component.nextLabel, font: Font.medium(11.0), textColor: component.foregroundColor.withMultipliedAlpha(0.5))) - )), - environment: {}, - containerSize: CGSize(width: 100.0, height: 100.0) - ) - if let nextLabelView = self.nextLabel.view { - if nextLabelView.superview == nil { - self.insertSubview(nextLabelView, belowSubview: self.foregroundView) - } - let nextLabelFrame = CGRect(origin: CGPoint(x: size.width - nextLabelSize.width - 4.0 - innerInset, y: floorToScreenPixels((baseHeight - nextLabelSize.height) * 0.5) + UIScreenPixel), size: nextLabelSize) - transition.setPosition(view: nextLabelView, position: nextLabelFrame.center) - nextLabelView.bounds = CGRect(origin: CGPoint(), size: nextLabelFrame.size) - alphaTransition.setAlpha(view: nextLabelView, alpha: component.isExpanded ? 1.0 : 0.0) - } - - if component.isExpanded { - var shimmerEffectTransition = transition - let shimmerEffectView: TextLoadingEffectView - if let current = self.shimmerEffectView { - shimmerEffectView = current - } else { - shimmerEffectTransition = .immediate - shimmerEffectView = TextLoadingEffectView(frame: CGRect()) - self.shimmerEffectView = shimmerEffectView - self.addSubview(shimmerEffectView) - shimmerEffectView.frame = previousBackgroundFrame - shimmerEffectView.alpha = 0.0 - } - transition.setFrame(view: shimmerEffectView, frame: backgroundFrame) - alphaTransition.setAlpha(view: shimmerEffectView, alpha: 1.0) + //TODO:localize + if previousComponent?.level != level || previousComponent?.borderColor != component.borderColor || previousComponent?.foregroundColor != component.foregroundColor || previousComponent?.backgroundColor != component.backgroundColor || "".isEmpty { + let attributedText = NSAttributedString(string: "\(level)", attributes: [ + NSAttributedString.Key.font: Font.semibold(10.0), + NSAttributedString.Key.foregroundColor: component.foregroundColor + ]) - shimmerEffectView.update(color: .clear, borderColor: component.foregroundColor, rect: CGRect(origin: CGPoint(), size: backgroundFrame.size), path: UIBezierPath(roundedRect: CGRect(origin: CGPoint(), size: backgroundFrame.size).insetBy(dx: 1.0, dy: 1.0), cornerRadius: backgroundFrame.height * 0.5).cgPath, transition: shimmerEffectTransition.containedViewLayoutTransition) - } else if let shimmerEffectView = self.shimmerEffectView { - self.shimmerEffectView = nil + var boundingRect = attributedText.boundingRect(with: CGSize(width: 100.0, height: 100.0), options: .usesLineFragmentOrigin, context: nil) + boundingRect.size.width = ceil(boundingRect.size.width) + boundingRect.size.height = ceil(boundingRect.size.height) - transition.setFrame(view: shimmerEffectView, frame: backgroundFrame) - - shimmerEffectView.update(color: .clear, borderColor: component.foregroundColor, rect: CGRect(origin: CGPoint(), size: backgroundFrame.size), path: UIBezierPath(roundedRect: CGRect(origin: CGPoint(), size: backgroundFrame.size), cornerRadius: backgroundFrame.height * 0.5).cgPath, transition: transition.containedViewLayoutTransition) - - alphaTransition.setAlpha(view: shimmerEffectView, alpha: 0.0, completion: { [weak shimmerEffectView] _ in - shimmerEffectView?.removeFromSuperview() - }) - } - - if !component.tooltipLabel.isEmpty { - let tooltipController: TooltipScreen - if let current = self.tooltipController { - tooltipController = current - } else { - tooltipController = TooltipScreen( - context: component.context, - account: component.context.account, - sharedContext: component.context.sharedContext, - text: .attributedString(text: NSAttributedString(string: component.tooltipLabel, font: Font.semibold(11.0), textColor: .white)), - style: .customBlur(component.tooltipBackgroundColor, -4.0), - arrowStyle: .small, - location: .point(CGRect(origin: CGPoint(x: 100.0, y: 100.0), size: CGSize()), .bottom), - displayDuration: .infinite, - isShimmering: true, - cornerRadius: 10.0, - shouldDismissOnTouch: { _, _ in - return .ignore + var textLayout: TextLayout? + if let context = DrawingContext(size: boundingRect.size, scale: 0.0, opaque: false, clear: true) { + context.withContext { c in + UIGraphicsPushContext(c) + defer { + UIGraphicsPopContext() } - ) - self.tooltipController = tooltipController + + attributedText.draw(at: CGPoint()) + } + var minFilledLineY = Int(context.scaledSize.height) - 1 + var maxFilledLineY = 0 + var minFilledLineX = Int(context.scaledSize.width) - 1 + var maxFilledLineX = 0 + for y in 0 ..< Int(context.scaledSize.height) { + let linePtr = context.bytes.advanced(by: max(0, y) * context.bytesPerRow).assumingMemoryBound(to: UInt32.self) + + for x in 0 ..< Int(context.scaledSize.width) { + let pixelPtr = linePtr.advanced(by: x) + if pixelPtr.pointee != 0 { + minFilledLineY = min(y, minFilledLineY) + maxFilledLineY = max(y, maxFilledLineY) + minFilledLineX = min(x, minFilledLineX) + maxFilledLineX = max(x, maxFilledLineX) + } + } + } - tooltipController.containerLayoutUpdated(ContainerViewLayout( - size: CGSize(width: 200.0, height: 200.0), - metrics: LayoutMetrics(), - deviceMetrics: DeviceMetrics.iPhoneXSMax, - intrinsicInsets: UIEdgeInsets(), - safeInsets: UIEdgeInsets(), - additionalInsets: UIEdgeInsets(), - statusBarHeight: nil, - inputHeight: nil, - inputHeightIsInteractivellyChanging: false, - inVoiceOver: false - ), transition: .immediate) + var opticalBounds = CGRect() + if minFilledLineX <= maxFilledLineX && minFilledLineY <= maxFilledLineY { + opticalBounds.origin.x = CGFloat(minFilledLineX) / context.scale + opticalBounds.origin.y = CGFloat(minFilledLineY) / context.scale + opticalBounds.size.width = CGFloat(maxFilledLineX - minFilledLineX) / context.scale + opticalBounds.size.height = CGFloat(maxFilledLineY - minFilledLineY) / context.scale + } - self.layer.addSublayer(tooltipController.view.layer) - tooltipController.viewWillAppear(false) - tooltipController.viewDidAppear(false) - tooltipController.setIgnoreAppearanceMethodInvocations(true) - tooltipController.view.isUserInteractionEnabled = false + textLayout = TextLayout(size: boundingRect.size, opticalBounds: opticalBounds) } - transition.setFrame(view: tooltipController.view, frame: CGRect(origin: CGPoint(), size: CGSize(width: 200.0, height: 200.0)).offsetBy(dx: -200.0 * 0.5 + foregroundFrame.width + 2.0, dy: -200.0 * 0.5)) - alphaTransition.setAlpha(view: tooltipController.view, alpha: component.isExpanded ? 1.0 : 0.0) - } else { - if let tooltipController = self.tooltipController { - self.tooltipController = nil - tooltipController.view.layer.removeFromSuperlayer() + let levelIndex: Int + if level <= 10 { + levelIndex = max(0, component.level) + } else if level <= 90 { + levelIndex = (level / 10) * 10 + } else { + levelIndex = 90 + } + let borderImage = generateImage(iconSize, rotatedContext: { size, context in + UIGraphicsPushContext(context) + defer { + UIGraphicsPopContext() + } + + context.clear(CGRect(origin: CGPoint(), size: size)) + + if let url = Bundle.main.url(forResource: "profile_level\(levelIndex)_outer", withExtension: "svg"), let data = try? Data(contentsOf: url) { + if let image = generateTintedImage(image: drawSvgImage(data, size, nil, nil, 0.0, false), color: component.borderColor) { + image.draw(in: CGRect(origin: CGPoint(), size: size), blendMode: .normal, alpha: 1.0) + } + } + }) + + if let previousContents = self.borderLayer.contents, CFGetTypeID(previousContents as CFTypeRef) == CGImage.typeID { + self.borderLayer.contents = borderImage!.cgImage + alphaTransition.animateContentsImage(layer: self.borderLayer, from: previousContents as! CGImage, to: borderImage!.cgImage!, duration: 0.2, curve: .easeInOut) + } else { + self.borderLayer.contents = borderImage!.cgImage + } + + let backgroundImage = generateImage(iconSize, rotatedContext: { size, context in + UIGraphicsPushContext(context) + defer { + UIGraphicsPopContext() + } + + context.clear(CGRect(origin: CGPoint(), size: size)) + + if let url = Bundle.main.url(forResource: "profile_level\(levelIndex)_inner", withExtension: "svg"), let data = try? Data(contentsOf: url) { + if let image = generateTintedImage(image: drawSvgImage(data, size, nil, nil, 0.0, false), color: component.backgroundColor) { + image.draw(in: CGRect(origin: CGPoint(), size: size), blendMode: .normal, alpha: 1.0) + } + } + + if component.foregroundColor.alpha < 1.0 { + context.setBlendMode(.copy) + } else { + context.setBlendMode(.normal) + } + + if let textLayout { + let titleScale: CGFloat + if level < 10 { + titleScale = 1.0 + } else if level < 100 { + titleScale = 0.8 + } else { + titleScale = 0.6 + } + + var textFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - textLayout.size.width) * 0.5), y: floorToScreenPixels((size.height - textLayout.size.height) * 0.5)), size: textLayout.size) + if level == 1 { + } else { + textFrame.origin.x += UIScreenPixel + } + + context.saveGState() + context.translateBy(x: textFrame.midX, y: textFrame.midY) + context.scaleBy(x: titleScale, y: titleScale) + context.translateBy(x: -textFrame.midX, y: -textFrame.midY) + + attributedText.draw(at: textFrame.origin) + + context.restoreGState() + } + }) + if let previousContents = self.backgroundLayer.contents, CFGetTypeID(previousContents as CFTypeRef) == CGImage.typeID { + self.backgroundLayer.contents = backgroundImage!.cgImage + alphaTransition.animateContentsImage(layer: self.backgroundLayer, from: previousContents as! CGImage, to: backgroundImage!.cgImage!, duration: 0.2, curve: .easeInOut) + } else { + self.backgroundLayer.contents = backgroundImage!.cgImage } } + let backgroundFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - iconSize.width) * 0.5), y: floorToScreenPixels((size.height - iconSize.height) * 0.5)), size: iconSize) + transition.setFrame(layer: self.backgroundLayer, frame: backgroundFrame) + transition.setFrame(layer: self.borderLayer, frame: backgroundFrame) + return size } } diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift index 2782e8b50d..be932b6bda 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift @@ -132,8 +132,6 @@ final class PeerInfoHeaderNode: ASDisplayNode { let titleExpandedStatusIconView: ComponentHostView var titleExpandedStatusIconSize: CGSize? - var subtitleRatingIsExpanded: Bool = false - var didDisplayRatingTooltip: Bool = false var subtitleRating: ComponentView? let subtitleNodeContainer: ASDisplayNode @@ -779,6 +777,10 @@ final class PeerInfoHeaderNode: ASDisplayNode { self.avatarClippingNode.clipsToBounds = true } + let ratingBackgroundColor: UIColor + let ratingBorderColor: UIColor + let ratingForegroundColor: UIColor + if state.isEditing { navigationContentsAccentColor = collapsedHeaderNavigationContentsAccentColor navigationContentsPrimaryColor = collapsedHeaderNavigationContentsPrimaryColor @@ -789,6 +791,10 @@ final class PeerInfoHeaderNode: ASDisplayNode { contentButtonForegroundColor = collapsedHeaderContentButtonForegroundColor headerButtonBackgroundColor = collapsedHeaderButtonBackgroundColor + + ratingBackgroundColor = presentationData.theme.list.itemCheckColors.fillColor + ratingBorderColor = .clear + ratingForegroundColor = presentationData.theme.list.itemCheckColors.foregroundColor } else if self.isAvatarExpanded { navigationContentsAccentColor = expandedAvatarNavigationContentsAccentColor navigationContentsPrimaryColor = expandedAvatarNavigationContentsPrimaryColor @@ -799,6 +805,10 @@ final class PeerInfoHeaderNode: ASDisplayNode { navigationContentsCanBeExpanded = false headerButtonBackgroundColor = expandedAvatarHeaderButtonBackgroundColor + + ratingBackgroundColor = .white + ratingBorderColor = .clear + ratingForegroundColor = .clear } else { let effectiveTransitionFraction: CGFloat = innerBackgroundTransitionFraction < 0.5 ? 0.0 : 1.0 @@ -812,10 +822,22 @@ final class PeerInfoHeaderNode: ASDisplayNode { navigationContentsCanBeExpanded = true } - contentButtonBackgroundColor = regularContentButtonBackgroundColor//.mixedWith(collapsedHeaderContentButtonBackgroundColor, alpha: effectiveTransitionFraction) - contentButtonForegroundColor = regularContentButtonForegroundColor//.mixedWith(collapsedHeaderContentButtonForegroundColor, alpha: effectiveTransitionFraction) + contentButtonBackgroundColor = regularContentButtonBackgroundColor + contentButtonForegroundColor = regularContentButtonForegroundColor headerButtonBackgroundColor = regularHeaderButtonBackgroundColor.mixedWith(collapsedHeaderButtonBackgroundColor, alpha: effectiveTransitionFraction) + + if let profileColor = peer?.profileColor { + let backgroundColors = self.context.peerNameColors.getProfile(profileColor, dark: presentationData.theme.overallDarkAppearance) + + ratingBackgroundColor = UIColor(white: 1.0, alpha: 1.0).mixedWith(presentationData.theme.list.itemCheckColors.fillColor, alpha: effectiveTransitionFraction) + ratingForegroundColor = backgroundColors.main.withMultiplied(hue: 1.0, saturation: 1.1, brightness: 0.9).mixedWith(UIColor.clear, alpha: effectiveTransitionFraction) + ratingBorderColor = ratingForegroundColor.mixedWith(presentationData.theme.list.itemCheckColors.foregroundColor, alpha: effectiveTransitionFraction) + } else { + ratingBackgroundColor = presentationData.theme.list.itemCheckColors.fillColor + ratingBorderColor = UIColor.clear + ratingForegroundColor = presentationData.theme.list.itemCheckColors.foregroundColor + } } do { @@ -1552,6 +1574,9 @@ final class PeerInfoHeaderNode: ASDisplayNode { titleCollapseFraction = max(0.0, min(1.0, contentOffset / titleCollapseOffset)) subtitleFrame = CGRect(origin: CGPoint(x: 16.0, y: minTitleFrame.maxY + 2.0), size: subtitleSize) + if self.subtitleRating != nil { + subtitleFrame.origin.x += 22.0 + } usernameFrame = CGRect(origin: CGPoint(x: width - usernameSize.width - 16.0, y: minTitleFrame.midY - usernameSize.height / 2.0), size: usernameSize) } else { titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((width - titleSize.width) / 2.0), y: avatarFrame.maxY + 9.0 + (subtitleSize.height.isZero ? 11.0 : 0.0)), size: titleSize) @@ -1917,7 +1942,9 @@ final class PeerInfoHeaderNode: ASDisplayNode { let apparentBackgroundHeight = (1.0 - transitionFraction) * backgroundHeight + transitionFraction * transitionSourceHeight var subtitleRatingSize: CGSize? - if let cachedData = cachedData as? CachedUserData, let starRating = cachedData.starRating { + //TODO:localize + //if let cachedData = cachedData as? CachedUserData, let starRating = cachedData.starRating { + if "".isEmpty { let subtitleRating: ComponentView var subtitleRatingTransition = ComponentTransition(transition) if let current = self.subtitleRating { @@ -1927,82 +1954,21 @@ final class PeerInfoHeaderNode: ASDisplayNode { subtitleRating = ComponentView() self.subtitleRating = subtitleRating } - let fraction: CGFloat - let tooltipLabel: String - if let nextLevelStars = starRating.nextLevelStars { - fraction = CGFloat(starRating.currentLevelStars) / CGFloat(nextLevelStars) - tooltipLabel = "\(starRating.currentLevelStars) / \(nextLevelStars)" - } else { - fraction = 1.0 - tooltipLabel = "" - } - - let tooltipBackgroundColor: UIColor - let ratingBackgroundColor: UIColor - let ratingForegroundColor: UIColor - - if peer?.profileColor != nil { - ratingBackgroundColor = UIColor(white: 1.0, alpha: 0.1) - ratingForegroundColor = UIColor(white: 1.0, alpha: 1.0) - if !self.isAvatarExpanded { - tooltipBackgroundColor = contentButtonBackgroundColor - } else { - tooltipBackgroundColor = UIColor(rgb: 0x000000, alpha: 0.65) - } - } else { - ratingBackgroundColor = presentationData.theme.list.freeTextColor.withMultipliedAlpha(0.1) - ratingForegroundColor = presentationData.theme.list.freeTextColor.withMultipliedAlpha(1.0) - tooltipBackgroundColor = UIColor(rgb: 0x000000, alpha: 0.65) - } //TODO:localize subtitleRatingSize = subtitleRating.update( transition: subtitleRatingTransition, component: AnyComponent(PeerInfoRatingComponent( - context: self.context, backgroundColor: ratingBackgroundColor, + borderColor: ratingBorderColor, foregroundColor: ratingForegroundColor, - tooltipBackgroundColor: tooltipBackgroundColor, - isExpanded: self.subtitleRatingIsExpanded, - compactLabel: "\(starRating.level)", - fraction: fraction, - label: "Level \(starRating.level)", - nextLabel: starRating.nextLevelStars != nil ? "\(starRating.level + 1)" : "", - tooltipLabel: tooltipLabel, + //TODO:localize + level: 1,//Int(starRating.level), action: { [weak self] in guard let self else { return } - self.subtitleRatingIsExpanded = !self.subtitleRatingIsExpanded - self.requestUpdateLayout?(true) - - if self.subtitleRatingIsExpanded, let controller = self.controller, let presentationData = self.presentationData, !self.didDisplayRatingTooltip { - self.didDisplayRatingTooltip = true - controller.present(UndoOverlayController( - presentationData: presentationData, - content: .info( - title: nil, - text: "Profile level reflects the user's payment reliability", - timeout: 4.0, - customUndoText: "Learn More" - ), - position: .top, - action: { [weak self] action in - guard let self else { - return true - } - - if case .undo = action { - var infoUrl = "https://telegram.org/blog/telegram-stars" - if let data = self.context.currentAppConfiguration.with({ $0 }).data, let value = data["stars_rating_learnmore_url"] as? String { - infoUrl = value - } - self.context.sharedContext.applicationBindings.openUrl(infoUrl) - } - return true - } - ), in: .current) - } + let _ = self } )), environment: {}, @@ -2064,11 +2030,7 @@ final class PeerInfoHeaderNode: ASDisplayNode { if let subtitleRatingView = self.subtitleRating?.view, let subtitleRatingSize { let subtitleBadgeFrame: CGRect - if self.subtitleRatingIsExpanded { - subtitleBadgeFrame = CGRect(origin: CGPoint(x: -subtitleRatingSize.width * 0.5, y: floor((-subtitleRatingSize.height) * 0.5)), size: subtitleRatingSize) - } else { - subtitleBadgeFrame = CGRect(origin: CGPoint(x: (-subtitleSize.width) * 0.5 - 4.0 - subtitleRatingSize.width, y: floor((-subtitleRatingSize.height) * 0.5)), size: subtitleRatingSize) - } + subtitleBadgeFrame = CGRect(origin: CGPoint(x: (-subtitleSize.width) * 0.5 - subtitleRatingSize.width + 1.0, y: floor((-subtitleRatingSize.height) * 0.5)), size: subtitleRatingSize) transition.updateFrameAdditive(view: subtitleRatingView, frame: subtitleBadgeFrame) transition.updateAlpha(layer: subtitleRatingView.layer, alpha: (1.0 - transitionFraction)) } @@ -2077,18 +2039,15 @@ final class PeerInfoHeaderNode: ASDisplayNode { let subtitleScale: CGFloat var subtitleOffset: CGFloat = 0.0 let subtitleBadgeFraction: CGFloat - let subtitleRatingFraction: CGFloat if self.isAvatarExpanded { titleScale = expandedTitleScale subtitleScale = 1.0 subtitleBadgeFraction = 1.0 - subtitleRatingFraction = 0.0 } else { titleScale = (1.0 - titleCollapseFraction) * 1.0 + titleCollapseFraction * titleMinScale subtitleScale = (1.0 - titleCollapseFraction) * 1.0 + titleCollapseFraction * subtitleMinScale subtitleOffset = titleCollapseFraction * -1.0 subtitleBadgeFraction = (1.0 - titleCollapseFraction) - subtitleRatingFraction = (1.0 - titleCollapseFraction) } let rawTitleFrame = titleFrame.offsetBy(dx: self.isAvatarExpanded ? titleExpandedHorizontalOffset : titleHorizontalOffset * titleScale, dy: 0.0) @@ -2128,20 +2087,9 @@ final class PeerInfoHeaderNode: ASDisplayNode { } if let subtitleRatingView = self.subtitleRating?.view, let subtitleRatingSize { - let subtitleBadgeFrame: CGRect - if self.subtitleRatingIsExpanded { - subtitleBadgeFrame = CGRect(origin: CGPoint(x: -subtitleRatingSize.width * 0.5, y: floor((-subtitleRatingSize.height) * 0.5)), size: subtitleRatingSize) - } else { - subtitleBadgeFrame = CGRect(origin: CGPoint(x: (-subtitleSize.width) * 0.5 - 4.0 - subtitleRatingSize.width, y: floor((-subtitleRatingSize.height) * 0.5)), size: subtitleRatingSize) - } + let subtitleBadgeFrame = CGRect(origin: CGPoint(x: (-subtitleSize.width) * 0.5 - subtitleRatingSize.width + 1.0, y: floor((-subtitleRatingSize.height) * 0.5)), size: subtitleRatingSize) transition.updateFrameAdditive(view: subtitleRatingView, frame: subtitleBadgeFrame) - transition.updateAlpha(layer: subtitleRatingView.layer, alpha: (1.0 - transitionFraction) * subtitleRatingFraction) } - - let subtitleAlpha: CGFloat = subtitleRatingFraction * (self.subtitleRatingIsExpanded ? 0.0 : 1.0) + (1.0 - subtitleRatingFraction) * 1.0 - let subtitleInnerScale: CGFloat = subtitleRatingFraction * (self.subtitleRatingIsExpanded ? 0.001 : 1.0) + (1.0 - subtitleRatingFraction) * 1.0 - transition.updateAlpha(node: self.subtitleNode, alpha: subtitleAlpha) - transition.updateTransformScale(node: self.subtitleNode, scale: subtitleInnerScale) } } @@ -2669,7 +2617,6 @@ final class PeerInfoHeaderNode: ASDisplayNode { self.isAvatarExpanded = isAvatarExpanded if isAvatarExpanded { self.avatarListNode.listContainerNode.selectFirstItem() - self.subtitleRatingIsExpanded = false } if case .animated = transition, !isAvatarExpanded { self.avatarListNode.animateAvatarCollapse(transition: transition) diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level10_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level10_inner.svg new file mode 100644 index 0000000000..8ce8b2c9b2 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level10_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level10_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level10_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level10_outer.svg new file mode 100644 index 0000000000..91c69beda2 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level10_outer.svg @@ -0,0 +1,8 @@ + + + Badge / level10_outer + + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level1_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level1_inner.svg new file mode 100644 index 0000000000..37959bcb5d --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level1_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level1_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level1_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level1_outer.svg new file mode 100644 index 0000000000..49cfbd30d0 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level1_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level1_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level20_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level20_inner.svg new file mode 100644 index 0000000000..055e99e5c3 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level20_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level20_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level20_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level20_outer.svg new file mode 100644 index 0000000000..21843f122e --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level20_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level20_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level2_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level2_inner.svg new file mode 100644 index 0000000000..2cd67761cc --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level2_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level2_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level2_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level2_outer.svg new file mode 100644 index 0000000000..d6ba54b6e1 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level2_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level2_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level30_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level30_inner.svg new file mode 100644 index 0000000000..b74a2e6efb --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level30_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level30_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level30_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level30_outer.svg new file mode 100644 index 0000000000..65f7cdd66a --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level30_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level30_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level3_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level3_inner.svg new file mode 100644 index 0000000000..3bc0ef3505 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level3_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level3_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level3_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level3_outer.svg new file mode 100644 index 0000000000..248a764513 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level3_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level3_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level40_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level40_inner.svg new file mode 100644 index 0000000000..f7fef2c167 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level40_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level40_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level40_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level40_outer.svg new file mode 100644 index 0000000000..ead24ad66a --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level40_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level40_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level4_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level4_inner.svg new file mode 100644 index 0000000000..b23971ce55 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level4_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level4_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level4_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level4_outer.svg new file mode 100644 index 0000000000..194ea6a82b --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level4_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level4_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level50_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level50_inner.svg new file mode 100644 index 0000000000..23aa9e3107 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level50_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level50_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level50_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level50_outer.svg new file mode 100644 index 0000000000..733a99918e --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level50_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level50_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level5_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level5_inner.svg new file mode 100644 index 0000000000..e28cd650ab --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level5_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level5_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level5_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level5_outer.svg new file mode 100644 index 0000000000..00037a2d3f --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level5_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level5_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level60_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level60_inner.svg new file mode 100644 index 0000000000..b006ec3280 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level60_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level60_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level60_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level60_outer.svg new file mode 100644 index 0000000000..b9ae49717d --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level60_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level60_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level6_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level6_inner.svg new file mode 100644 index 0000000000..1b8a68d0da --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level6_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level6_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level6_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level6_outer.svg new file mode 100644 index 0000000000..107e877b78 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level6_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level6_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level70_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level70_inner.svg new file mode 100644 index 0000000000..d6bc1b8b4a --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level70_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level70_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level70_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level70_outer.svg new file mode 100644 index 0000000000..efe358504f --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level70_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level70_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level7_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level7_inner.svg new file mode 100644 index 0000000000..d0a0c79299 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level7_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level7_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level7_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level7_outer.svg new file mode 100644 index 0000000000..862958fe75 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level7_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level7_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level80_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level80_inner.svg new file mode 100644 index 0000000000..a469b74988 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level80_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level80_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level80_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level80_outer.svg new file mode 100644 index 0000000000..6e07cc10f5 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level80_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level80_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level8_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level8_inner.svg new file mode 100644 index 0000000000..f4a0d3b7d1 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level8_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level8_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level8_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level8_outer.svg new file mode 100644 index 0000000000..e1140d935e --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level8_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level8_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level90_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level90_inner.svg new file mode 100644 index 0000000000..d25a731d93 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level90_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level90_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level90_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level90_outer.svg new file mode 100644 index 0000000000..c34a2e2866 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level90_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level90_outer + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level9_inner.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level9_inner.svg new file mode 100644 index 0000000000..27fe8c25a2 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level9_inner.svg @@ -0,0 +1,7 @@ + + + Badge / level9_inner + + + + \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/ProfileLevel/profile_level9_outer.svg b/submodules/TelegramUI/Resources/ProfileLevel/profile_level9_outer.svg new file mode 100644 index 0000000000..4b003c3a44 --- /dev/null +++ b/submodules/TelegramUI/Resources/ProfileLevel/profile_level9_outer.svg @@ -0,0 +1,7 @@ + + + Badge / level9_outer + + + + \ No newline at end of file diff --git a/submodules/WallpaperResources/Sources/WallpaperResources.swift b/submodules/WallpaperResources/Sources/WallpaperResources.swift index d13355b17b..41f5be0378 100644 --- a/submodules/WallpaperResources/Sources/WallpaperResources.swift +++ b/submodules/WallpaperResources/Sources/WallpaperResources.swift @@ -1333,7 +1333,7 @@ public func themeImage(account: Account, accountManager: AccountManager