Skip to content

Commit

Permalink
#123 Refresh Button Hide Setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek9634 committed Dec 4, 2015
1 parent b876618 commit 6eb91ce
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
// Copyright © 2015 applozic Inc. All rights reserved.
//

#define USER_PROILE_PROPERTY @"USER_PROILE_PROPERTY"
#define USER_PROFILE_PROPERTY @"USER_PROFILE_PROPERTY"
#define SEND_MSG_COLOUR @"SEND_MSG_COLOUR"
#define RECEIVE_MSG_COLOUR @"RECEIVE_MSG_COLOUR"
#define NAVIGATION_BAR_COLOUR @"NAVIGATION_BAR_COLOUR"
#define NAVIGATION_BAR_ITEM_COLOUR @"NAVIGATION_BAR_ITEM_COLOUR"
#define REFRESH_BUTTON_VISIBILITY @"REFRESH_BUTTON_VISIBILITY"

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
Expand Down Expand Up @@ -39,4 +40,8 @@

+(void) clearAllSettings;

+(void)hideRefreshButton:(BOOL)state;

+(BOOL)isRefreshButtonHidden;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ @implementation ALApplozicSettings

+(void)setUserProfileHidden: (BOOL)flag
{
[[NSUserDefaults standardUserDefaults] setBool:flag forKey:USER_PROILE_PROPERTY];
[[NSUserDefaults standardUserDefaults] setBool:flag forKey:USER_PROFILE_PROPERTY];
[[NSUserDefaults standardUserDefaults] synchronize];
}

+(BOOL)isUserProfileHidden
{
return [[NSUserDefaults standardUserDefaults] boolForKey:USER_PROILE_PROPERTY];
return [[NSUserDefaults standardUserDefaults] boolForKey:USER_PROFILE_PROPERTY];
}

+(void) clearAllSettings
Expand Down Expand Up @@ -90,4 +90,15 @@ +(UIColor *)getColourForNavigationItem
return barItemColour;
}

+(void)hideRefreshButton:(BOOL)state
{
[[NSUserDefaults standardUserDefaults] setBool:state forKey:REFRESH_BUTTON_VISIBILITY];
[[NSUserDefaults standardUserDefaults] synchronize];
}

+(BOOL)isRefreshButtonHidden
{
return [[NSUserDefaults standardUserDefaults] boolForKey:REFRESH_BUTTON_VISIBILITY];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ -(void)setUpTheming {
// iOS 7.0 or later
self.navColor = [self.navigationController.navigationBar barTintColor];
}
// UIBarButtonItem * theAttachmentButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_action_attachment2.png"] style:UIBarButtonItemStylePlain target:self action:@selector(attachmentAction)];

if(![ALApplozicSettings isRefreshButtonHidden]){
// UIBarButtonItem * theAttachmentButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_action_attachment2.png"] style:UIBarButtonItemStylePlain target:self action:@selector(attachmentAction)];
// self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:theAttachmentButton,refreshButton ,nil];
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:refreshButton ,nil];

}
self.label = [[UILabel alloc] initWithFrame: CGRectMake(80,26,223,21)];
self.label.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.label.backgroundColor = [UIColor clearColor];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ - (IBAction)login:(id)sender {
[ALUserDefaultsHandler setLogoutButtonHidden:NO];
[ALUserDefaultsHandler setBottomTabBarHidden:NO];
[ALApplozicSettings setUserProfileHidden:NO];

[ALApplozicSettings hideRefreshButton:NO];
// Custom Color RGB Format

// [ALApplozicSettings setColourForReceiveMessages:[UIColor colorWithRed:0.447f green:0.737f blue:0.831f alpha:1]];
Expand Down

0 comments on commit 6eb91ce

Please sign in to comment.