Skip to content

Commit

Permalink
Adding Selection Font Color and Icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrux committed Apr 26, 2014
1 parent ad9194c commit a3aa7ac
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 30 deletions.
30 changes: 16 additions & 14 deletions AMSlideOut/AMSlideOutGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#define kSOViewTitle @"title"
#define kSOController @"controller"
#define kSOViewIcon @"icon"
#define kSOViewTag @"tag"
#define kSOViewBadge @"badge"
#define kSOSection @"section"
#define kSOBeforeBlock @"before"
#define kSOAfterBlock @"after"
#define kSOSectionTitle @"title"
#define kSOSectionClass @"headerClass"
#define kSOSectionHeight @"headerHeight"
#define kSOItemIsAction @"isAction"
#define kSOItemClass @"itemClass"
#define kSOItemNibName @"itemNibName"
#define kSOViewTitle @"title"
#define kSOController @"controller"
#define kSOViewIcon @"icon"
#define kSOViewSelectionIcon @"selectionIcon"
#define kSOViewTag @"tag"
#define kSOViewBadge @"badge"
#define kSOSection @"section"
#define kSOBeforeBlock @"before"
#define kSOAfterBlock @"after"
#define kSOSectionTitle @"title"
#define kSOSectionClass @"headerClass"
#define kSOSectionHeight @"headerHeight"
#define kSOItemIsAction @"isAction"
#define kSOItemClass @"itemClass"
#define kSOItemNibName @"itemNibName"

// This is to support prior versions where there was a typo in this option definition:
#define AMOptionsTableOffestY AMOptionsTableOffsetY
Expand Down Expand Up @@ -75,6 +76,7 @@ FOUNDATION_EXPORT NSString *const AMOptionsHeaderSeparatorLower;

FOUNDATION_EXPORT NSString *const AMOptionsCellFont;
FOUNDATION_EXPORT NSString *const AMOptionsCellFontColor;
FOUNDATION_EXPORT NSString *const AMOptionsCellSelectionFontColor;
FOUNDATION_EXPORT NSString *const AMOptionsCellBadgeFont;
FOUNDATION_EXPORT NSString *const AMOptionsCellBackground;
FOUNDATION_EXPORT NSString *const AMOptionsCellSeparatorUpper;
Expand Down
3 changes: 3 additions & 0 deletions AMSlideOut/AMSlideOutGlobals.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
NSString *const AMOptionsHeaderSeparatorLower = @"AMOptionsHeaderSeparatorLower";
NSString *const AMOptionsCellFont = @"AMOptionsCellFont";
NSString *const AMOptionsCellFontColor = @"AMOptionsCellFontColor";
NSString *const AMOptionsCellSelectionFontColor = @"AMOptionsCellSelectionFontColor";
NSString *const AMOptionsCellBadgeFont = @"AMOptionsCellBadgeFont";
NSString *const AMOptionsCellBackground = @"AMOptionsCellBackground";
NSString *const AMOptionsCellSeparatorUpper = @"AMOptionsCellSeparatorUpper";
Expand Down Expand Up @@ -109,6 +110,7 @@ + (NSDictionary*)defaultOptions
AMOptionsCellFont : [UIFont fontWithName:@"Helvetica" size:14],
AMOptionsCellBadgeFont : [UIFont fontWithName:@"Helvetica" size:12],
AMOptionsCellFontColor : [UIColor colorWithRed:0.77 green:0.8 blue:0.85 alpha:1.0],
AMOptionsCellSelectionFontColor : [UIColor colorWithRed:0.77 green:0.8 blue:0.85 alpha:1.0],
AMOptionsCellBackground : [UIColor colorWithRed:0.19 green:0.22 blue:0.29 alpha:1.0],
AMOptionsCellSeparatorUpper : [UIColor colorWithRed:0.24 green:0.27 blue:0.33 alpha:1.0],
AMOptionsCellSeparatorLower : [UIColor colorWithRed:0.14 green:0.16 blue:0.21 alpha:1.0],
Expand Down Expand Up @@ -182,6 +184,7 @@ + (NSDictionary*)defaultFlatOptions
AMOptionsCellBadgeFontColor : [UIColor whiteColor],
AMOptionsCellBadgeBackColor : [UIColor blackColor],
AMOptionsCellFontColor : [UIColor blackColor],
AMOptionsCellSelectionFontColor : [UIColor blackColor],
AMOptionsCellBackground : [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1.0],
AMOptionsCellSeparatorUpper : [UIColor clearColor],
AMOptionsCellSeparatorLower : [UIColor colorWithRed:0.7 green:0.7 blue:0.7 alpha:1.0],
Expand Down
9 changes: 9 additions & 0 deletions AMSlideOut/AMSlideOutNavigationController.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,26 @@ typedef void (^AMSlideOutCompletionHandler)(void);
- (void)setContentViewController:(UIViewController *)controller;

- (void)addViewControllerToLastSection:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon;
- (void)addViewControllerToLastSection:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon;
- (void)addViewControllerToLastSection:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon beforeChange:(void(^)())before onCompletition:(void(^)())after;
- (void)addViewControllerToLastSection:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon beforeChange:(void(^)())before onCompletition:(void(^)())after;
- (void)addActionToLastSection:(void(^)())action tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon;
- (void)addViewControllerClassToLastSection:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon;
- (void)addViewControllerClassToLastSection:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon;
- (void)addViewControllerClassToLastSection:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon beforeChange:(void(^)())before onCompletition:(void(^)())after;
- (void)addViewControllerClassToLastSection:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon beforeChange:(void(^)())before onCompletition:(void(^)())after;

- (void)addViewController:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon toSection:(NSInteger)section;
- (void)addViewController:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon toSection:(NSInteger)section;
- (void)addViewController:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon toSection:(NSInteger)section beforeChange:(void(^)())before onCompletition:(void(^)())after;
- (void)addViewController:(UIViewController*)controller tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon toSection:(NSInteger)section beforeChange:(void(^)())before onCompletition:(void(^)())after;
- (void)addAction:(void(^)())action tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon toSection:(NSInteger)section;
- (void)addAction:(void(^)())action tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon toSection:(NSInteger)section;
// Controller will created only when it will picked from menu, and destroyed when user pick another controller
- (void)addViewControllerClass:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon toSection:(NSInteger)section;
- (void)addViewControllerClass:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon toSection:(NSInteger)section;
- (void)addViewControllerClass:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon toSection:(NSInteger)section beforeChange:(void(^)())before onCompletition:(void(^)())after;
- (void)addViewControllerClass:(Class)cls withNibName:(NSString*)nibName tagged:(int)tag withTitle:(NSString*)title andIcon:(id)icon andSelectionIcon:(id)selectionIcon toSection:(NSInteger)section beforeChange:(void(^)())before onCompletition:(void(^)())after;

- (void)switchToControllerTagged:(int)tag andPerformSelector:(SEL)selector withObject:(id)obj;
- (void)switchToControllerTagged:(int)tag andPerformSelector:(SEL)selector withObject:(id)obj afterDelay:(NSTimeInterval)delay;
Expand Down
Loading

0 comments on commit a3aa7ac

Please sign in to comment.