Skip to content

Commit

Permalink
Merge branch 'master' of github.com:cruffenach/CRToast
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashton-W committed Apr 15, 2015
2 parents 11bc1d3 + d71eb21 commit d538b25
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
24 changes: 12 additions & 12 deletions CRToast/CRToastLayoutHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,25 @@ static UIInterfaceOrientation CRGetDeviceOrientation() {
/// Get the height of the status bar for given orientation.
static CGFloat CRGetStatusBarHeightForOrientation(UIInterfaceOrientation orientation) {
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];

if (CRFrameAutoAdjustedForOrientation()) {
return CGRectGetHeight(statusBarFrame);
}
return (UIDeviceOrientationIsLandscape(orientation)) ?

return (UIInterfaceOrientationIsLandscape(orientation)) ?
CGRectGetWidth(statusBarFrame) :
CGRectGetHeight(statusBarFrame);
}

/// Get the width of the status bar for given orientation.
static CGFloat CRGetStatusBarWidthForOrientation(UIInterfaceOrientation orientation) {
CGRect mainScreenBounds = [UIScreen mainScreen].bounds;

if (CRFrameAutoAdjustedForOrientation()) {
return CGRectGetWidth(mainScreenBounds);
}
return (UIDeviceOrientationIsPortrait(orientation)) ?

return (UIInterfaceOrientationIsPortrait(orientation)) ?
CGRectGetWidth(mainScreenBounds) :
CGRectGetHeight(mainScreenBounds);
}
Expand All @@ -88,15 +88,15 @@ static CGFloat CRGetStatusBarWidth() {
#pragma mark - Navigation Bar Frame
/**
Get the height of the status bar for given orientation.
\note if size classes can be used this method will account for compact vs regular size class
*/
static CGFloat CRGetNavigationBarHeightForOrientation(UIInterfaceOrientation orientation) {
BOOL regularHorizontalSizeClass = NO;
if (CRUseSizeClass()) {
regularHorizontalSizeClass = CRHorizontalSizeClassRegular();
}
return (UIDeviceOrientationIsPortrait(orientation) ||
return (UIInterfaceOrientationIsPortrait(orientation) ||
UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad || regularHorizontalSizeClass) ?
CRNavigationBarDefaultHeight :
CRNavigationBarDefaultHeightiPhoneLandscape;
Expand All @@ -119,7 +119,7 @@ static CGFloat CRGetNotificationViewHeightForOrientation(CRToastType type, CGFlo

/**
Get the height of the view needed for specified notification type & preferred height.
\note uses the devices current orientation for calculation
*/
static CGFloat CRGetNotificationViewHeight(CRToastType type, CGFloat preferredNotificationHeight) {
Expand All @@ -128,7 +128,7 @@ static CGFloat CRGetNotificationViewHeight(CRToastType type, CGFloat preferredNo

#pragma mark - -- clang diagnostic warning supression --
// Lumped all functions that warn as unused
// together so they can be ignored together
// together so they can be ignored together
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"

Expand Down Expand Up @@ -179,7 +179,7 @@ static CGRect CRStatusBarViewFrame(CRToastType type, CRToastAnimationDirection d
/// Get the notifications container frame based on orientation & notification size
static CGRect CRGetNotificationContainerFrame(UIInterfaceOrientation statusBarOrientation, CGSize notificationSize) {
CGRect containerFrame = CGRectMake(0, 0, notificationSize.width, notificationSize.height);

if (!CRFrameAutoAdjustedForOrientation()) {
switch (statusBarOrientation) {
case UIInterfaceOrientationLandscapeLeft: {
Expand All @@ -198,7 +198,7 @@ static CGRect CRGetNotificationContainerFrame(UIInterfaceOrientation statusBarOr
break;
}
}

}
return containerFrame;
}
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ Title and Subtitle text with:
### Touch Interactions
`CRToast` allows for any notification to respond to different types of touch interactions (tap, swipe). Interaction responders can be set as defaults or on a per notification basis.
`CRToast` allows for any notification to respond to different types of touch interactions (tap, swipe). Interaction responders can be set as defaults or on a per notification basis.
The types of interactions you can set up to respond to are:
```Obj-C
CRToastInteractionTypeSwipeUp
CRToastInteractionTypeSwipeLeft
CRToastInteractionTypeSwipeDown
CRToastInteractionTypeSwipeRight
CRToastInteractionTypeTapOnce
CRToastInteractionTypeTapTwice
CRToastInteractionTypeTwoFingerTapOnce
CRToastInteractionTypeTwoFingerTapTwice
CRToastInteractionTypeSwipeUp
CRToastInteractionTypeSwipeLeft
CRToastInteractionTypeSwipeDown
CRToastInteractionTypeSwipeRight
CRToastInteractionTypeTapOnce
CRToastInteractionTypeTapTwice
CRToastInteractionTypeTwoFingerTapOnce
CRToastInteractionTypeTwoFingerTapTwice
```

There are also wild card interaction types which cover a range of interactions
Expand Down

0 comments on commit d538b25

Please sign in to comment.