mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 01:22:41 +00:00
Merge commit '79b9091e4c1bec1fc5a87506caa87c0f8bb8ecbe' into gradient-messages
This commit is contained in:
commit
e4f50b1d82
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>NSExtension</key>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>NSExtension</key>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>NSExtension</key>
|
||||
@ -31,15 +31,15 @@
|
||||
SUBQUERY (
|
||||
$extensionItem.attachments,
|
||||
$attachment,
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.audio" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.vcard" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.apple.pkpass"
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.audio" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.vcard" ||
|
||||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.apple.pkpass"
|
||||
).@count == $extensionItem.attachments.@count
|
||||
).@count > 0</string>
|
||||
</dict>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>NSExtension</key>
|
||||
|
||||
@ -326,13 +326,12 @@ class IntentHandler: INExtension, INSendMessageIntentHandling, INSearchForMessag
|
||||
|> introduceError(IntentHandlingError.self)
|
||||
|> mapToSignal { account -> Signal<[INMessage], IntentHandlingError> in
|
||||
account.shouldBeServiceTaskMaster.set(.single(.now))
|
||||
|
||||
let completedUpdating: Signal<Bool, IntentHandlingError> = (.single(true) |> then(account.stateManager.isUpdating))
|
||||
|> introduceError(IntentHandlingError.self)
|
||||
|> filter { !$0 }
|
||||
|> take(1)
|
||||
|> timeout(3.0, queue: Queue.mainQueue(), alternate: .fail(.generic))
|
||||
|
||||
|
||||
return completedUpdating
|
||||
|> mapToSignal { value -> Signal<[INMessage], IntentHandlingError> in
|
||||
return unreadMessages(account: account)
|
||||
|
||||
@ -185,7 +185,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>NSExtension</key>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.9.1</string>
|
||||
<string>5.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>NSExtension</key>
|
||||
|
||||
@ -320,9 +320,9 @@ private func makeDarkPresentationTheme(accentColor: UIColor, baseColor: Presenta
|
||||
)
|
||||
}
|
||||
|
||||
public let defaultDarkPresentationTheme = makeDarkPresentationTheme(accentColor: UIColor(rgb: 0x2ea6ff), baseColor: .blue, preview: false)
|
||||
public let defaultDarkPresentationTheme = makeDarkPresentationTheme(accentColor: .white, baseColor: .white, preview: false)
|
||||
|
||||
public func makeDarkPresentationTheme(accentColor: UIColor?, baseColor: PresentationThemeBaseColor?, preview: Bool) -> PresentationTheme {
|
||||
let accentColor = accentColor ?? defaultDayAccentColor
|
||||
let accentColor = accentColor ?? .white
|
||||
return makeDarkPresentationTheme(accentColor: accentColor, baseColor: baseColor, preview: preview)
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ import Foundation
|
||||
import UIKit
|
||||
import TelegramUIPreferences
|
||||
|
||||
public func makePresentationTheme(themeReference: PresentationThemeReference, accentColor: UIColor, serviceBackgroundColor: UIColor, baseColor: PresentationThemeBaseColor?, preview: Bool = false) -> PresentationTheme {
|
||||
public func makePresentationTheme(themeReference: PresentationThemeReference, accentColor: UIColor?, serviceBackgroundColor: UIColor, baseColor: PresentationThemeBaseColor?, preview: Bool = false) -> PresentationTheme {
|
||||
let theme: PresentationTheme
|
||||
switch themeReference {
|
||||
case let .builtin(reference):
|
||||
|
||||
@ -258,7 +258,7 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager) -
|
||||
effectiveTheme = themeSettings.theme
|
||||
}
|
||||
|
||||
let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color ?? defaultDayAccentColor
|
||||
let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color
|
||||
themeValue = makePresentationTheme(themeReference: effectiveTheme, accentColor: effectiveAccentColor, serviceBackgroundColor: defaultServiceBackgroundColor, baseColor: themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.baseColor ?? .blue)
|
||||
|
||||
if effectiveTheme != themeSettings.theme {
|
||||
@ -522,8 +522,7 @@ public func updatedPresentationData(accountManager: AccountManager, applicationI
|
||||
effectiveTheme = themeSettings.theme
|
||||
}
|
||||
|
||||
let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color ?? defaultDayAccentColor
|
||||
|
||||
let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color
|
||||
let themeValue = makePresentationTheme(themeReference: effectiveTheme, accentColor: effectiveAccentColor, serviceBackgroundColor: serviceBackgroundColor, baseColor: themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.baseColor ?? .blue)
|
||||
|
||||
if effectiveTheme != themeSettings.theme && themeSettings.themeSpecificChatWallpapers[effectiveTheme.index] == nil {
|
||||
|
||||
@ -311,18 +311,23 @@ func fetchLocalBundleResource(postbox: Postbox, resource: LocalBundleResource) -
|
||||
}
|
||||
}
|
||||
|
||||
private let emojis: [String: String] = [
|
||||
"👍": "thumbsup",
|
||||
"😂": "lol",
|
||||
"😒": "meh",
|
||||
"❤️": "heart",
|
||||
"🥳": "celeb",
|
||||
"😳": "confused"
|
||||
private let emojis: [String: (String, CGFloat)] = [
|
||||
"👍": ("thumbs_up_1", 450.0),
|
||||
"👍🏻": ("thumbs_up_2", 450.0),
|
||||
"👍🏼": ("thumbs_up_3", 450.0),
|
||||
"👍🏽": ("thumbs_up_4", 450.0),
|
||||
"👍🏾": ("thumbs_up_5", 450.0),
|
||||
"👍🏿": ("thumbs_up_6", 450.0),
|
||||
"😂": ("lol", 350.0),
|
||||
"😒": ("meh", 350.0),
|
||||
"❤️": ("heart", 350.0),
|
||||
"🥳": ("celeb", 430.0),
|
||||
"😳": ("confused", 350.0)
|
||||
]
|
||||
|
||||
func animatedEmojiResource(emoji: String) -> LocalBundleResource? {
|
||||
if let name = emojis[emoji] {
|
||||
return LocalBundleResource(name: name, ext: "tgs")
|
||||
func animatedEmojiResource(emoji: String) -> (LocalBundleResource, CGFloat)? {
|
||||
if let (name, size) = emojis[emoji] {
|
||||
return (LocalBundleResource(name: name, ext: "tgs"), size)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -1870,8 +1870,8 @@ final class SharedApplicationContext {
|
||||
unknownMessageCategory = UNNotificationCategory(identifier: "unknown", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options)
|
||||
replyMessageCategory = UNNotificationCategory(identifier: "withReply", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions)
|
||||
replyLegacyMessageCategory = UNNotificationCategory(identifier: "r", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions)
|
||||
replyLegacyMediaMessageCategory = UNNotificationCategory(identifier: "m", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options)
|
||||
replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions)
|
||||
replyLegacyMediaMessageCategory = UNNotificationCategory(identifier: "m", actions: [reply], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions)
|
||||
replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions)
|
||||
legacyChannelMessageCategory = UNNotificationCategory(identifier: "c", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options)
|
||||
muteMessageCategory = UNNotificationCategory(identifier: "withMute", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options)
|
||||
muteMediaMessageCategory = UNNotificationCategory(identifier: "withMuteMedia", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options)
|
||||
@ -1882,7 +1882,7 @@ final class SharedApplicationContext {
|
||||
replyMessageCategory = UNNotificationCategory(identifier: "withReply", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], options: carPlayOptions)
|
||||
replyLegacyMessageCategory = UNNotificationCategory(identifier: "r", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], options: carPlayOptions)
|
||||
replyLegacyMediaMessageCategory = UNNotificationCategory(identifier: "m", actions: [reply], intentIdentifiers: [], options: [])
|
||||
replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [], options: carPlayOptions)
|
||||
replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], options: carPlayOptions)
|
||||
legacyChannelMessageCategory = UNNotificationCategory(identifier: "c", actions: [], intentIdentifiers: [], options: [])
|
||||
muteMessageCategory = UNNotificationCategory(identifier: "withMute", actions: [], intentIdentifiers: [], options: [])
|
||||
muteMediaMessageCategory = UNNotificationCategory(identifier: "withMuteMedia", actions: [], intentIdentifiers: [], options: [])
|
||||
|
||||
@ -39,6 +39,8 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
|
||||
private var highlightedState: Bool = false
|
||||
|
||||
private var hapticFeedback: HapticFeedback?
|
||||
|
||||
private var currentSwipeToReplyTranslation: CGFloat = 0.0
|
||||
|
||||
required init() {
|
||||
@ -134,7 +136,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
}
|
||||
|
||||
if self.telegramFile == nil {
|
||||
self.emojiResource = animatedEmojiResource(emoji: item.message.text)
|
||||
self.emojiResource = animatedEmojiResource(emoji: item.message.text)?.0
|
||||
|
||||
if let emojiResource = self.emojiResource {
|
||||
let dummyFile = TelegramMediaFile(fileId: MediaId(namespace: 0, id: 0), partialReference: nil, resource: emojiResource, previewRepresentations: [], immediateThumbnailData: nil, mimeType: "", size: 0, attributes: [])
|
||||
@ -195,27 +197,18 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
return { item, params, mergedTop, mergedBottom, dateHeaderAtBottom in
|
||||
let incoming = item.message.effectivelyIncoming(item.context.account.peerId)
|
||||
var imageSize: CGSize = CGSize(width: 200.0, height: 200.0)
|
||||
var isEmoji = false
|
||||
if let telegramFile = telegramFile {
|
||||
var displaySize = displaySize
|
||||
if !GlobalExperimentalSettings.isAppStoreBuild, let fileName = telegramFile.fileName {
|
||||
let components = fileName.components(separatedBy: "_size")
|
||||
if let size = components.last?.lowercased() {
|
||||
var size = size
|
||||
size.removeLast(4)
|
||||
if let sizeValue = Int(size), sizeValue > 0 && sizeValue < 512 {
|
||||
let side: CGFloat = floor(displaySize.width * CGFloat(sizeValue) / 512.0)
|
||||
displaySize = CGSize(width: side, height: side)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let dimensions = telegramFile.dimensions {
|
||||
imageSize = dimensions.aspectFitted(displaySize)
|
||||
} else if let thumbnailSize = telegramFile.previewRepresentations.first?.dimensions {
|
||||
imageSize = thumbnailSize.aspectFitted(displaySize)
|
||||
}
|
||||
} else {
|
||||
imageSize = CGSize(width: floor(displaySize.width * 0.683), height: floor(displaySize.height * 0.683))
|
||||
if let (_, size) = animatedEmojiResource(emoji: item.message.text) {
|
||||
imageSize = CGSize(width: floor(displaySize.width * size / 512.0), height: floor(displaySize.height * size / 512.0))
|
||||
isEmoji = true
|
||||
}
|
||||
}
|
||||
|
||||
let avatarInset: CGFloat
|
||||
@ -301,7 +294,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
let imageInset: CGFloat = 10.0
|
||||
let innerImageSize = imageSize
|
||||
imageSize = CGSize(width: imageSize.width + imageInset * 2.0, height: imageSize.height + imageInset * 2.0)
|
||||
let imageFrame = CGRect(origin: CGPoint(x: 0.0 + (incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + avatarInset + layoutConstants.bubble.contentInsets.left) : (params.width - params.rightInset - imageSize.width - layoutConstants.bubble.edgeInset - layoutConstants.bubble.contentInsets.left - deliveryFailedInset)), y: 0.0), size: CGSize(width: imageSize.width, height: imageSize.height))
|
||||
var imageFrame = CGRect(origin: CGPoint(x: 0.0 + (incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + avatarInset + layoutConstants.bubble.contentInsets.left) : (params.width - params.rightInset - imageSize.width - layoutConstants.bubble.edgeInset - layoutConstants.bubble.contentInsets.left - deliveryFailedInset)), y: 0.0), size: CGSize(width: imageSize.width, height: imageSize.height))
|
||||
if isEmoji {
|
||||
imageFrame = imageFrame.offsetBy(dx: incoming ? -imageInset : imageInset, dy: 0.0)
|
||||
}
|
||||
|
||||
let arguments = TransformImageArguments(corners: ImageCorners(), imageSize: innerImageSize, boundingSize: innerImageSize, intrinsicInsets: UIEdgeInsets(top: imageInset, left: imageInset, bottom: imageInset, right: imageInset))
|
||||
|
||||
@ -648,7 +644,34 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
||||
}
|
||||
|
||||
if let item = self.item, self.imageNode.frame.contains(location) {
|
||||
let _ = item.controllerInteraction.openMessage(item.message, .default)
|
||||
if self.telegramFile != nil {
|
||||
let _ = item.controllerInteraction.openMessage(item.message, .default)
|
||||
} else if let emoji = self.emojiResource, emoji.name == "heart" {
|
||||
let hapticFeedback: HapticFeedback
|
||||
if let currentHapticFeedback = self.hapticFeedback {
|
||||
hapticFeedback = currentHapticFeedback
|
||||
} else {
|
||||
hapticFeedback = HapticFeedback()
|
||||
self.hapticFeedback = hapticFeedback
|
||||
}
|
||||
hapticFeedback.prepareImpact()
|
||||
hapticFeedback.impact(.heavy)
|
||||
Queue.mainQueue().after(0.2) {
|
||||
hapticFeedback.impact(.medium)
|
||||
Queue.mainQueue().after(0.68) {
|
||||
hapticFeedback.impact(.medium)
|
||||
Queue.mainQueue().after(0.2) {
|
||||
hapticFeedback.impact(.medium)
|
||||
Queue.mainQueue().after(0.68) {
|
||||
hapticFeedback.impact(.medium)
|
||||
Queue.mainQueue().after(0.2) {
|
||||
hapticFeedback.impact(.medium)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_1.tgs
Normal file
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_1.tgs
Normal file
Binary file not shown.
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_2.tgs
Normal file
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_2.tgs
Normal file
Binary file not shown.
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_3.tgs
Normal file
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_3.tgs
Normal file
Binary file not shown.
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_4.tgs
Normal file
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_4.tgs
Normal file
Binary file not shown.
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_5.tgs
Normal file
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_5.tgs
Normal file
Binary file not shown.
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_6.tgs
Normal file
BIN
submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_6.tgs
Normal file
Binary file not shown.
Binary file not shown.
@ -24,7 +24,7 @@ private func generateSwatchImage(color: PresentationThemeAccentColor, selected:
|
||||
context.fillEllipse(in: bounds.insetBy(dx: 4.0, dy: 4.0))
|
||||
context.strokeEllipse(in: bounds.insetBy(dx: 1.0, dy: 1.0))
|
||||
|
||||
if color.baseColor != .white && color.baseColor != .black {
|
||||
if false, color.baseColor != .white && color.baseColor != .black {
|
||||
context.setFillColor(UIColor.white.cgColor)
|
||||
context.fillEllipse(in: CGRect(x: 11.0, y: 18.0, width: 4.0, height: 4.0))
|
||||
context.fillEllipse(in: CGRect(x: 18.0, y: 18.0, width: 4.0, height: 4.0))
|
||||
|
||||
@ -235,13 +235,17 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry {
|
||||
if theme.overallDarkAppearance {
|
||||
colors = colors.filter { $0 != .black }
|
||||
}
|
||||
|
||||
let defaultColor: PresentationThemeAccentColor
|
||||
if case let .builtin(name) = theme.name, name == .night {
|
||||
colors = colors.filter { $0 != .gray }
|
||||
defaultColor = PresentationThemeAccentColor(baseColor: .white, value: 0.5)
|
||||
} else {
|
||||
colors = colors.filter { $0 != .white }
|
||||
defaultColor = PresentationThemeAccentColor(baseColor: .blue, value: 0.5)
|
||||
}
|
||||
|
||||
return ThemeSettingsAccentColorItem(theme: theme, sectionId: self.section, colors: colors, currentColor: color ?? PresentationThemeAccentColor(baseColor: .blue, value: 0.5), updated: { color in
|
||||
return ThemeSettingsAccentColorItem(theme: theme, sectionId: self.section, colors: colors, currentColor: color ?? defaultColor, updated: { color in
|
||||
arguments.selectAccentColor(color)
|
||||
}, toggleSlider: { baseColor in
|
||||
arguments.toggleColorSlider(baseColor == .white || baseColor == .black)
|
||||
@ -374,7 +378,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
|
||||
if let themeSpecificWallpaper = current.themeSpecificChatWallpapers[theme.index] {
|
||||
chatWallpaper = themeSpecificWallpaper
|
||||
} else {
|
||||
let accentColor = current.themeSpecificAccentColors[theme.index]?.color ?? defaultDayAccentColor
|
||||
let accentColor = current.themeSpecificAccentColors[theme.index]?.color
|
||||
let theme = makePresentationTheme(themeReference: theme, accentColor: accentColor, serviceBackgroundColor: defaultServiceBackgroundColor, baseColor: current.themeSpecificAccentColors[theme.index]?.baseColor ?? .blue)
|
||||
chatWallpaper = theme.chat.defaultWallpaper
|
||||
}
|
||||
@ -410,7 +414,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
|
||||
return PresentationThemeSettings(chatWallpaper: chatWallpaper, theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations)
|
||||
}).start()
|
||||
}, toggleColorSlider: { forceHidden in
|
||||
updateState { $0.withDisplayColorSlider(forceHidden ? false : !$0.displayColorSlider) }
|
||||
//updateState { $0.withDisplayColorSlider(forceHidden ? false : !$0.displayColorSlider) }
|
||||
}, openAutoNightTheme: {
|
||||
pushControllerImpl?(themeAutoNightSettingsController(context: context))
|
||||
}, toggleLargeEmoji: { largeEmoji in
|
||||
@ -436,7 +440,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
|
||||
let largeEmoji = settings.largeEmoji
|
||||
let disableAnimations = settings.disableAnimations
|
||||
|
||||
let accentColor = settings.themeSpecificAccentColors[settings.theme.index]?.color ?? defaultDayAccentColor
|
||||
let accentColor = settings.themeSpecificAccentColors[settings.theme.index]?.color
|
||||
let theme = makePresentationTheme(themeReference: settings.theme, accentColor: accentColor, serviceBackgroundColor: defaultServiceBackgroundColor, baseColor: settings.themeSpecificAccentColors[settings.theme.index]?.baseColor ?? .blue, preview: true)
|
||||
|
||||
let wallpaper: TelegramWallpaper
|
||||
|
||||
@ -59,7 +59,7 @@ private func generateThemeIconImage(theme: PresentationThemeReference, accentCol
|
||||
case .night:
|
||||
background = UIColor(rgb: 0x000000)
|
||||
incomingFill = UIColor(rgb: 0x1f1f1f)
|
||||
outgoingFill = accentColor ?? UIColor(rgb: 0x007aff)
|
||||
outgoingFill = accentColor ?? UIColor(rgb: 0x313131)
|
||||
case .nightAccent:
|
||||
let accentColor = accentColor ?? UIColor(rgb: 0x007aff)
|
||||
background = accentColor.withMultiplied(hue: 1.024, saturation: 0.573, brightness: 0.18)
|
||||
@ -402,7 +402,9 @@ class ThemeSettingsThemeItemNode: ListViewItemNode, ItemListItemNode {
|
||||
|
||||
let previousBaseColor = strongSelf.colorSlider.baseColor
|
||||
let newBaseColor = item.currentColor?.baseColor ?? .blue
|
||||
strongSelf.colorSlider.baseColor = newBaseColor
|
||||
if newBaseColor != .black && newBaseColor != .white {
|
||||
strongSelf.colorSlider.baseColor = newBaseColor
|
||||
}
|
||||
if previousBaseColor != newBaseColor {
|
||||
strongSelf.colorSlider.value = item.currentColor?.value ?? 0.5
|
||||
}
|
||||
|
||||
@ -34,8 +34,13 @@
|
||||
091BEAB3214552D9003AEA30 /* Vision.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D02DADBE2138D76F00116225 /* Vision.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
0921F60B228C8765001A13D7 /* ItemListPlaceholderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0921F60A228C8765001A13D7 /* ItemListPlaceholderItem.swift */; };
|
||||
0921F60E228EE000001A13D7 /* ChatMessageActionUrlAuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0921F60D228EE000001A13D7 /* ChatMessageActionUrlAuthController.swift */; };
|
||||
0925902C22EF8158003D6283 /* thumbs_up_5.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902622EF8157003D6283 /* thumbs_up_5.tgs */; };
|
||||
0925902D22EF8158003D6283 /* thumbs_up_6.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902722EF8158003D6283 /* thumbs_up_6.tgs */; };
|
||||
0925902E22EF8158003D6283 /* thumbs_up_3.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902822EF8158003D6283 /* thumbs_up_3.tgs */; };
|
||||
0925902F22EF8158003D6283 /* thumbs_up_1.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902922EF8158003D6283 /* thumbs_up_1.tgs */; };
|
||||
0925903022EF8158003D6283 /* thumbs_up_2.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902A22EF8158003D6283 /* thumbs_up_2.tgs */; };
|
||||
0925903122EF8158003D6283 /* thumbs_up_4.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902B22EF8158003D6283 /* thumbs_up_4.tgs */; };
|
||||
092A65DB22EF16900032E20C /* lol.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D522EF16900032E20C /* lol.tgs */; };
|
||||
092A65DC22EF16900032E20C /* thumbsup.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D622EF16900032E20C /* thumbsup.tgs */; };
|
||||
092A65DD22EF16900032E20C /* meh.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D722EF16900032E20C /* meh.tgs */; };
|
||||
092A65DE22EF16900032E20C /* confused.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D822EF16900032E20C /* confused.tgs */; };
|
||||
092A65DF22EF16900032E20C /* celeb.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D922EF16900032E20C /* celeb.tgs */; };
|
||||
@ -1273,8 +1278,13 @@
|
||||
091954782294754E00E11046 /* AnimatedStickerUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimatedStickerUtils.swift; sourceTree = "<group>"; };
|
||||
0921F60A228C8765001A13D7 /* ItemListPlaceholderItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemListPlaceholderItem.swift; sourceTree = "<group>"; };
|
||||
0921F60D228EE000001A13D7 /* ChatMessageActionUrlAuthController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatMessageActionUrlAuthController.swift; sourceTree = "<group>"; };
|
||||
0925902622EF8157003D6283 /* thumbs_up_5.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_5.tgs; sourceTree = "<group>"; };
|
||||
0925902722EF8158003D6283 /* thumbs_up_6.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_6.tgs; sourceTree = "<group>"; };
|
||||
0925902822EF8158003D6283 /* thumbs_up_3.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_3.tgs; sourceTree = "<group>"; };
|
||||
0925902922EF8158003D6283 /* thumbs_up_1.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_1.tgs; sourceTree = "<group>"; };
|
||||
0925902A22EF8158003D6283 /* thumbs_up_2.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_2.tgs; sourceTree = "<group>"; };
|
||||
0925902B22EF8158003D6283 /* thumbs_up_4.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_4.tgs; sourceTree = "<group>"; };
|
||||
092A65D522EF16900032E20C /* lol.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = lol.tgs; sourceTree = "<group>"; };
|
||||
092A65D622EF16900032E20C /* thumbsup.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbsup.tgs; sourceTree = "<group>"; };
|
||||
092A65D722EF16900032E20C /* meh.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = meh.tgs; sourceTree = "<group>"; };
|
||||
092A65D822EF16900032E20C /* confused.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = confused.tgs; sourceTree = "<group>"; };
|
||||
092A65D922EF16900032E20C /* celeb.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = celeb.tgs; sourceTree = "<group>"; };
|
||||
@ -2606,8 +2616,13 @@
|
||||
092A65D422EF16900032E20C /* Emoji */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0925902922EF8158003D6283 /* thumbs_up_1.tgs */,
|
||||
0925902A22EF8158003D6283 /* thumbs_up_2.tgs */,
|
||||
0925902822EF8158003D6283 /* thumbs_up_3.tgs */,
|
||||
0925902B22EF8158003D6283 /* thumbs_up_4.tgs */,
|
||||
0925902622EF8157003D6283 /* thumbs_up_5.tgs */,
|
||||
0925902722EF8158003D6283 /* thumbs_up_6.tgs */,
|
||||
092A65D522EF16900032E20C /* lol.tgs */,
|
||||
092A65D622EF16900032E20C /* thumbsup.tgs */,
|
||||
092A65D722EF16900032E20C /* meh.tgs */,
|
||||
092A65D822EF16900032E20C /* confused.tgs */,
|
||||
092A65D922EF16900032E20C /* celeb.tgs */,
|
||||
@ -5305,6 +5320,7 @@
|
||||
09874E5121078FA100E190B8 /* Instagram.html in Resources */,
|
||||
09874E5221078FA100E190B8 /* Twitch.html in Resources */,
|
||||
09874E5321078FA100E190B8 /* TwitchUserScript.js in Resources */,
|
||||
0925902F22EF8158003D6283 /* thumbs_up_1.tgs in Resources */,
|
||||
094735122275D72100EA2312 /* anim_mute.json in Resources */,
|
||||
09874E5421078FA100E190B8 /* Vimeo.html in Resources */,
|
||||
09874E5521078FA100E190B8 /* VimeoUserScript.js in Resources */,
|
||||
@ -5348,6 +5364,7 @@
|
||||
D0E9BA971F056F4C00F079A4 /* stp_card_applepay_template@2x.png in Resources */,
|
||||
092A65DD22EF16900032E20C /* meh.tgs in Resources */,
|
||||
D0E9BAB41F056F4C00F079A4 /* stp_card_placeholder_template@3x.png in Resources */,
|
||||
0925903022EF8158003D6283 /* thumbs_up_2.tgs in Resources */,
|
||||
D0E9BAA71F056F4C00F079A4 /* stp_card_form_back@2x.png in Resources */,
|
||||
D0E9BAB11F056F4C00F079A4 /* stp_card_mastercard_template@2x.png in Resources */,
|
||||
D0E9BA9D1F056F4C00F079A4 /* stp_card_diners@2x.png in Resources */,
|
||||
@ -5356,6 +5373,7 @@
|
||||
D0E9BAAC1F056F4C00F079A4 /* stp_card_jcb@3x.png in Resources */,
|
||||
D0E9BA911F056F4C00F079A4 /* stp_card_amex@2x.png in Resources */,
|
||||
D0E9BA931F056F4C00F079A4 /* stp_card_amex_template@2x.png in Resources */,
|
||||
0925903122EF8158003D6283 /* thumbs_up_4.tgs in Resources */,
|
||||
D0E9BAA91F056F4C00F079A4 /* stp_card_form_front@2x.png in Resources */,
|
||||
D0E9BAA41F056F4C00F079A4 /* stp_card_discover_template@3x.png in Resources */,
|
||||
D0E9BAA81F056F4C00F079A4 /* stp_card_form_back@3x.png in Resources */,
|
||||
@ -5364,6 +5382,8 @@
|
||||
D0E9B9EA1F00853C00F079A4 /* PhoneCountries.txt in Resources */,
|
||||
094735152275D72100EA2312 /* anim_unpin.json in Resources */,
|
||||
D0E9BAB31F056F4C00F079A4 /* stp_card_placeholder_template@2x.png in Resources */,
|
||||
0925902E22EF8158003D6283 /* thumbs_up_3.tgs in Resources */,
|
||||
0925902D22EF8158003D6283 /* thumbs_up_6.tgs in Resources */,
|
||||
D0E9BAAE1F056F4C00F079A4 /* stp_card_jcb_template@3x.png in Resources */,
|
||||
D0E9BAAB1F056F4C00F079A4 /* stp_card_jcb@2x.png in Resources */,
|
||||
09E2DA132273367900EA0AA4 /* anim_archiveAvatar.json in Resources */,
|
||||
@ -5374,11 +5394,11 @@
|
||||
D0E9BAB21F056F4C00F079A4 /* stp_card_mastercard_template@3x.png in Resources */,
|
||||
D0E9BA981F056F4C00F079A4 /* stp_card_applepay_template@3x.png in Resources */,
|
||||
D0E9BAA51F056F4C00F079A4 /* stp_card_form_applepay@2x.png in Resources */,
|
||||
0925902C22EF8158003D6283 /* thumbs_up_5.tgs in Resources */,
|
||||
D0E9BAB81F056F4C00F079A4 /* stp_card_visa_template@3x.png in Resources */,
|
||||
D0AF797822C2E26500CECCB8 /* meson.build in Resources */,
|
||||
D0E9BA9B1F056F4C00F079A4 /* stp_card_cvc_amex@2x.png in Resources */,
|
||||
D0E9BAB61F056F4C00F079A4 /* stp_card_visa@3x.png in Resources */,
|
||||
092A65DC22EF16900032E20C /* thumbsup.tgs in Resources */,
|
||||
D0E9BAA61F056F4C00F079A4 /* stp_card_form_applepay@3x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user