mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge commit '62b259b4d30e7726b11f107ff5570b58c95773a0'
This commit is contained in:
commit
3989b4887d
@ -13,7 +13,7 @@
|
||||
@property (nonatomic, readonly) bool isAnimation;
|
||||
@property (nonatomic, readonly) TGMediaAsset *originalAsset;
|
||||
@property (nonatomic, readonly) CGSize dimensions;
|
||||
|
||||
@property (nonatomic, readonly) NSString *uniformTypeIdentifier;
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url;
|
||||
- (instancetype)initWithAsset:(TGMediaAsset *)asset livePhoto:(bool)livePhoto;
|
||||
|
@ -88,6 +88,11 @@
|
||||
return _cachedAVAsset;
|
||||
}
|
||||
|
||||
- (NSString *)uniformTypeIdentifier
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (SSignal *)avAsset {
|
||||
if (_originalAsset != nil) {
|
||||
if (_cachedAVAsset != nil) {
|
||||
|
@ -1107,7 +1107,11 @@
|
||||
}
|
||||
else if (self.item.avAsset != nil) {
|
||||
itemSignal = [self.item.avAsset mapToSignal:^SSignal *(AVAsset *avAsset) {
|
||||
if ([avAsset isKindOfClass:[AVAsset class]]) {
|
||||
return [SSignal single:[AVPlayerItem playerItemWithAsset:avAsset]];
|
||||
} else {
|
||||
return [SSignal never];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,9 @@
|
||||
|
||||
+ (SSignal *)convertAVAsset:(AVAsset *)avAsset adjustments:(TGMediaVideoEditAdjustments *)adjustments watcher:(TGMediaVideoFileWatcher *)watcher inhibitAudio:(bool)inhibitAudio entityRenderer:(id<TGPhotoPaintEntityRenderer>)entityRenderer
|
||||
{
|
||||
if ([avAsset isKindOfClass:[NSURL class]]) {
|
||||
avAsset = [[AVURLAsset alloc] initWithURL:(NSURL *)avAsset options:nil];
|
||||
}
|
||||
SQueue *queue = [[SQueue alloc] init];
|
||||
|
||||
return [[SSignal alloc] initWithGenerator:^id<SDisposable>(SSubscriber *subscriber)
|
||||
|
@ -74,10 +74,10 @@ public struct Namespaces {
|
||||
public static let cachedPollResults: Int8 = 9
|
||||
public static let cachedContextResults: Int8 = 10
|
||||
public static let proximityNotificationStoredState: Int8 = 11
|
||||
public static let cachedPeerInvitationImporters: Int8 = 12
|
||||
public static let cachedPeerExportedInvitations: Int8 = 13
|
||||
public static let cachedGroupCallDisplayAsPeers: Int8 = 14
|
||||
public static let cachedAdMessageStates: Int8 = 15
|
||||
public static let cachedPeerInvitationImporters: Int8 = 16
|
||||
public static let cachedPeerExportedInvitations: Int8 = 17
|
||||
}
|
||||
|
||||
public struct UnorderedItemList {
|
||||
|
@ -285,18 +285,29 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager<Te
|
||||
let contactSettings: ContactSynchronizationSettings = transaction.getSharedData(ApplicationSpecificSharedDataKeys.contactSynchronizationSettings)?.get(ContactSynchronizationSettings.self) ?? ContactSynchronizationSettings.defaultSettings
|
||||
|
||||
let effectiveTheme: PresentationThemeReference
|
||||
var preferredBaseTheme: TelegramBaseTheme?
|
||||
let parameters = AutomaticThemeSwitchParameters(settings: themeSettings.automaticThemeSwitchSetting)
|
||||
let autoNightModeTriggered: Bool
|
||||
if automaticThemeShouldSwitchNow(parameters, systemUserInterfaceStyle: systemUserInterfaceStyle) {
|
||||
effectiveTheme = themeSettings.automaticThemeSwitchSetting.theme
|
||||
autoNightModeTriggered = true
|
||||
|
||||
if let baseTheme = themeSettings.themePreferredBaseTheme[effectiveTheme.index], [.night, .tinted].contains(baseTheme) {
|
||||
preferredBaseTheme = baseTheme
|
||||
} else {
|
||||
preferredBaseTheme = .night
|
||||
}
|
||||
} else {
|
||||
effectiveTheme = themeSettings.theme
|
||||
autoNightModeTriggered = false
|
||||
|
||||
if let baseTheme = themeSettings.themePreferredBaseTheme[effectiveTheme.index], [.classic, .day].contains(baseTheme) {
|
||||
preferredBaseTheme = baseTheme
|
||||
}
|
||||
}
|
||||
|
||||
let effectiveColors = themeSettings.themeSpecificAccentColors[effectiveTheme.index]
|
||||
let theme = makePresentationTheme(mediaBox: accountManager.mediaBox, themeReference: effectiveTheme, accentColor: effectiveColors?.color, bubbleColors: effectiveColors?.customBubbleColors ?? [], baseColor: effectiveColors?.baseColor) ?? defaultPresentationTheme
|
||||
let theme = makePresentationTheme(mediaBox: accountManager.mediaBox, themeReference: effectiveTheme, baseTheme: preferredBaseTheme, accentColor: effectiveColors?.color, bubbleColors: effectiveColors?.customBubbleColors ?? [], baseColor: effectiveColors?.baseColor) ?? defaultPresentationTheme
|
||||
|
||||
|
||||
let effectiveChatWallpaper: TelegramWallpaper = (themeSettings.themeSpecificChatWallpapers[coloredThemeIndex(reference: effectiveTheme, accentColor: effectiveColors)] ?? themeSettings.themeSpecificChatWallpapers[effectiveTheme.index]) ?? theme.chat.defaultWallpaper
|
||||
|
Loading…
x
Reference in New Issue
Block a user