Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
OpenSource Tweaks from TitanD3v
Browse files Browse the repository at this point in the history
backup
  • Loading branch information
RobyRew committed Apr 16, 2022
0 parents commit 1e82f7b
Show file tree
Hide file tree
Showing 2,328 changed files with 111,272 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added Avatar/.DS_Store
Binary file not shown.
Binary file added Avatar/App/.DS_Store
Binary file not shown.
44 changes: 44 additions & 0 deletions Avatar/App/Avatar.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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>platform-application</key>
<true/>
<key>com.apple.private.security.no-container</key>
<true/>
<key>com.apple.private.skip-library-validation</key>
<true/>
<key>get-task-allow</key>
<true/>
<key>com.apple.security.iokit-user-client-class</key>
<array>
<string>AGXCommandQueue</string>
<string>AGXDevice</string>
<string>AGXDeviceUserClient</string>
<string>AGXSharedUserClient</string>
<string>AppleCredentialManagerUserClient</string>
<string>AppleJPEGDriverUserClient</string>
<string>ApplePPMUserClient</string>
<string>AppleSPUHIDDeviceUserClient</string>
<string>AppleSPUHIDDriverUserClient</string>
<string>IOAccelContext</string>
<string>IOAccelContext2</string>
<string>IOAccelDevice</string>
<string>IOAccelDevice2</string>
<string>IOAccelSharedUserClient</string>
<string>IOAccelSharedUserClient2</string>
<string>IOAccelSubmitter2</string>
<string>IOHIDEventServiceFastPathUserClient</string>
<string>IOHIDLibUserClient</string>
<string>IOMobileFramebufferUserClient</string>
<string>IOReportUserClient</string>
<string>IOSurfaceAcceleratorClient</string>
<string>IOSurfaceRootUserClient</string>
<string>RootDomainUserClient</string>
</array>
<key>com.apple.security.exception.files.home-relative-path.read-write</key>
<array>
<string>/var/mobile/Library/Preferences/com.TitanD3v.AvatarApp.plist</string>
</array>
</dict>
</plist>
862 changes: 862 additions & 0 deletions Avatar/App/Avatar.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>SchemeUserState</key>
<dict>
<key>Avatar.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
7 changes: 7 additions & 0 deletions Avatar/App/Avatar/Animoji/AnimojiPickerCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import UIKit;
#import "AVTAnimoji.h"

@interface AnimojiPickerCell : UICollectionViewCell
@property (nonatomic, strong) UIImageView *puppetImageView;
@property (nonatomic, copy) NSString *puppetName;
@end
38 changes: 38 additions & 0 deletions Avatar/App/Avatar/Animoji/AnimojiPickerCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#import "AnimojiPickerCell.h"


@implementation AnimojiPickerCell

- (void)willMoveToSuperview:(UIView *)newSuperview {
[super willMoveToSuperview:newSuperview];

[self layoutImageView];
}


- (void)layoutImageView {

if (self.puppetImageView) return;

self.puppetImageView = [UIImageView new];
self.puppetImageView.contentMode = UIViewContentModeScaleAspectFit;
self.puppetImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.puppetImageView.frame = self.contentView.bounds;
[self.contentView addSubview:self.puppetImageView];

[self updateImage];
}


- (void)setPuppetName:(NSString *)puppetName {
_puppetName = [puppetName copy];
[self updateImage];
}


- (void)updateImage {
if (!_puppetName.length) return;
self.puppetImageView.image = [ASAnimoji thumbnailForAnimojiNamed:_puppetName options:nil];
}

@end
17 changes: 17 additions & 0 deletions Avatar/App/Avatar/Animoji/AnimojiPickerViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#import <UIKit/UIKit.h>
#import "AVTAnimoji.h"
#import "AnimojiPickerCell.h"


@protocol AnimojiPickerDelegate <NSObject>
- (void)didSelectAnimojiWithName:(NSString *)animojiName;
@end


@interface AnimojiPickerViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, weak) id<AnimojiPickerDelegate> delegate;
@property (nonatomic, assign) CGFloat referenceHeight;
-(void)selectPuppetWithName:(NSString *)puppetName;
@property (nonatomic, strong) UICollectionViewFlowLayout *flowLayout;
@property (nonatomic, strong) UICollectionView *collectionView;
@end
94 changes: 94 additions & 0 deletions Avatar/App/Avatar/Animoji/AnimojiPickerViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#import "AnimojiPickerViewController.h"

@interface AnimojiPickerViewController ()
@property (nonatomic, copy) NSArray <NSString *> *puppetNames;
@end


@implementation AnimojiPickerViewController

- (void)viewDidLoad {
[super viewDidLoad];

self.view.backgroundColor = [UIColor colorNamed:@"Primary"];
self.puppetNames = [ASAnimoji puppetNames];

[self layoutCollectionView];
}


- (void)layoutCollectionView {

self.flowLayout = [self makeFlowLayout];
self.collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:self.flowLayout];
self.collectionView.showsVerticalScrollIndicator = NO;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.backgroundColor = UIColor.clearColor;
self.collectionView.backgroundView = nil;
self.collectionView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.collectionView.frame = self.view.bounds;
[self.collectionView registerClass:[AnimojiPickerCell class] forCellWithReuseIdentifier:@"AnimojiCell"];
[self.view addSubview:self.collectionView];

self.collectionView.delegate = self;
self.collectionView.dataSource = self;
}


- (UICollectionViewFlowLayout *)makeFlowLayout {

UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new];
layout.scrollDirection = UICollectionViewScrollDirectionVertical;

CGFloat itemSize;
CGFloat padding = 28;
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
CGFloat puppetsPerLine = 3;

itemSize = (screenWidth / puppetsPerLine) - (padding * puppetsPerLine) + (padding * 2);

layout.sectionInset = UIEdgeInsetsMake(padding, padding, padding, padding);
layout.itemSize = CGSizeMake(itemSize, itemSize);

return layout;
}


- (void)setPuppetNames:(NSArray<NSString *> *)puppetNames {
_puppetNames = [puppetNames copy];
[self.collectionView reloadData];
}


- (void)selectPuppetWithName:(NSString *)puppetName {
if (![self.puppetNames containsObject:puppetName]) return;
NSUInteger idx = [self.puppetNames indexOfObject:puppetName];
[self.collectionView selectItemAtIndexPath:[NSIndexPath indexPathForItem:idx inSection:0] animated:NO scrollPosition:UICollectionViewScrollPositionCenteredHorizontally];
}


- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}


- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.puppetNames.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
AnimojiPickerCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AnimojiCell" forIndexPath:indexPath];

cell.puppetName = self.puppetNames[indexPath.item];

return cell;
}


- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
NSString *animoji = self.puppetNames[indexPath.item];
[self.delegate didSelectAnimojiWithName:animoji];
[self dismissViewControllerAnimated:YES completion:nil];
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
100 changes: 100 additions & 0 deletions Avatar/App/Avatar/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "icon-120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "icon-180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Avatar/App/Avatar/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions Avatar/App/Avatar/Assets.xcassets/Onboarding/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "recording-tutorial.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Avatar/App/Avatar/Assets.xcassets/Social/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 1e82f7b

Please sign in to comment.