Skip to content

Commit

Permalink
【Update】
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsic committed Nov 11, 2018
1 parent ea8efd8 commit f34982e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 40 deletions.
76 changes: 38 additions & 38 deletions SGPagingView/SGPageTitle/SGPageTitleView.m
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 404,16 @@ - (void)P_changeIndicatorWithButton:(UIButton *)button {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.indicatorStyle == SGIndicatorStyleFixed) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = self.configure.indicatorFixedWidth;
_indicatorView.SG_centerX = button.SG_centerX;
self.indicatorView.SG_width = self.configure.indicatorFixedWidth;
self.indicatorView.SG_centerX = button.SG_centerX;
}
return;
}

if (self.configure.indicatorStyle == SGIndicatorStyleDynamic) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = self.configure.indicatorDynamicWidth;
_indicatorView.SG_centerX = button.SG_centerX;
self.indicatorView.SG_width = self.configure.indicatorDynamicWidth;
self.indicatorView.SG_centerX = button.SG_centerX;
}
return;
}
Expand All @@ -424,8 424,8 @@ - (void)P_changeIndicatorWithButton:(UIButton *)button {
tempIndicatorWidth = button.SG_width;
}
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
_indicatorView.SG_centerX = button.SG_centerX;
self.indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_centerX = button.SG_centerX;
}
}];
}
Expand Down Expand Up @@ -880,14 880,14 @@ - (void)P_staticIndicatorScrollStyleHalfEndWithProgress:(CGFloat)progress origin
if (progress >= 0.5) {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
} else {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand All @@ -902,15 902,15 @@ - (void)P_staticIndicatorScrollStyleHalfEndWithProgress:(CGFloat)progress origin
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= targetBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = targetBtn.SG_width;
self.indicatorView.SG_width = targetBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
Expand All @@ -920,15 920,15 @@ - (void)P_staticIndicatorScrollStyleHalfEndWithProgress:(CGFloat)progress origin
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= targetBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = originalBtn.SG_width;
self.indicatorView.SG_width = originalBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand All @@ -943,14 943,14 @@ - (void)P_staticIndicatorScrollStyleHalfEndWithProgress:(CGFloat)progress origin
if (progress == 1.0) {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
} else {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand All @@ -965,15 965,15 @@ - (void)P_staticIndicatorScrollStyleHalfEndWithProgress:(CGFloat)progress origin
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= targetBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = targetBtn.SG_width;
self.indicatorView.SG_width = targetBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
Expand All @@ -983,15 983,15 @@ - (void)P_staticIndicatorScrollStyleHalfEndWithProgress:(CGFloat)progress origin
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= targetBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = originalBtn.SG_width;
self.indicatorView.SG_width = originalBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand All @@ -1007,14 1007,14 @@ - (void)P_indicatorScrollStyleHalfEndWithProgress:(CGFloat)progress originalBtn:
if (progress >= 0.5) {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
} else {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand All @@ -1029,15 1029,15 @@ - (void)P_indicatorScrollStyleHalfEndWithProgress:(CGFloat)progress originalBtn:
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= targetBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = targetBtn.SG_width;
self.indicatorView.SG_width = targetBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
Expand All @@ -1047,15 1047,15 @@ - (void)P_indicatorScrollStyleHalfEndWithProgress:(CGFloat)progress originalBtn:
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= originalBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = originalBtn.SG_width;
self.indicatorView.SG_width = originalBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand All @@ -1070,14 1070,14 @@ - (void)P_indicatorScrollStyleHalfEndWithProgress:(CGFloat)progress originalBtn:
if (progress == 1.0) {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
} else {
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand All @@ -1092,15 1092,15 @@ - (void)P_indicatorScrollStyleHalfEndWithProgress:(CGFloat)progress originalBtn:
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= targetBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = targetBtn.SG_width;
self.indicatorView.SG_width = targetBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = targetBtn.SG_centerX;
self.indicatorView.SG_centerX = targetBtn.SG_centerX;
}
[self P_changeSelectedButton:targetBtn];
}];
Expand All @@ -1111,15 1111,15 @@ - (void)P_indicatorScrollStyleHalfEndWithProgress:(CGFloat)progress originalBtn:
[UIView animateWithDuration:self.configure.indicatorAnimationTime animations:^{
if (tempIndicatorWidth >= originalBtn.SG_width) {
if (self.configure.showIndicator) {
_indicatorView.SG_width = originalBtn.SG_width;
self.indicatorView.SG_width = originalBtn.SG_width;
}
} else {
if (self.configure.showIndicator) {
_indicatorView.SG_width = tempIndicatorWidth;
self.indicatorView.SG_width = tempIndicatorWidth;
}
}
if (self.configure.showIndicator) {
_indicatorView.SG_centerX = originalBtn.SG_centerX;
self.indicatorView.SG_centerX = originalBtn.SG_centerX;
}
[self P_changeSelectedButton:originalBtn];
}];
Expand Down
6 changes: 5 additions & 1 deletion SGPagingViewExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 495,7 @@
182513381F21CAC30039F4A2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = Sorgle;
TargetAttributes = {
1825133F1F21CAC30039F4A2 = {
Expand Down Expand Up @@ -682,13 682,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -736,13 738,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down
2 changes: 1 addition & 1 deletion SGPagingViewExample/MainVC/DefaultStaticVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 57,7 @@ - (void)setupPageView {
_pageTitleView.selectedIndex = 1;

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[_pageTitleView resetTitle:@"等待已结束" forIndex:1];
[self.pageTitleView resetTitle:@"等待已结束" forIndex:1];
});

ChildVCOne *oneVC = [[ChildVCOne alloc] init];
Expand Down

0 comments on commit f34982e

Please sign in to comment.