mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Replace legacy background with vector one
This commit is contained in:
parent
b39238c6db
commit
7fcce53b2c
@ -375,6 +375,16 @@ final class ThemeGridControllerNode: ASDisplayNode {
|
||||
sortedWallpapers = wallpapers.map(\.wallpaper)
|
||||
}
|
||||
|
||||
if let builtinIndex = sortedWallpapers.firstIndex(where: { wallpaper in
|
||||
if case .builtin = wallpaper {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}) {
|
||||
sortedWallpapers[builtinIndex] = defaultBuiltinWallpaper(data: .legacy, colors: legacyBuiltinWallpaperGradientColors.map(\.rgb))
|
||||
}
|
||||
|
||||
for wallpaper in sortedWallpapers {
|
||||
if case let .file(file) = wallpaper, (wallpaper.isPattern && file.settings.colors.isEmpty) {
|
||||
continue
|
||||
|
@ -1049,6 +1049,10 @@ public func makeDefaultDayPresentationTheme(extendingThemeReference: Presentatio
|
||||
)
|
||||
}
|
||||
|
||||
public let legacyBuiltinWallpaperGradientColors: [UIColor] = [
|
||||
UIColor(rgb: 0xd6e2ee)
|
||||
]
|
||||
|
||||
public let defaultBuiltinWallpaperGradientColors: [UIColor] = [
|
||||
UIColor(rgb: 0xdbddbb),
|
||||
UIColor(rgb: 0x6ba587),
|
||||
@ -1076,6 +1080,15 @@ public extension BuiltinWallpaperData {
|
||||
datacenterId: 4,
|
||||
fileSize: 183832
|
||||
)
|
||||
static let legacy = BuiltinWallpaperData(
|
||||
wallpaperId: 5911458201550716931,
|
||||
wallpaperAccessHash: -5164387148619674119,
|
||||
slug: "Ye7DfT2kCVIKAAAAhzXfrkdOjxs",
|
||||
fileId: 5911315028815907420,
|
||||
fileAccessHash: 5205407890340371688,
|
||||
datacenterId: 2,
|
||||
fileSize: 71715
|
||||
)
|
||||
static let variant1 = BuiltinWallpaperData(
|
||||
wallpaperId: 5784984711902265347,
|
||||
wallpaperAccessHash: -7073897034484875424,
|
||||
@ -1206,6 +1219,7 @@ public extension BuiltinWallpaperData {
|
||||
static func generate(account: Account) {
|
||||
let slugToName: [(String, String)] = [
|
||||
("fqv01SQemVIBAAAApND8LDRUhRU", "`default`"),
|
||||
("Ye7DfT2kCVIKAAAAhzXfrkdOjxs", "legacy"),
|
||||
("RlZs2PJkSFADAAAAElGaGwgJBgU", "variant1"),
|
||||
("9LW_RcoOSVACAAAAFTk3DTyXN-M", "variant2"),
|
||||
("CJNyxPMgSVAEAAAAvW9sMwc51cw", "variant3"),
|
||||
|
@ -383,7 +383,10 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager<Te
|
||||
let effectiveColors = themeSettings.themeSpecificAccentColors[effectiveTheme.index]
|
||||
let theme = makePresentationTheme(mediaBox: accountManager.mediaBox, themeReference: effectiveTheme, baseTheme: preferredBaseTheme, accentColor: effectiveColors?.colorFor(baseTheme: preferredBaseTheme ?? .day), bubbleColors: effectiveColors?.customBubbleColors ?? [], baseColor: effectiveColors?.baseColor) ?? defaultPresentationTheme
|
||||
|
||||
let effectiveChatWallpaper: TelegramWallpaper = (themeSettings.themeSpecificChatWallpapers[coloredThemeIndex(reference: effectiveTheme, accentColor: effectiveColors)] ?? themeSettings.themeSpecificChatWallpapers[effectiveTheme.index]) ?? theme.chat.defaultWallpaper
|
||||
var effectiveChatWallpaper: TelegramWallpaper = (themeSettings.themeSpecificChatWallpapers[coloredThemeIndex(reference: effectiveTheme, accentColor: effectiveColors)] ?? themeSettings.themeSpecificChatWallpapers[effectiveTheme.index]) ?? theme.chat.defaultWallpaper
|
||||
if case .builtin = effectiveChatWallpaper {
|
||||
effectiveChatWallpaper = defaultBuiltinWallpaper(data: .legacy, colors: legacyBuiltinWallpaperGradientColors.map(\.rgb))
|
||||
}
|
||||
|
||||
let dateTimeFormat = currentDateTimeFormat()
|
||||
let stringsValue: PresentationStrings
|
||||
@ -763,6 +766,10 @@ public func updatedPresentationData(accountManager: AccountManager<TelegramAccou
|
||||
}
|
||||
}
|
||||
|
||||
if case .builtin = effectiveChatWallpaper {
|
||||
effectiveChatWallpaper = defaultBuiltinWallpaper(data: .legacy, colors: legacyBuiltinWallpaperGradientColors.map(\.rgb))
|
||||
}
|
||||
|
||||
if let colors = effectiveColors, colors.baseColor == .theme {
|
||||
effectiveColors = nil
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 498 KiB |
BIN
submodules/TelegramUI/Resources/Ye7DfT2kCVIKAAAAhzXfrkdOjxs.tgv
Normal file
BIN
submodules/TelegramUI/Resources/Ye7DfT2kCVIKAAAAhzXfrkdOjxs.tgv
Normal file
Binary file not shown.
@ -36,7 +36,8 @@ func makeTelegramAccountAuxiliaryMethods(appDelegate: AppDelegate?) -> AccountAu
|
||||
}
|
||||
} else if let wallpaperResource = resource as? WallpaperDataResource {
|
||||
let builtinWallpapers: [String] = [
|
||||
"fqv01SQemVIBAAAApND8LDRUhRU"
|
||||
"fqv01SQemVIBAAAApND8LDRUhRU",
|
||||
"Ye7DfT2kCVIKAAAAhzXfrkdOjxs"
|
||||
]
|
||||
if builtinWallpapers.contains(wallpaperResource.slug) {
|
||||
if let url = getAppBundle().url(forResource: wallpaperResource.slug, withExtension: "tgv") {
|
||||
@ -67,6 +68,19 @@ func makeTelegramAccountAuxiliaryMethods(appDelegate: AppDelegate?) -> AccountAu
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
} else if cloudDocumentMediaResource.fileId == 5911315028815907420 {
|
||||
if let url = getAppBundle().url(forResource: "Ye7DfT2kCVIKAAAAhzXfrkdOjxs", withExtension: "tgv") {
|
||||
return Signal { subscriber in
|
||||
subscriber.putNext(.reset)
|
||||
if let data = try? Data(contentsOf: url, options: .mappedRead) {
|
||||
subscriber.putNext(.dataPart(resourceOffset: 0, data: data, range: 0 ..< Int64(data.count), complete: true))
|
||||
}
|
||||
|
||||
return EmptyDisposable
|
||||
}
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
} else if let cloudDocumentSizeMediaResource = resource as? CloudDocumentSizeMediaResource {
|
||||
if cloudDocumentSizeMediaResource.documentId == 5789658100176783156 && cloudDocumentSizeMediaResource.sizeSpec == "m" {
|
||||
|
@ -1035,7 +1035,7 @@ final class WallpaperBackgroundNodeImpl: ASDisplayNode, WallpaperBackgroundNode
|
||||
if patternIsBlack {
|
||||
self.patternImageLayer.softlightMode = .never
|
||||
} else {
|
||||
if self.useSharedAnimationPhase {
|
||||
if self.useSharedAnimationPhase && file.settings.colors.count > 2 {
|
||||
self.patternImageLayer.softlightMode = .whileAnimating
|
||||
} else {
|
||||
self.patternImageLayer.softlightMode = .always
|
||||
|
Loading…
x
Reference in New Issue
Block a user