Permalink
Browse files

Start on archive

  • Loading branch information...
1 parent 52605c5 commit ac4aa7fc2263d42a9c69738a03a3fc8d930a9ae4 @soffes soffes committed Jan 19, 2013
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ 21E0A67A16AAE0BA002479F9 /* CDIViewArchiveButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 21E0A67916AAE0BA002479F9 /* CDIViewArchiveButton.m */; };
B208BC2915BF63A80080705D /* CDIAddListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B208BB9315BF63A80080705D /* CDIAddListTableViewCell.m */; };
B208BC2A15BF63A80080705D /* CDIAddTaskAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = B208BB9515BF63A80080705D /* CDIAddTaskAnimationView.m */; };
B208BC2B15BF63A80080705D /* CDIAddTaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = B208BB9715BF63A80080705D /* CDIAddTaskView.m */; };
@@ -278,6 +279,8 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 21E0A67816AAE0BA002479F9 /* CDIViewArchiveButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDIViewArchiveButton.h; sourceTree = "<group>"; };
+ 21E0A67916AAE0BA002479F9 /* CDIViewArchiveButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDIViewArchiveButton.m; sourceTree = "<group>"; };
B208BB9215BF63A80080705D /* CDIAddListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDIAddListTableViewCell.h; sourceTree = "<group>"; };
B208BB9315BF63A80080705D /* CDIAddListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDIAddListTableViewCell.m; sourceTree = "<group>"; };
B208BB9415BF63A80080705D /* CDIAddTaskAnimationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDIAddTaskAnimationView.h; sourceTree = "<group>"; };
@@ -1059,6 +1062,8 @@
B2B25FE316165B6D00ACFD3E /* CDIKeyboardButton.m */,
B2746E601618EAC8007A750B /* CDIMoveTaskView.h */,
B2746E611618EAC8007A750B /* CDIMoveTaskView.m */,
+ 21E0A67816AAE0BA002479F9 /* CDIViewArchiveButton.h */,
+ 21E0A67916AAE0BA002479F9 /* CDIViewArchiveButton.m */,
);
name = Views;
sourceTree = "<group>";
@@ -1427,6 +1432,7 @@
B2B25FE1161658AD00ACFD3E /* CDIKeyboardBar.m in Sources */,
B2B25FE416165B6D00ACFD3E /* CDIKeyboardButton.m in Sources */,
B2746E621618EAC8007A750B /* CDIMoveTaskView.m in Sources */,
+ 21E0A67A16AAE0BA002479F9 /* CDIViewArchiveButton.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -76,8 +76,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// Defer some stuff to make launching faster
dispatch_async(dispatch_get_main_queue(), ^{
// Setup status bar network indicator
-// [AFNetworkActivityIndicatorManager sharedManager].enabled = YES;
-
+ [AFNetworkActivityIndicatorManager sharedManager].enabled = YES;
+
// Set the OAuth client
[[CDKHTTPClient sharedClient] setClientID:kCDIAPIClientID secret:kCDIAPIClientSecret];
@@ -17,8 +17,10 @@
#import "CDIListsPlaceholderView.h"
#import "CDIAddListTableViewCell.h"
#import "CDIHUDView.h"
-#import "SMTEDelegateController.h"
+#import "CDIViewArchiveButton.h"
+
#import <SSToolkit/UIScrollView+SSToolkitAdditions.h>
+#import "SMTEDelegateController.h"
#ifdef CHEDDAR_USE_PASSWORD_FLOW
#import "CDISignInViewController.h"
@@ -29,7 +31,11 @@
NSString *const kCDISelectedListKey = @"CDISelectedListKey";
@interface CDIListsViewController ()
+@property (nonatomic, strong) CDKList *selectedList;
+@property (nonatomic, assign) BOOL adding;
+@property (nonatomic, assign) BOOL checkForOneList;
@property (nonatomic, strong) SMTEDelegateController *textExpander;
+@property (nonatomic, strong) CDIViewArchiveButton *archiveButton;
- (void)_listUpdated:(NSNotification *)notification;
- (void)_currentUserDidChange:(NSNotification *)notification;
- (void)_createList:(id)sender;
@@ -40,15 +46,7 @@ - (void)_beginEditingWithGesture:(UIGestureRecognizer *)gestureRecognizer;
- (BOOL)_shouldEditRowForGesture:(UIGestureRecognizer *)gestureRecognizer;
@end
-@implementation CDIListsViewController {
- CDKList *_selectedList;
- BOOL _adding;
- BOOL _checkForOneList;
-}
-
-
-@synthesize textExpander = _textExpander;
-
+@implementation CDIListsViewController
#pragma mark - NSObject
@@ -86,6 +84,18 @@ - (void)viewDidLoad {
self.textExpander.nextDelegate = self;
[[NSNotificationCenter defaultCenter] addObserver:self.textExpander selector:@selector(willEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
}
+
+ UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 50.0f)];
+ footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+
+ UIView *shadow = self.tableView.tableFooterView;
+ self.tableView.tableFooterView = footer;
+ shadow.frame = CGRectMake(0.0f, 0.0f, 320.0f, 3.0f);
+ [footer addSubview:shadow];
+
+ _archiveButton = [[CDIViewArchiveButton alloc] initWithFrame:CGRectMake(20.0f, 12.0f, 280.0f, 32.0)];
+ _archiveButton.alpha = 0.0f;
+ [footer addSubview:_archiveButton];
}
@@ -209,6 +219,13 @@ - (void)refresh:(id)sender {
[[CDKHTTPClient sharedClient] getListsWithSuccess:^(AFJSONRequestOperation *operation, id responseObject) {
dispatch_async(dispatch_get_main_queue(), ^{
self.loading = NO;
+
+ [_archiveButton setTitle:@"19 Archived Lists" forState:UIControlStateNormal];
+ if (_archiveButton.alpha < 1.0f) {
+ [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
+ _archiveButton.alpha = 1.0f;
+ } completion:nil];
+ }
});
} failure:^(AFJSONRequestOperation *operation, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
@@ -0,0 +1,13 @@
+//
+// CDIViewArchiveButton.h
+// Cheddar for iOS
+//
+// Created by Sam Soffes on 1/19/13.
+// Copyright (c) 2013 Nothing Magical. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface CDIViewArchiveButton : UIButton
+
+@end
@@ -0,0 +1,64 @@
+//
+// CDIViewArchiveButton.m
+// Cheddar for iOS
+//
+// Created by Sam Soffes on 1/19/13.
+// Copyright (c) 2013 Nothing Magical. All rights reserved.
+//
+
+#import "CDIViewArchiveButton.h"
+#import "UIColor+CheddariOSAdditions.h"
+#import "UIFont+CheddariOSAdditions.h"
+
+@interface CDIViewArchiveButton ()
+@property (nonatomic, strong) UIImageView *disclosureImageView;
+@end
+
+@implementation CDIViewArchiveButton
+
+#pragma mark - UIView
+
+- (id)initWithFrame:(CGRect)frame {
+ if ((self = [super initWithFrame:frame])) {
+ self.contentMode = UIViewContentModeRedraw;
+ [self setTitleColor:[[UIColor cheddarSteelColor] colorWithAlphaComponent:0.5f] forState:UIControlStateNormal];
+ [self setTitleColor:[UIColor cheddarSteelColor] forState:UIControlStateHighlighted];
+ self.titleLabel.font = [UIFont cheddarInterfaceFontOfSize:14.0f];
+ self.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
+ self.titleEdgeInsets = UIEdgeInsetsMake(0.0f, 10.0f, 0.0f, 0.0f);
+
+ _disclosureImageView = [[UIImageView alloc] init];
+ _disclosureImageView.image = [UIImage imageNamed:@"disclosure"];
+ _disclosureImageView.highlightedImage = [UIImage imageNamed:@"disclosure-highlighted"];
+ _disclosureImageView.alpha = 0.5f;
+ [self addSubview:_disclosureImageView];
+ }
+ return self;
+}
+
+
+- (void)drawRect:(CGRect)rect {
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ UIColor *color = self.highlighted ? [UIColor colorWithWhite:0.945f alpha:1.0f] : [UIColor colorWithWhite:0.957f alpha:1.0f];
+ [color setFill];
+ SSDrawRoundedRect(context, self.bounds, roundf(self.bounds.size.height / 2.0f));
+}
+
+
+- (void)layoutSubviews {
+ [super layoutSubviews];
+ CGSize size = self.bounds.size;
+ self.disclosureImageView.frame = CGRectMake(size.width - 20.0f, roundf((size.height - 15.0f) / 2.0f), 10.0f, 15.0f);
+}
+
+
+#pragma mark - UIControl
+
+- (void)setHighlighted:(BOOL)highlighted {
+ [super setHighlighted:highlighted];
+ self.disclosureImageView.alpha = highlighted ? 1.0f : 0.5f;
+ [self setNeedsDisplay];
+}
+
+@end

0 comments on commit ac4aa7f

Please sign in to comment.