|
Nimbus
0.9.3 - Nimbus is proudly hosted on Github
An iOS framework whose growth is bounded by O(documentation).
|
00001 // 00002 // Copyright 2011 Jeff Verkoeyen 00003 // 00004 // Licensed under the Apache License, Version 2.0 (the "License"); 00005 // you may not use this file except in compliance with the License. 00006 // You may obtain a copy of the License at 00007 // 00008 // http://www.apache.org/licenses/LICENSE-2.0 00009 // 00010 // Unless required by applicable law or agreed to in writing, software 00011 // distributed under the License is distributed on an "AS IS" BASIS, 00012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 // See the License for the specific language governing permissions and 00014 // limitations under the License. 00015 // 00016 00017 #import "NICommonMetrics.h" 00018 00019 #import "NISDKAvailability.h" 00020 00021 00023 CGFloat NIToolbarHeightForOrientation(UIInterfaceOrientation orientation) { 00024 return (NIIsPad() 00025 ? 44 00026 : (UIInterfaceOrientationIsPortrait(orientation) 00027 ? 44 00028 : 33)); 00029 } 00030 00031 00033 UIViewAnimationCurve NIStatusBarAnimationCurve(void) { 00034 return UIViewAnimationCurveEaseIn; 00035 } 00036 00037 00039 NSTimeInterval NIStatusBarAnimationDuration(void) { 00040 return 0.3; 00041 } 00042 00043 00045 UIViewAnimationCurve NIStatusBarBoundsChangeAnimationCurve(void) { 00046 return UIViewAnimationCurveEaseInOut; 00047 } 00048 00049 00051 NSTimeInterval NIStatusBarBoundsChangeAnimationDuration(void) { 00052 return 0.35; 00053 } 00054 00055 00057 CGFloat NIStatusBarHeight(void) { 00058 CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame]; 00059 00060 // We take advantage of the fact that the status bar will always be wider than it is tall 00061 // in order to avoid having to check the status bar orientation. 00062 CGFloat statusBarHeight = MIN(statusBarFrame.size.width, statusBarFrame.size.height); 00063 00064 return statusBarHeight; 00065 } 00066 00067 00069 NSTimeInterval NIDeviceRotationDuration(BOOL isFlippingUpsideDown) { 00070 return isFlippingUpsideDown ? 0.8 : 0.4; 00071 } 00072 00073 00075 UIEdgeInsets NICellContentPadding(void) { 00076 return UIEdgeInsetsMake(10, 10, 10, 10); 00077 }