Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pastorin committed Apr 9, 2015
1 parent 4b2aab3 commit 43f868c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
16 changes: 6 additions & 10 deletions XLPagerTabStrip/Demo/Helpers/ReloadExampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,15 @@ - (IBAction)reloadTapped:(id)sender {

-(void)updateTitle:(XLPagerTabStripViewController *)pagerController
{
NSString * title = @"isProgressiveIndicator = NO";
if (pagerController.isProgressiveIndicator){
if (pagerController.isElasticIndicatorLimit){
title = @"isProgressiveIndicator = YES, isElasticIndicatorLimit = YES";
}
else{
title = @"isProgressiveIndicator = YES, isElasticIndicatorLimit = NO";
}
}

NSString * title = [NSString stringWithFormat:@"Progressive = %@ ElasticLimit = %@",[self stringFromBool:pagerController.isProgressiveIndicator] ,[self stringFromBool:pagerController.isElasticIndicatorLimit]];
self.titleLabel.text = title;
((UILabel *)self.navigationItem.titleView).text = title;
[((UILabel *)self.navigationItem.titleView) sizeToFit];
}

-(NSString *)stringFromBool:(BOOL)value
{
return value ? @"YES" : @"NO";
}

@end
5 changes: 3 additions & 2 deletions XLPagerTabStrip/Demo/Storyboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Storyboard Demo" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="cZN-qT-VUq">
<rect key="frame" x="207" y="52" width="187" height="28"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="23"/>
<rect key="frame" x="230" y="52" width="140" height="21"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
Expand Down Expand Up @@ -273,6 +273,7 @@
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.027450980390000001" green="0.72549019609999998" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/>
<textAttributes key="titleTextAttributes">
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</textAttributes>
</navigationBar>
Expand Down
1 change: 0 additions & 1 deletion XLPagerTabStrip/Demo/TwitterExampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ -(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripV

- (IBAction)reloadTapped:(id)sender {
_isReload = YES;
self.isElasticIndicatorLimit = (rand() % 2 == 0);
[self reloadPagerTabStripView];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ -(void)reloadPagerTabStripView
}
}

-(void)setIsProgressiveIndicator:(BOOL)isProgressiveIndicator
{
[super setIsProgressiveIndicator:YES];
}


#pragma mark - Properties

Expand Down Expand Up @@ -108,9 +113,11 @@ -(FXPageControl *)navigationPageControl

#pragma mark - XLPagerTabStripViewControllerDataSource

-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController updateIndicatorFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex
-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController
updateIndicatorFromIndex:(NSInteger)fromIndex
toIndex:(NSInteger)toIndex
{

// not accept no progressive indicator
}

-(void)pagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController
Expand Down Expand Up @@ -177,13 +184,13 @@ -(void)setNavigationViewItemsPosition
[self.navigationItemsViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
int index = (int)idx;
UIView *view = (UIView *)obj;
[view setAlpha: self.currentIndex == idx ? 1 : 0];
CGSize viewSize = [view isKindOfClass:[UILabel class]] ? [self getLabelSize:(UILabel*)view] : view.frame.size;
CGFloat originX = (distance - viewSize.width/2) + index * distance;
view.frame = (CGRect){originX, 8, viewSize.width, viewSize.height};
view.tag = index;
}];


UIAccelerationValue xOffset = distance * self.currentIndex;
[self.navigationScrollView setContentOffset:CGPointMake(xOffset, 0)];

Expand All @@ -195,9 +202,6 @@ -(void)setNavigationViewItemsPosition
[self.navigationPageControl setFrame:(CGRect){originX, 34, viewSize.width, viewSize.height}];
}




-(void)setAlphaWithOffset:(UIAccelerationValue)xOffset
{
CGFloat distance = [self getDistanceValue];
Expand Down

0 comments on commit 43f868c

Please sign in to comment.