no message

This commit is contained in:
Peter 2019-09-01 15:38:33 +04:00
parent 93665ccd21
commit 0d442f04d7
10 changed files with 1135 additions and 6 deletions

View File

@ -28,6 +28,9 @@
<FileRef
location = "group:submodules/libphonenumber/libphonenumber_Xcode.xcodeproj">
</FileRef>
<FileRef
location = "group:/Users/peter/build/telegram-temp/telegram-ios/submodules/rlottie/RLottieBinding_Xcode.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"

View File

@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
D03E3E4A2304B4CC0049C28B /* RLottie.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D03E3E492304B4CC0049C28B /* RLottie.framework */; };
D03E3E4F2304B50A0049C28B /* AnimatedStickerNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03E3E4D2304B50A0049C28B /* AnimatedStickerNode.swift */; };
D03E3E502304B50A0049C28B /* AnimatedStickerUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D03E3E4E2304B50A0049C28B /* AnimatedStickerUtils.swift */; };
D03E3E522304B51A0049C28B /* Postbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D03E3E512304B51A0049C28B /* Postbox.framework */; };
@ -30,6 +29,7 @@
D06018AB22F361FC00796784 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D06018AA22F361FC00796784 /* AsyncDisplayKit.framework */; };
D06018AD22F361FF00796784 /* Lottie.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D06018AC22F361FF00796784 /* Lottie.framework */; };
D06018AF22F3641F00796784 /* FrameworkBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D06018AE22F3641F00796784 /* FrameworkBundle.swift */; };
D0AA5791231BE2E6000F88F3 /* RLottieBinding.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0AA5790231BE2E6000F88F3 /* RLottieBinding.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -58,6 +58,7 @@
D06018AA22F361FC00796784 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D06018AC22F361FF00796784 /* Lottie.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Lottie.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D06018AE22F3641F00796784 /* FrameworkBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrameworkBundle.swift; sourceTree = "<group>"; };
D0AA5790231BE2E6000F88F3 /* RLottieBinding.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RLottieBinding.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -65,6 +66,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D0AA5791231BE2E6000F88F3 /* RLottieBinding.framework in Frameworks */,
D03E3E8E2304B6EC0049C28B /* YuvConversion.framework in Frameworks */,
D03E3E642304B5640049C28B /* MobileCoreServices.framework in Frameworks */,
D03E3E622304B55F0049C28B /* SwiftSignalKit.framework in Frameworks */,
@ -76,7 +78,6 @@
D03E3E562304B52F0049C28B /* libcompression.tbd in Frameworks */,
D03E3E542304B51E0049C28B /* TelegramCore.framework in Frameworks */,
D03E3E522304B51A0049C28B /* Postbox.framework in Frameworks */,
D03E3E4A2304B4CC0049C28B /* RLottie.framework in Frameworks */,
D06018AD22F361FF00796784 /* Lottie.framework in Frameworks */,
D06018AB22F361FC00796784 /* AsyncDisplayKit.framework in Frameworks */,
D06018A922F361F900796784 /* UIKit.framework in Frameworks */,
@ -122,6 +123,7 @@
D06018A522F361F400796784 /* Frameworks */ = {
isa = PBXGroup;
children = (
D0AA5790231BE2E6000F88F3 /* RLottieBinding.framework */,
D03E3E8D2304B6EC0049C28B /* YuvConversion.framework */,
D03E3E632304B5640049C28B /* MobileCoreServices.framework */,
D03E3E612304B55F0049C28B /* SwiftSignalKit.framework */,

View File

@ -5,7 +5,7 @@ import TelegramCore
import Compression
import Display
import AsyncDisplayKit
import RLottie
import RLottieBinding
import GZip
import Tuples
import MediaResources

View File

@ -6,7 +6,7 @@ import Display
import TelegramCore
import Compression
import GZip
import RLottie
import RLottieBinding
import MediaResources
import MobileCoreServices
import MediaResources

View File

@ -74,7 +74,6 @@
D00818CD22B595CB008A895F /* LightweightAccountData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D00818CC22B595CB008A895F /* LightweightAccountData.framework */; };
D00ACA4B20222C280045D427 /* libtgvoip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D00ACA4C20222C280045D427 /* libtgvoip.framework */; };
D00ACA5A2022897D0045D427 /* ProcessedPeerRestrictionText.swift in Sources */ = {isa = PBXBuildFile; fileRef = D00ACA592022897D0045D427 /* ProcessedPeerRestrictionText.swift */; };
D010E17D22C238BC009324D4 /* RLottie.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D010E17C22C238BC009324D4 /* RLottie.framework */; };
D015E04F225D2E5900CB9E8A /* WebP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D015E04E225D2E5900CB9E8A /* WebP.framework */; };
D017734C22049BF800DA06A7 /* UpgradedAccounts.swift in Sources */ = {isa = PBXBuildFile; fileRef = D017734B22049BF800DA06A7 /* UpgradedAccounts.swift */; };
D01776BE1F1E76920044446D /* PeerMediaCollectionSectionsNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D01776BD1F1E76920044446D /* PeerMediaCollectionSectionsNode.swift */; };
@ -236,6 +235,7 @@
D09E77A922FA5CEA00B9CCA7 /* TextFormat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D09E77A822FA5CEA00B9CCA7 /* TextFormat.framework */; };
D09E77AB22FA5CEA00B9CCA7 /* Tuples.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D09E77AA22FA5CEA00B9CCA7 /* Tuples.framework */; };
D09E77AD22FA5CEA00B9CCA7 /* UrlEscaping.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D09E77AC22FA5CEA00B9CCA7 /* UrlEscaping.framework */; };
D0AA5793231BE2FD000F88F3 /* RLottieBinding.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0AA5792231BE2FD000F88F3 /* RLottieBinding.framework */; };
D0AA840C1FEB2BA3005C6E91 /* OverlayPlayerControlsNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0AA840B1FEB2BA3005C6E91 /* OverlayPlayerControlsNode.swift */; };
D0AB262921C307D7008F6685 /* ChatMessagePollBubbleContentNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0AB262821C307D7008F6685 /* ChatMessagePollBubbleContentNode.swift */; };
D0ACCB1C1EC5FF4B0079D8BF /* ChatMessageCallBubbleContentNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0ACCB1B1EC5FF4B0079D8BF /* ChatMessageCallBubbleContentNode.swift */; };
@ -895,6 +895,7 @@
D09E77A822FA5CEA00B9CCA7 /* TextFormat.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = TextFormat.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D09E77AA22FA5CEA00B9CCA7 /* Tuples.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Tuples.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D09E77AC22FA5CEA00B9CCA7 /* UrlEscaping.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = UrlEscaping.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D0AA5792231BE2FD000F88F3 /* RLottieBinding.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RLottieBinding.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D0AA840B1FEB2BA3005C6E91 /* OverlayPlayerControlsNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverlayPlayerControlsNode.swift; sourceTree = "<group>"; };
D0AB0BB01D6718DA002C78E7 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
D0AB0BB21D6718EB002C78E7 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
@ -1169,6 +1170,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D0AA5793231BE2FD000F88F3 /* RLottieBinding.framework in Frameworks */,
09B4A9BA231519CD005C2E08 /* VideoToolbox.framework in Frameworks */,
D072F38423155EAF0009E66F /* MessageReactionListUI.framework in Frameworks */,
D03E495D230868DF0049C28B /* PersistentStringHash.framework in Frameworks */,
@ -1302,7 +1304,6 @@
D060184222F35D2000796784 /* ActivityIndicator.framework in Frameworks */,
D060184022F35D1C00796784 /* MergeLists.framework in Frameworks */,
D0D3281422F31B3000D07EE2 /* TelegramUpdateUI.framework in Frameworks */,
D010E17D22C238BC009324D4 /* RLottie.framework in Frameworks */,
D03AE67522B945D30078411C /* BuildConfig.framework in Frameworks */,
D03AE67322B9459C0078411C /* HockeySDK.framework in Frameworks */,
D02D634A22B85B94006BE519 /* PushKit.framework in Frameworks */,
@ -1774,6 +1775,7 @@
D08D45281D5E340200A7428A /* Frameworks */ = {
isa = PBXGroup;
children = (
D0AA5792231BE2FD000F88F3 /* RLottieBinding.framework */,
09B4A9B9231519CD005C2E08 /* VideoToolbox.framework */,
D072F38323155EAF0009E66F /* MessageReactionListUI.framework */,
D03E495C230868DF0049C28B /* PersistentStringHash.framework */,

22
submodules/rlottie/Info.plist Executable file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>

View File

@ -0,0 +1,18 @@
#ifndef Lottie_h
#define Lottie_h
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
@interface LottieInstance : NSObject
@property (nonatomic, readonly) int32_t frameCount;
@property (nonatomic, readonly) int32_t frameRate;
@property (nonatomic, readonly) CGSize dimensions;
- (instancetype _Nullable)initWithData:(NSData * _Nonnull)data cacheKey:(NSString * _Nonnull)cacheKey;
- (void)renderFrameWithIndex:(int32_t)index into:(uint8_t * _Nonnull)buffer width:(int32_t)width height:(int32_t)height bytesPerRow:(int32_t)bytesPerRow;
@end
#endif /* Lottie_h */

View File

@ -0,0 +1,46 @@
#import "LottieInstance.h"
#include "rlottie.h"
@interface LottieInstance () {
std::unique_ptr<rlottie::Animation> _animation;
}
@end
@implementation LottieInstance
- (instancetype _Nullable)initWithData:(NSData * _Nonnull)data cacheKey:(NSString * _Nonnull)cacheKey {
self = [super init];
if (self != nil) {
_animation = rlottie::Animation::loadFromData(std::string(reinterpret_cast<const char *>(data.bytes), data.length), std::string([cacheKey UTF8String]));
if (_animation == nullptr) {
return nil;
}
_frameCount = (int32_t)_animation->totalFrame();
_frameRate = (int32_t)_animation->frameRate();
size_t width = 0;
size_t height = 0;
_animation->size(width, height);
if (width > 1024 || height > 1024) {
return nil;
}
_dimensions = CGSizeMake(width, height);
if ((_frameRate > 60) || _animation->duration() > 7.0) {
return nil;
}
}
return self;
}
- (void)renderFrameWithIndex:(int32_t)index into:(uint8_t * _Nonnull)buffer width:(int32_t)width height:(int32_t)height bytesPerRow:(int32_t) bytesPerRow{
rlottie::Surface surface((uint32_t *)buffer, width, height, bytesPerRow);
_animation->renderSync(index, surface);
}
@end

View File

@ -0,0 +1,18 @@
//
// RLottie.h
// RLottie
//
// Created by Peter on 6/25/19.
// Copyright © 2019 Telegram LLP. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for RLottie.
FOUNDATION_EXPORT double RLottieBindingVersionNumber;
//! Project version string for RLottie.
FOUNDATION_EXPORT const unsigned char RLottieBindingVersionString[];
#import <RLottieBinding/LottieInstance.h>

File diff suppressed because it is too large Load Diff