Permalink
Browse files

removed unreliable methods that were using hard-coded constants to ca…

…lculate height of tab-bar, toolbar, nav bar: that logic is easily implementable at the app level using the frames of the actual views.
  • Loading branch information...
ettore committed Jul 14, 2012
1 parent 2a2fa80 commit decbd3d135ea44a01ef83ee95fb384b29223db03
Showing with 3 additions and 42 deletions.
  1. +0 −16 clcg_viewport.h
  2. +3 −26 clcg_viewport.m
View
@@ -47,22 +47,6 @@ extern "C" {
* orientation.
*/
CGFloat clcg_statusbar_h();
-
- /**
- * Returns the height of the standard UINavigationBar considering the
- * current device orientation.
- */
- CGFloat clcg_navbar_h();
-
- /**
- * Returns the height of a standard UIToolbar.
- */
- CGFloat clcg_toolbar_h();
-
- /**
- * Returns the height of a standard UITabbar.
- */
- CGFloat clcg_tabbar_h();
#ifdef __cplusplus
}
View
@@ -26,11 +26,11 @@
#import "clcg_debug.h"
#import "clcg_viewport.h"
#import "clcg_device_utils.h"
-
+#import "UIApplicationCategory.h"
CGFloat clcg_statusbar_h()
{
- UIInterfaceOrientation orient = clcg_orientation();
+ const UIInterfaceOrientation orient = clcg_orientation();
const CGSize sz = [[UIApplication sharedApplication] statusBarFrame].size;
if (UIInterfaceOrientationIsPortrait(orient)) {
return sz.height;
@@ -40,29 +40,6 @@ CGFloat clcg_statusbar_h()
}
-CGFloat clcg_navbar_h()
-{
- UIInterfaceOrientation orient = clcg_orientation();
- if (UIInterfaceOrientationIsPortrait(orient) || clcg_is_ipad()) {
- return 44.0f;
- } else {
- return 33.0f;
- }
-}
-
-
-CGFloat clcg_toolbar_h()
-{
- return 44.0;
-}
-
-
-CGFloat clcg_tabbar_h()
-{
- return 49.0f;
-}
-
-
UIInterfaceOrientation clcg_orientation()
{
return [[UIApplication sharedApplication] statusBarOrientation];
@@ -72,7 +49,7 @@ UIInterfaceOrientation clcg_orientation()
CGSize clcg_screensize()
{
CGRect bounds = [[UIScreen mainScreen] bounds];
- UIInterfaceOrientation orientation = clcg_orientation();
+ const UIInterfaceOrientation orientation = clcg_orientation();
if (UIInterfaceOrientationIsLandscape(orientation)) {
CGFloat w = bounds.size.width;

0 comments on commit decbd3d

Please sign in to comment.