Skip to content

Commit

Permalink
deleted old XLSlider file and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mats-claassen committed Mar 30, 2015
1 parent b206aeb commit c3fb111
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 89 deletions.
4 changes: 2 additions & 2 deletions Example/Examples/HideUpper/Exampledragview.xib
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="374" height="67"/>
<rect key="frame" x="0.0" y="0.0" width="374" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="grey_bar" translatesAutoresizingMaskIntoConstraints="NO" id="53r-fg-Gf5">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" image="grey_bar" translatesAutoresizingMaskIntoConstraints="NO" id="53r-fg-Gf5">
<rect key="frame" x="47" y="29" width="280" height="10"/>
<constraints>
<constraint firstAttribute="height" constant="9" id="06g-6b-YbD"/>
Expand Down
75 changes: 0 additions & 75 deletions XLSlidingContainer/XLSliderViewController.h

This file was deleted.

24 changes: 12 additions & 12 deletions XLSlidingContainer/XLSlidingContainerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ -(void)drawViews{

CGRect middle = CGRectMake(0, (self.navView.bounds.size.height - [self.delegate getLowerViewMinFor:self] - [self dragViewHeight]), self.navView.bounds.size.width, [self dragViewHeight]);
self.dragView.frame = middle;
CGRect upper = CGRectMake(0, 0, self.navView.bounds.size.width, (self.navView.bounds.size.height - [self.delegate getLowerViewMinFor:self] - [self dragViewHeight] ));
CGRect upper = CGRectMake(0, 0, self.navView.bounds.size.width, (self.navView.bounds.size.height - [self.delegate getLowerViewMinFor:self] - [self dragViewHeight]));
self.upperView.frame = upper;
CGRect lower = CGRectMake(0, (self.navView.bounds.size.height - [self.delegate getLowerViewMinFor:self]), self.navView.bounds.size.width, [self.delegate getLowerViewMinFor:self]);
self.lowerView.frame = lower;
Expand Down Expand Up @@ -214,10 +214,10 @@ -(void)updateViews:(CGPoint) translation forState:(UIGestureRecognizerState) sta
}
else{

f0.origin.y += translation.y;

f1.size.height += translation.y;

f0.origin.y += translation.y;

f2.size.height -= translation.y;
f2.origin.y += translation.y;

Expand All @@ -240,17 +240,17 @@ -(void)updateViews:(CGPoint) translation forState:(UIGestureRecognizerState) sta

f0.origin.y = f1.origin.y + f1.size.height;

f2.size.height = self.navView.bounds.size.height - f0.size.height - [self.delegate getUpperViewMinFor:self];
f2.origin.y = f0.origin.y + f0.size.height;
f2.size.height = self.navView.bounds.size.height - f0.size.height - [self.delegate getUpperViewMinFor:self];
}

}
else{

f0.origin.y += translation.y;

f1.origin.y += translation.y;

f0.origin.y += translation.y;

f2.size.height -= translation.y;
f2.origin.y += translation.y;

Expand All @@ -270,8 +270,8 @@ - (void)panDragView:(UIPanGestureRecognizer *)gr {
CGRect frame = self.dragView.frame;

if (gr.state == UIGestureRecognizerStateBegan){
frame.origin.y = MAX(frame.origin.y - [self.delegate getLowerExtraDraggableArea:self], 0);
frame.size.height = frame.size.height + 2*[self.delegate getupperExtraDraggableArea:self];
frame.origin.y = MAX(frame.origin.y - [self.delegate getupperExtraDraggableArea:self], 0);
frame.size.height = frame.size.height + [self.delegate getLowerExtraDraggableArea:self] + [self.delegate getupperExtraDraggableArea:self];
}

if ( gr.state == UIGestureRecognizerStateChanged )
Expand Down Expand Up @@ -315,7 +315,7 @@ - (void)panDragView:(UIPanGestureRecognizer *)gr {
CGFloat lowerContDiff = (CGRectGetHeight(self.navView.frame) - [self.delegate getLowerViewMinFor:self] - actualPos);
CGFloat upperContDiff = (actualPos - [self.delegate getUpperViewMinFor:self] - [self dragViewHeight]);
if ((self.panDirection > 0) || ((self.panDirection == 0) && (self.dragView.frame.origin.y > 0.5*CGRectGetHeight(self.navView.frame)))){
[UIView animateWithDuration:(0.9 - (realVelocity/2)) delay:0.0 usingSpringWithDamping:0.8 - (realVelocity/2) initialSpringVelocity:realVelocity options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^{
[UIView animateWithDuration:(0.9 - (realVelocity/2)) delay:0.0 usingSpringWithDamping:0.9 - (realVelocity/2) initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^{

[weakself updateViews:dy forState:gr.state];
if ([weakself.lowerController respondsToSelector:@selector(minimizedController:)])
Expand All @@ -327,7 +327,7 @@ - (void)panDragView:(UIPanGestureRecognizer *)gr {

}
else{
[UIView animateWithDuration:(0.9 - (realVelocity/2)) delay:0.0 usingSpringWithDamping:0.8 - (realVelocity/2) initialSpringVelocity:realVelocity options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^{
[UIView animateWithDuration:(0.9 - (realVelocity/2)) delay:0.0 usingSpringWithDamping:0.9 - (realVelocity/2) initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^{

[weakself updateViews:dy forState:gr.state];
if ([weakself.upperController respondsToSelector:@selector(minimizedController:)])
Expand Down Expand Up @@ -417,12 +417,12 @@ - (UIViewController *) getUpperControllerFor:(XLSlidingContainerViewController *

- (CGFloat) getUpperViewMinFor:(XLSlidingContainerViewController *)sliderViewController
{
return (CGRectGetHeight(self.navView.frame) / 5);
return ceil(CGRectGetHeight(self.navView.frame) / 5);
}

- (CGFloat) getLowerViewMinFor:(XLSlidingContainerViewController *)sliderViewController
{
return ((CGRectGetHeight(self.navView.frame) - [self dragViewHeight]) / 4);
return ceil((CGRectGetHeight(self.navView.frame) - [self dragViewHeight]) / 4);
}

- (CGFloat) getLowerExtraDraggableArea:(XLSlidingContainerViewController *)sliderViewController
Expand Down

0 comments on commit c3fb111

Please sign in to comment.