Browse Source

动画加载方式处理

Steven 8 months ago
parent
commit
cfc41ad8e7

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Common/Base/AccompanyWebView/AccompanyLoadingView.m

@@ -92,7 +92,7 @@
 
 - (LOTAnimationView *)animationView {
     if (!_animationView) {
-        _animationView = [LOTAnimationView animationNamed:self.jsonString];
+        _animationView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:self.jsonString ofType:@"json"]];
         _animationView.contentMode = UIViewContentModeScaleAspectFill;
         _animationView.animationSpeed = 1.0;
         _animationView.loopAnimation = YES;

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.m

@@ -67,7 +67,7 @@
 
 - (LOTAnimationView *)animationView {
     if (!_animationView) {
-        _animationView = [LOTAnimationView animationNamed:@"student_refresh"];
+        _animationView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:@"student_refresh" ofType:@"json"]];
         _animationView.contentMode = UIViewContentModeScaleAspectFill;
         _animationView.animationSpeed = 1.0;
         _animationView.loopAnimation = YES;

+ 9 - 14
KulexiuForStudent/KulexiuForStudent/Common/MediaMerge/AudioMerge/KSMergeAudioControlView.m

@@ -32,10 +32,6 @@
 
 @property (weak, nonatomic) IBOutlet UILabel *offsetTipsLabel;
 
-@property (nonatomic, strong) UITapGestureRecognizer *recordProgressTap;
-
-@property (nonatomic,strong) UITapGestureRecognizer *bgProgressTap;
-
 @property (weak, nonatomic) IBOutlet UIView *recordBubble;
 @property (weak, nonatomic) IBOutlet UILabel *recordBubbleLabel;
 @property (weak, nonatomic) IBOutlet UIView *recordGestureView;
@@ -125,11 +121,13 @@
 #pragma mark ----- 音量控制
 
 - (void)configRecordVolumeValue:(NSInteger)volume {
+    NSLog(@"---- record volume ---- %zd", volume);
     self.recordVolume = volume;
-    
     self.recordBubbleLabel.text = [NSString stringWithFormat:@"%zd",volume];
     self.recordCenterX.constant = [self getBubbleCenterX:self.recordSlider];
-
+    if (self.callback) {
+        self.callback(MERGEACTION_MODIFY, self.recordVolume, self.bgVolume, self.offsetTime);
+    }
     [UIView animateWithDuration:0.1f animations:^{
         [self layoutIfNeeded];
     } completion:^(BOOL finished) {
@@ -140,9 +138,13 @@
 }
 
 - (void)configBgVolumeValue:(NSInteger)volume {
+    NSLog(@"---- bg volume ---- %zd", volume);
     self.bgVolume = volume;
     self.bgVolumeBubble.text = [NSString stringWithFormat:@"%zd",volume];
     self.bgCenterX.constant = [self getBubbleCenterX:self.bgSlider];
+    if (self.callback) {
+        self.callback(MERGEACTION_MODIFY, self.recordVolume, self.bgVolume, self.offsetTime);
+    }
     [UIView animateWithDuration:0.1f animations:^{
         [self layoutIfNeeded];
     } completion:^(BOOL finished) {
@@ -293,12 +295,8 @@
 }
 
 - (void)refreshRecordValue:(NSInteger)value {
-    NSLog(@"---- record volume ---- %zd", value);
     [self.recordSlider setValue:value animated:NO];
     [self configRecordVolumeValue:value];
-    if (self.callback) {
-        self.callback(MERGEACTION_MODIFY, self.recordVolume, self.bgVolume, self.offsetTime);
-    }
     @weakObj(self);
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(500 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
         @strongObj(self);
@@ -307,12 +305,8 @@
 }
 
 - (void)refreshBgValue:(NSInteger)value {
-    NSLog(@"---- bg volume ---- %zd", value);
     [self.bgSlider setValue:value animated:NO];
     [self configBgVolumeValue:value];
-    if (self.callback) {
-        self.callback(MERGEACTION_MODIFY, self.recordVolume, self.bgVolume, self.offsetTime);
-    }
     @weakObj(self);
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(500 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
         @strongObj(self);
@@ -320,6 +314,7 @@
     });
 }
 
+
 - (IBAction)leftAction:(id)sender {
     if (self.offsetTime <= -MAX_OFFSET) {
         self.offsetTime = -MAX_OFFSET;

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Common/Tools/GifRefresh/KSGifRefreshFooter.m

@@ -20,7 +20,7 @@
 
 - (instancetype)init {
     if (self = [super init]) {
-        [self setJsonName:@"student_refresh.json"];
+        [self setJsonName:@"student_refresh"];
     }
     return self;
 }
@@ -33,7 +33,7 @@
 - (LOTAnimationView *)loadingView {
     if(_loadingView == nil) {
         //1.加载本地json
-        _loadingView = [LOTAnimationView animationNamed:self.jsonString];
+        _loadingView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:self.jsonString ofType:@"json"]];
         //2.加载后台给的json(url)
         _loadingView.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width / 2.0) - 45, 0, 90, 50);
         _loadingView.loopAnimation = YES;

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Common/Tools/GifRefresh/KSGifRefreshHeader.m

@@ -22,7 +22,7 @@
     if (self = [super init]) {
         self.lastUpdatedTimeLabel.hidden = YES;
         self.stateLabel.hidden = YES;
-        [self setJsonName:@"student_refresh.json"];
+        [self setJsonName:@"student_refresh"];
     }
     return self;
 }
@@ -35,7 +35,7 @@
 - (LOTAnimationView *)loadingView {
     if(_loadingView == nil) {
         //1.加载本地json
-        _loadingView = [LOTAnimationView animationNamed:self.jsonString];
+        _loadingView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:self.jsonString ofType:@"json"]];
         //2.加载后台给的json(url)
         _loadingView.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width / 2.0) - 45, 0, 90, 50);
         _loadingView.loopAnimation = YES;

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Common/Tools/GifRefresh/KSNewGifRefreshFooter.m

@@ -18,7 +18,7 @@
 @implementation KSNewGifRefreshFooter
 - (instancetype)init {
     if (self = [super init]) {
-        [self setJsonName:@"refresh_bottom.json"];
+        [self setJsonName:@"refresh_bottom"];
         self.stateLabel.textColor = HexRGB(0x777777);
 //        self.stateLabel.font = [UIFont systemFontOfSize:12.0f];
     }
@@ -53,7 +53,7 @@
 - (LOTAnimationView *)loadingView {
     if(_loadingView == nil) {
         //1.加载本地json
-        _loadingView = [LOTAnimationView animationNamed:self.jsonString];
+        _loadingView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:self.jsonString ofType:@"json"]];
         //2.加载后台给的json(url)
         _loadingView.loopAnimation = YES;
         _loadingView.contentMode = UIViewContentModeScaleAspectFill;

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/View/TenantDarkEmptyView.m

@@ -47,7 +47,7 @@
 
 - (LOTAnimationView *)animationView {
     if (!_animationView) {
-        _animationView = [LOTAnimationView animationNamed:@"darkEmptyAnimation.json"];
+        _animationView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:@"darkEmptyAnimation" ofType:@"json"]];
         _animationView.loopAnimation = YES;
     }
     return _animationView;

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Module/AnimationLaunch/Controller/LaunchAnimationViewController.m

@@ -34,7 +34,7 @@
 - (void)configUI {
     self.view.backgroundColor = [UIColor whiteColor];
     
-    [self setJsonName:@"launchAni.json"];
+    [self setJsonName:@"launchAni"];
 }
 
 - (void)setJsonName:(NSString *)jsonName {
@@ -67,7 +67,7 @@
 - (LOTAnimationView *)loadingView {
     if(_loadingView == nil) {
         //1.加载本地json
-        _loadingView = [LOTAnimationView animationNamed:self.jsonString];
+        _loadingView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:self.jsonString ofType:@"json"]];
         //2.加载后台给的json(url)
         _loadingView.loopAnimation = YES;
         _loadingView.contentMode = UIViewContentModeScaleAspectFill;

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotTalent/HomeHotTalentCell.m

@@ -128,7 +128,7 @@
 
 - (LOTAnimationView *)animationView {
     if (!_animationView) {
-        _animationView = [LOTAnimationView animationNamed:@"talentAnimation.json"];
+        _animationView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:@"talentAnimation" ofType:@"json"]];
         _animationView.loopAnimation = YES;
     }
     return _animationView;

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/RecentCourse/HomeRecentCourseView.m

@@ -72,7 +72,7 @@
     if ([self.imageBgView.subviews containsObject:self.animationView]) {
         [self.animationView removeFromSuperview];
     }
-    self.animationView = [LOTAnimationView animationNamed:jsonString];
+    self.animationView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:jsonString ofType:@"json"]];
     //2.加载后台给的json(url)
     self.animationView.frame = CGRectMake(0, 0, 128, 91);
     self.animationView.loopAnimation = YES;

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/TeacherStyle/HomeTempLiveCell.m

@@ -58,7 +58,7 @@
 
 - (LOTAnimationView *)animationView {
     if (!_animationView) {
-        _animationView = [LOTAnimationView animationNamed:@"styleAnimation.json"];
+        _animationView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:@"styleAnimation" ofType:@"json"]];
         _animationView.loopAnimation = YES;
     }
     return _animationView;

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/TXLive/View/TXLiveLoadingView.m

@@ -58,7 +58,7 @@
 
 - (LOTAnimationView *)animationView {
     if (!_animationView) {
-        _animationView = [LOTAnimationView animationNamed:@"custom_loading"];
+        _animationView = [LOTAnimationView animationWithFilePath:[[NSBundle mainBundle] pathForResource:@"custom_loading" ofType:@"json"]];
         _animationView.contentMode = UIViewContentModeScaleAspectFill;
         _animationView.animationSpeed = 1.0;
         _animationView.loopAnimation = YES;