Skip to content

Commit

Permalink
Merge pull request #97 from xiangxiaopenyou/master
Browse files Browse the repository at this point in the history
v8.6.0
  • Loading branch information
kurtchen1988 authored Mar 30, 2023
2 parents 0a0e8a0 + 121be6c commit da43397
Show file tree
Hide file tree
Showing 260 changed files with 3,127 additions and 979 deletions.
16 changes: 16 additions & 0 deletions FUBeautyComponent/FUBeautyComponent.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Pod::Spec.new do |s|
s.name = "FUBeautyComponent"
s.version = "1.0"
s.license = 'MIT'
s.summary = "Beauty component"
s.description = "The beauty component of FULiveDemo."
s.homepage = "https://github.com/Faceunity/FULiveDemo"
s.author = { 'faceunity' => 'dev@faceunity.com' }
s.platform = :ios, "9.0"
s.source = { "http": "https://github.com/Faceunity/FULiveDemo"}
s.source_files = '**/*.{h,m}'
s.resources = 'FUBeautyComponent/Resource/**/*.{json}'
s.requires_arc = true
s.dependency 'FURenderKit'
s.dependency 'FUCommonUIComponent'
end
4 changes: 0 additions & 4 deletions FUBeautyComponent/FUBeautyComponent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
E34C47FC2853381E0040093C /* FUBeautyDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = E34C47F52853381E0040093C /* FUBeautyDefine.h */; };
E34C4831285347100040093C /* FUBeautyComponentManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E34C482F285347100040093C /* FUBeautyComponentManager.m */; };
E3618FEC28583B9B00E7D8D2 /* FUBeautyDefine.m in Sources */ = {isa = PBXBuildFile; fileRef = E3618FEB28583B9B00E7D8D2 /* FUBeautyDefine.m */; };
E369F8D028D851550036AC5A /* FURenderKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E369F8CF28D851550036AC5A /* FURenderKit.framework */; };
E3DC948D28900EE60016C9B1 /* FUCommonUIComponent.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E338349B286173C10023482D /* FUCommonUIComponent.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -74,8 +72,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E369F8D028D851550036AC5A /* FURenderKit.framework in Frameworks */,
E3DC948D28900EE60016C9B1 /* FUCommonUIComponent.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ - (UILabel *)textLabel {
_textLabel.textColor = [UIColor whiteColor];
_textLabel.font = [UIFont systemFontOfSize:10];
_textLabel.textAlignment = NSTextAlignmentCenter;
_textLabel.adjustsFontSizeToFitWidth = YES;
_textLabel.translatesAutoresizingMaskIntoConstraints = NO;
}
return _textLabel;
Expand Down
8 changes: 5 additions & 3 deletions FUBeautyComponent/FUBeautyComponent/View/FUBeautyShapeView.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ - (instancetype)initWithFrame:(CGRect)frame {

[self.contentView addSubview:self.textLabel];
NSLayoutConstraint *textTop = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.imageView attribute:NSLayoutAttributeBottom multiplier:1 constant:7];

NSLayoutConstraint *textCenterX = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
[self.contentView addConstraints:@[textTop, textCenterX]];
NSLayoutConstraint *textLeading = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeading multiplier:1 constant:0];
NSLayoutConstraint *textTrailing = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTrailing multiplier:1 constant:0];
[self.contentView addConstraints:@[textTop, textLeading, textTrailing]];
}
return self;
}
Expand Down Expand Up @@ -287,6 +287,8 @@ - (UILabel *)textLabel {
_textLabel = [[UILabel alloc] init];
_textLabel.font = [UIFont systemFontOfSize:10];
_textLabel.textColor = [UIColor whiteColor];
_textLabel.textAlignment = NSTextAlignmentCenter;
_textLabel.adjustsFontSizeToFitWidth = YES;
_textLabel.translatesAutoresizingMaskIntoConstraints = NO;
}
return _textLabel;
Expand Down
8 changes: 5 additions & 3 deletions FUBeautyComponent/FUBeautyComponent/View/FUBeautySkinView.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ - (instancetype)initWithFrame:(CGRect)frame {

[self.contentView addSubview:self.textLabel];
NSLayoutConstraint *textTop = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.imageView attribute:NSLayoutAttributeBottom multiplier:1 constant:7];

NSLayoutConstraint *textCenterX = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
[self.contentView addConstraints:@[textTop, textCenterX]];
NSLayoutConstraint *textLeading = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeading multiplier:1 constant:0];
NSLayoutConstraint *textTrailing = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTrailing multiplier:1 constant:0];
[self.contentView addConstraints:@[textTop, textLeading, textTrailing]];
}
return self;
}
Expand Down Expand Up @@ -258,6 +258,8 @@ - (UILabel *)textLabel {
_textLabel = [[UILabel alloc] init];
_textLabel.font = [UIFont systemFontOfSize:10];
_textLabel.textColor = [UIColor whiteColor];
_textLabel.textAlignment = NSTextAlignmentCenter;
_textLabel.adjustsFontSizeToFitWidth = YES;
_textLabel.translatesAutoresizingMaskIntoConstraints = NO;
}
return _textLabel;
Expand Down
14 changes: 14 additions & 0 deletions FUCommonUIComponent/FUCommonUIComponent.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Pod::Spec.new do |s|
s.name = "FUCommonUIComponent"
s.version = "1.0"
s.license = 'MIT'
s.summary = "UI components"
s.description = "Some UI components of FULiveDemo."
s.homepage = "https://github.com/Faceunity/FULiveDemo"
s.author = { 'faceunity' => 'dev@faceunity.com' }
s.platform = :ios, "9.0"
s.source = { "http": "https://github.com/Faceunity/FULiveDemo"}
s.source_files = '**/*.{h,m}'
s.resources = 'FUCommonUIComponent/Resource/**/*.{png,xcassets}'
s.requires_arc = true
end

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ + (UIViewController *)topViewController {

+ (UIViewController *)currentViewControllerWithRootViewController:(UIViewController *)viewController {
if (viewController.presentedViewController) {
return [self currentViewControllerWithRootViewController:viewController.presentingViewController];
return [self currentViewControllerWithRootViewController:viewController.presentedViewController];
} else if ([viewController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navigation = (UINavigationController *)viewController;
return [self currentViewControllerWithRootViewController:navigation.visibleViewController];
Expand Down
24 changes: 6 additions & 18 deletions FUCommonUIComponent/FUCommonUIComponent/FUTipHUD/FUTipHUD.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,31 @@ + (void)showTips:(NSString *)tipsString dismissWithDelay:(NSTimeInterval)delay p

__block FUInsetsLabel *tipLabel = [[FUInsetsLabel alloc] initWithFrame:CGRectZero insets:UIEdgeInsetsMake(8, 20, 8, 20)];
tipLabel.backgroundColor = [UIColor colorWithRed:5/255.0 green:15/255.0 blue:20/255.0 alpha:0.74];
tipLabel.text = tipsString;
tipLabel.textColor = [UIColor whiteColor];
tipLabel.font = [UIFont systemFontOfSize:13];
tipLabel.numberOfLines = 0;
tipLabel.layer.masksToBounds = YES;
tipLabel.layer.cornerRadius = 4;
tipLabel.translatesAutoresizingMaskIntoConstraints = NO;
tipLabel.text = tipsString;
[window addSubview:tipLabel];

CGFloat tipWidth = [tipsString sizeWithAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:13]}].width;
if (position == FUTipHUDPositionTop) {
CGFloat topConstant = 0;
if (@available(iOS 11.0, *)) {
topConstant = window.safeAreaInsets.top;
}
NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeTop multiplier:1 constant:84 + topConstant];
[window addConstraint:topConstraint];
if (tipWidth + 50 > CGRectGetWidth(window.bounds)) {
NSLayoutConstraint *leadingConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeLeading multiplier:1.0 constant:5];
NSLayoutConstraint *trailingConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeTrailing multiplier:1.0 constant:-5];
[window addConstraints:@[leadingConstraint, trailingConstraint]];
} else {
NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
[window addConstraint:centerXConstraint];
}
} else {
NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
[window addConstraint:centerYConstraint];
if (tipWidth + 50 > CGRectGetWidth(window.bounds)) {
NSLayoutConstraint *leadingConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeLeading multiplier:1.0 constant:5];
NSLayoutConstraint *trailingConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeTrailing multiplier:1.0 constant:-5];
[window addConstraints:@[leadingConstraint, trailingConstraint]];
} else {
NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
[window addConstraint:centerXConstraint];
}
}
CGFloat windowWidth = CGRectGetWidth(window.bounds);
NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationLessThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:windowWidth - 40];
NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint constraintWithItem:tipLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
[window addConstraint:centerXConstraint];
[tipLabel addConstraint:widthConstraint];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.3 animations:^{
Expand Down
16 changes: 16 additions & 0 deletions FUGreenScreenComponent/FUGreenScreenComponent.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Pod::Spec.new do |s|
s.name = "FUGreenScreenComponent"
s.version = "1.0"
s.license = 'MIT'
s.summary = "Green screen component"
s.description = "The green screen component of FULiveDemo."
s.homepage = "https://github.com/Faceunity/FULiveDemo"
s.author = { 'faceunity' => 'dev@faceunity.com' }
s.platform = :ios, "9.0"
s.source = { "http": "https://github.com/Faceunity/FULiveDemo"}
s.source_files = '**/*.{h,m}'
s.resources = 'FUGreenScreenComponent/Resource/**/*.{json}'
s.requires_arc = true
s.dependency 'FURenderKit'
s.dependency 'FUCommonUIComponent'
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
E3381CB528DC1698005C2E57 /* FURenderKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3381CB428DC1698005C2E57 /* FURenderKit.framework */; };
E3A58CCA28A3CCA100941101 /* FUGreenScreenComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = E3A58CC928A3CCA100941101 /* FUGreenScreenComponent.h */; settings = {ATTRIBUTES = (Public, ); }; };
E3A58CDB28A3CE0A00941101 /* FUGreenScreenKeyingViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E3A58CD528A3CE0900941101 /* FUGreenScreenKeyingViewModel.m */; };
E3A58CDC28A3CE0A00941101 /* FUGreenScreenSafeAreaViewModel.h in Headers */ = {isa = PBXBuildFile; fileRef = E3A58CD628A3CE0900941101 /* FUGreenScreenSafeAreaViewModel.h */; };
Expand Down Expand Up @@ -35,7 +34,6 @@
E3A58D8D28A4B4F000941101 /* green_screen_background.json in Resources */ = {isa = PBXBuildFile; fileRef = E3A58D8328A4B4F000941101 /* green_screen_background.json */; };
E3A58D9028A4B5ED00941101 /* FUGreenScreenComponentManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E3A58D8E28A4B5ED00941101 /* FUGreenScreenComponentManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
E3A58D9128A4B5ED00941101 /* FUGreenScreenComponentManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E3A58D8F28A4B5ED00941101 /* FUGreenScreenComponentManager.m */; };
E3A58DB628A4F9A100941101 /* FUCommonUIComponent.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3A58D6828A4B07D00941101 /* FUCommonUIComponent.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -76,8 +74,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E3381CB528DC1698005C2E57 /* FURenderKit.framework in Frameworks */,
E3A58DB628A4F9A100941101 /* FUCommonUIComponent.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ - (UILabel *)textLabel {
_textLabel.textColor = [UIColor whiteColor];
_textLabel.font = [UIFont systemFontOfSize:10];
_textLabel.textAlignment = NSTextAlignmentCenter;
_textLabel.adjustsFontSizeToFitWidth = YES;
}
return _textLabel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ - (instancetype)initWithFrame:(CGRect)frame {

[self.contentView addSubview:self.textLabel];
NSLayoutConstraint *textTop = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.imageView attribute:NSLayoutAttributeBottom multiplier:1 constant:7];

NSLayoutConstraint *textCenterX = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
[self.contentView addConstraints:@[textTop, textCenterX]];
NSLayoutConstraint *textLeading = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeading multiplier:1 constant:0];
NSLayoutConstraint *textTrailing = [NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTrailing multiplier:1 constant:0];
[self.contentView addConstraints:@[textTop, textLeading, textTrailing]];
}
return self;
}
Expand Down Expand Up @@ -358,6 +358,8 @@ - (UILabel *)textLabel {
_textLabel = [[UILabel alloc] init];
_textLabel.font = [UIFont systemFontOfSize:10];
_textLabel.textColor = [UIColor whiteColor];
_textLabel.textAlignment = NSTextAlignmentCenter;
_textLabel.adjustsFontSizeToFitWidth = YES;
_textLabel.translatesAutoresizingMaskIntoConstraints = NO;
}
return _textLabel;
Expand Down
Loading

0 comments on commit da43397

Please sign in to comment.