diff options
Diffstat (limited to 'Juick')
23 files changed, 203 insertions, 213 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index b3f544c..b58251b 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -10,7 +10,6 @@ #import "MessagesViewController.h" #import "LoginViewController.h" -#import "ColorScheme.h" #import "APIClient.h" #import "Message.h" #import "User.h" @@ -26,11 +25,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [[UINavigationBar appearance] setTintColor:[ColorScheme linkColor]]; + [[UINavigationBar appearance] setTintColor:[UIColor colorNamed:@"Title"]]; //[[UINavigationBar appearance] setBarTintColor:[ColorScheme headerBackground]]; - [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme linkColor]}]; - [[UIToolbar appearance] setTintColor:[ColorScheme linkColor]]; - [[UITabBar appearance] setTintColor:[ColorScheme linkColor]]; + [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor colorNamed:@"Title"]}]; + [[UIToolbar appearance] setTintColor:[UIColor colorNamed:@"Title"]]; + [[UITabBar appearance] setTintColor:[UIColor colorNamed:@"Title"]]; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; diff --git a/Juick/Colors.xcassets/Background.colorset/Contents.json b/Juick/Colors.xcassets/Background.colorset/Contents.json new file mode 100644 index 0000000..53e5f34 --- /dev/null +++ b/Juick/Colors.xcassets/Background.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xFD", + "alpha" : "1.000", + "blue" : "0xFE", + "green" : "0xFD" + } + } + } + ] +}
\ No newline at end of file diff --git a/Juick/Colors.xcassets/Chat.colorset/Contents.json b/Juick/Colors.xcassets/Chat.colorset/Contents.json new file mode 100644 index 0000000..2702bf1 --- /dev/null +++ b/Juick/Colors.xcassets/Chat.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xF8", + "alpha" : "1.000", + "blue" : "0xF8", + "green" : "0xF8" + } + } + } + ] +}
\ No newline at end of file diff --git a/Juick/Colors.xcassets/Contents.json b/Juick/Colors.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Juick/Colors.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Colors.xcassets/Funny.colorset/Contents.json b/Juick/Colors.xcassets/Funny.colorset/Contents.json new file mode 100644 index 0000000..dfe4629 --- /dev/null +++ b/Juick/Colors.xcassets/Funny.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0xFF", + "alpha" : "1.000", + "blue" : "0x9A", + "green" : "0x33" + } + } + } + ] +}
\ No newline at end of file diff --git a/Juick/Colors.xcassets/Muted.colorset/Contents.json b/Juick/Colors.xcassets/Muted.colorset/Contents.json new file mode 100644 index 0000000..679b256 --- /dev/null +++ b/Juick/Colors.xcassets/Muted.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x88", + "alpha" : "1.000", + "blue" : "0x8D", + "green" : "0x95" + } + } + } + ] +}
\ No newline at end of file diff --git a/Juick/Colors.xcassets/Text.colorset/Contents.json b/Juick/Colors.xcassets/Text.colorset/Contents.json new file mode 100644 index 0000000..ee1c5bc --- /dev/null +++ b/Juick/Colors.xcassets/Text.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x22", + "alpha" : "1.000", + "blue" : "0x22", + "green" : "0x22" + } + } + } + ] +}
\ No newline at end of file diff --git a/Juick/Colors.xcassets/Title.colorset/Contents.json b/Juick/Colors.xcassets/Title.colorset/Contents.json new file mode 100644 index 0000000..2456f54 --- /dev/null +++ b/Juick/Colors.xcassets/Title.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x00", + "alpha" : "1.000", + "blue" : "0x99", + "green" : "0x66" + } + } + } + ] +}
\ No newline at end of file diff --git a/Juick/Helpers/ColorScheme.h b/Juick/Helpers/ColorScheme.h deleted file mode 100644 index 6620a96..0000000 --- a/Juick/Helpers/ColorScheme.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// Colors.h -// Juick -// -// Created by Vitaly Takmazov on 05.11.13. -// Copyright (c) 2013 com.juick. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@interface ColorScheme : NSObject - -+ (UIColor *)colorWithHex:(UInt32)col; - -+(UIColor *) mainBackground; -+(UIColor *) textColor; -+(UIColor *) headerBackground; -+(UIColor *) linkColor; -+(UIColor *) secondaryBackground; -@end diff --git a/Juick/Helpers/ColorScheme.m b/Juick/Helpers/ColorScheme.m deleted file mode 100644 index 1b72da2..0000000 --- a/Juick/Helpers/ColorScheme.m +++ /dev/null @@ -1,47 +0,0 @@ -// -// Colors.m -// Juick -// -// Created by Vitaly Takmazov on 05.11.13. -// Copyright (c) 2013 com.juick. All rights reserved. -// - -#import "ColorScheme.h" - -@implementation ColorScheme - -+ (void) initialize -{ - [super initialize]; -} - -// takes 0x123456 -+ (UIColor *)colorWithHex:(UInt32)col { - unsigned char r, g, b; - b = col & 0xFF; - g = (col >> 8) & 0xFF; - r = (col >> 16) & 0xFF; - return [UIColor colorWithRed:(float)r/255.0f green:(float)g/255.0f blue:(float)b/255.0f alpha:1]; -} - -+ (UIColor *) headerBackground { - return [self colorWithHex:0xffffff]; -} - -+ (UIColor *) mainBackground { - return [self colorWithHex:0xf8f8f8]; -} -+ (UIColor *) textColor { - return [self colorWithHex:0x222222]; -} - -+ (UIColor *) linkColor { - return [self colorWithHex:0x006699]; -} - -+ (UIColor *) secondaryBackground { - return [self colorWithHex:0xff339a]; -} - - -@end diff --git a/Juick/Images.xcassets/ei-clock.imageset/Contents.json b/Juick/Images.xcassets/ei-clock.imageset/Contents.json index 9ab4b4d..627d5f6 100644 --- a/Juick/Images.xcassets/ei-clock.imageset/Contents.json +++ b/Juick/Images.xcassets/ei-clock.imageset/Contents.json @@ -10,6 +10,7 @@ "author" : "xcode" }, "properties" : { + "template-rendering-intent" : "template", "preserves-vector-representation" : true } }
\ No newline at end of file diff --git a/Juick/Images.xcassets/ei-clock.imageset/ei-clock.pdf b/Juick/Images.xcassets/ei-clock.imageset/ei-clock.pdf Binary files differindex c63a095..2a80373 100644 --- a/Juick/Images.xcassets/ei-clock.imageset/ei-clock.pdf +++ b/Juick/Images.xcassets/ei-clock.imageset/ei-clock.pdf diff --git a/Juick/Main.storyboard b/Juick/Main.storyboard index 68df202..13f6304 100644 --- a/Juick/Main.storyboard +++ b/Juick/Main.storyboard @@ -42,15 +42,13 @@ </objects> <point key="canvasLocation" x="1520.8" y="-964.76761619190415"/> </scene> - <!--Navigation Controller--> + <!--Today--> <scene sceneID="NkO-CZ-YSO"> <objects> <navigationController id="k3X-uv-0IF" sceneMemberID="viewController"> - <tabBarItem key="tabBarItem" title="" image="ei-clock" id="Qml-qG-fK2"> - <inset key="imageInsets" minX="0.0" minY="6" maxX="0.0" maxY="-6"/> - </tabBarItem> - <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="3ze-yo-W7s"> - <rect key="frame" x="0.0" y="20" width="375" height="44"/> + <tabBarItem key="tabBarItem" title="Today" image="ei-clock" id="Qml-qG-fK2"/> + <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" largeTitles="YES" id="3ze-yo-W7s"> + <rect key="frame" x="0.0" y="20" width="375" height="96"/> <autoresizingMask key="autoresizingMask"/> </navigationBar> <connections> @@ -62,10 +60,10 @@ </objects> <point key="canvasLocation" x="-809" y="-162"/> </scene> - <!--Feed View Controller--> + <!--Today--> <scene sceneID="uvH-u9-x7X"> <objects> - <tableViewController id="VCH-GK-jaH" customClass="FeedViewController" sceneMemberID="viewController"> + <tableViewController title="Today" id="VCH-GK-jaH" customClass="FeedViewController" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="tbe-Zb-PfB"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> @@ -88,9 +86,7 @@ <outlet property="delegate" destination="VCH-GK-jaH" id="a3g-k1-u9r"/> </connections> </tableView> - <tabBarItem key="tabBarItem" title="" image="ei-clock" id="Je4-Zm-Zbu"> - <inset key="imageInsets" minX="0.0" minY="6" maxX="0.0" maxY="-6"/> - </tabBarItem> + <tabBarItem key="tabBarItem" title="Today" image="ei-clock" id="Je4-Zm-Zbu"/> <toolbarItems/> <navigationItem key="navigationItem" id="M2f-nV-K0C"> <barButtonItem key="rightBarButtonItem" image="ei-pencil" id="ovc-xl-vHA"> @@ -231,13 +227,11 @@ </objects> <point key="canvasLocation" x="-1052" y="599"/> </scene> - <!--Navigation Controller--> + <!--Chats--> <scene sceneID="slX-NB-ZJR"> <objects> <navigationController id="bqF-EV-jyA" sceneMemberID="viewController"> - <tabBarItem key="tabBarItem" title="" image="ei-envelope" id="uDU-Ru-VA7"> - <inset key="imageInsets" minX="0.0" minY="6" maxX="0.0" maxY="-6"/> - </tabBarItem> + <tabBarItem key="tabBarItem" title="Chats" image="ei-envelope" id="uDU-Ru-VA7"/> <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="MLM-G7-sIv"> <rect key="frame" x="0.0" y="20" width="375" height="44"/> <autoresizingMask key="autoresizingMask"/> @@ -276,8 +270,7 @@ <outlet property="delegate" destination="vqF-gx-pZG" id="xKF-Xt-zWe"/> </connections> </tableView> - <tabBarItem key="tabBarItem" title="" image="ei-envelope" id="vxB-Z9-1il"> - <inset key="imageInsets" minX="0.0" minY="6" maxX="0.0" maxY="-6"/> + <tabBarItem key="tabBarItem" title="Chats" image="ei-envelope" id="vxB-Z9-1il"> <offsetWrapper key="titlePositionAdjustment" horizontal="0.0" vertical="0.0"/> </tabBarItem> <navigationItem key="navigationItem" title="Chats" id="hVh-CA-hQo"/> @@ -295,7 +288,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="XYj-Y4-lfM"> - <rect key="frame" x="4" y="60" width="367" height="603"/> + <rect key="frame" x="4" y="112" width="367" height="551"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> @@ -394,35 +387,6 @@ </objects> <point key="canvasLocation" x="-808.79999999999995" y="-856.82158920539734"/> </scene> - <!--Profile--> - <scene sceneID="Zyp-VR-hlj"> - <objects> - <tableViewController title="Profile" id="7Y0-3h-zWt" sceneMemberID="viewController"> - <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="nT3-ZI-i7w"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <prototypes> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="tSi-Pj-acC"> - <rect key="frame" x="0.0" y="28" width="375" height="44"/> - <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="tSi-Pj-acC" id="wk3-ZO-iIr"> - <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/> - <autoresizingMask key="autoresizingMask"/> - </tableViewCellContentView> - </tableViewCell> - </prototypes> - <connections> - <outlet property="dataSource" destination="7Y0-3h-zWt" id="1Bz-sa-FSr"/> - <outlet property="delegate" destination="7Y0-3h-zWt" id="fqT-hp-VZl"/> - </connections> - </tableView> - <navigationItem key="navigationItem" id="vgf-KH-dbr"/> - </tableViewController> - <placeholder placeholderIdentifier="IBFirstResponder" id="vQg-XX-fxE" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="-3092" y="-162"/> - </scene> <!--Tab Bar Controller--> <scene sceneID="R7v-av-S80"> <objects> @@ -438,7 +402,6 @@ <segue destination="YkB-dq-pv4" kind="relationship" relationship="viewControllers" id="uQw-Xa-hwe"/> <segue destination="wJv-nS-OaN" kind="relationship" relationship="viewControllers" id="5Pl-1T-DRQ"/> <segue destination="bqF-EV-jyA" kind="relationship" relationship="viewControllers" id="L49-RF-BJa"/> - <segue destination="c61-bC-EVf" kind="relationship" relationship="viewControllers" id="aPU-HP-Ctr"/> </connections> </tabBarController> <placeholder placeholderIdentifier="IBFirstResponder" id="AnM-ht-zf8" userLabel="First Responder" sceneMemberID="firstResponder"/> @@ -474,13 +437,11 @@ </objects> <point key="canvasLocation" x="-2610.4000000000001" y="-856.82158920539734"/> </scene> - <!--Navigation Controller--> + <!--Discover--> <scene sceneID="rTx-Xr-jP4"> <objects> - <navigationController automaticallyAdjustsScrollViewInsets="NO" id="wJv-nS-OaN" sceneMemberID="viewController"> - <tabBarItem key="tabBarItem" title="" image="ei-search" id="Hf1-fH-Ne9"> - <inset key="imageInsets" minX="0.0" minY="6" maxX="0.0" maxY="-6"/> - </tabBarItem> + <navigationController title="Discover" automaticallyAdjustsScrollViewInsets="NO" id="wJv-nS-OaN" sceneMemberID="viewController"> + <tabBarItem key="tabBarItem" title="Discover" image="ei-search" id="Hf1-fH-Ne9"/> <toolbarItems/> <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="HfH-EY-4C6"> <rect key="frame" x="0.0" y="20" width="375" height="44"/> @@ -495,13 +456,11 @@ </objects> <point key="canvasLocation" x="-1748" y="-856.82158920539734"/> </scene> - <!--Navigation Controller--> + <!--Discussions--> <scene sceneID="PRP-vE-Jhi"> <objects> <navigationController automaticallyAdjustsScrollViewInsets="NO" id="YkB-dq-pv4" sceneMemberID="viewController"> - <tabBarItem key="tabBarItem" title="" image="ei-bell" id="r5a-uD-dsg"> - <inset key="imageInsets" minX="0.0" minY="6" maxX="0.0" maxY="-6"/> - </tabBarItem> + <tabBarItem key="tabBarItem" title="Discussions" image="ei-bell" id="r5a-uD-dsg"/> <toolbarItems/> <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="1ry-Mk-20P"> <rect key="frame" x="0.0" y="20" width="375" height="44"/> @@ -516,34 +475,12 @@ </objects> <point key="canvasLocation" x="-3551.1999999999998" y="-857.72113943028489"/> </scene> - <!--Navigation Controller--> - <scene sceneID="y8S-HS-lIv"> - <objects> - <navigationController automaticallyAdjustsScrollViewInsets="NO" id="c61-bC-EVf" sceneMemberID="viewController"> - <tabBarItem key="tabBarItem" title="" image="ei-gear" id="529-8F-A6e"> - <inset key="imageInsets" minX="0.0" minY="6" maxX="0.0" maxY="-6"/> - </tabBarItem> - <toolbarItems/> - <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Mr4-B4-jXb"> - <rect key="frame" x="0.0" y="20" width="375" height="44"/> - <autoresizingMask key="autoresizingMask"/> - </navigationBar> - <nil name="viewControllers"/> - <connections> - <segue destination="7Y0-3h-zWt" kind="relationship" relationship="rootViewController" id="iJd-OZ-Z0w"/> - </connections> - </navigationController> - <placeholder placeholderIdentifier="IBFirstResponder" id="KlJ-5c-fac" userLabel="First Responder" sceneMemberID="firstResponder"/> - </objects> - <point key="canvasLocation" x="-3839" y="-162"/> - </scene> </scenes> <resources> <image name="Splash.png" width="96" height="96"/> <image name="ei-bell" width="34" height="32"/> - <image name="ei-clock" width="34" height="34"/> + <image name="ei-clock" width="30" height="30"/> <image name="ei-envelope" width="34" height="26"/> - <image name="ei-gear" width="32" height="32"/> <image name="ei-pencil" width="30" height="29"/> <image name="ei-search" width="32" height="32"/> </resources> diff --git a/Juick/ViewControllers/DialogsViewController.m b/Juick/ViewControllers/DialogsViewController.m index 1f9f8e0..cbf0024 100644 --- a/Juick/ViewControllers/DialogsViewController.m +++ b/Juick/ViewControllers/DialogsViewController.m @@ -8,7 +8,6 @@ #import "DialogsViewController.h" #import "ChatViewController.h" -#import "ColorScheme.h" #import "ConversationCell.h" #import "APIClient.h" #import "AppDelegate.h" @@ -17,7 +16,7 @@ - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.visibleViewController.navigationItem.title = @"Chats"; - [self.view setBackgroundColor:[ColorScheme mainBackground]]; + [self.view setBackgroundColor:[UIColor colorNamed:@"Background"]]; [self.tableView registerNib:[UINib nibWithNibName:@"ConversationCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"notificationCell"]; [self refreshData]; self.refreshControl = [UIRefreshControl new]; diff --git a/Juick/ViewControllers/FeedViewController.m b/Juick/ViewControllers/FeedViewController.m index 67d80e1..d7b51a8 100644 --- a/Juick/ViewControllers/FeedViewController.m +++ b/Juick/ViewControllers/FeedViewController.m @@ -12,7 +12,6 @@ #import "MessageCell.h" #import "APIClient.h" #import "AppDelegate.h" -#import "ColorScheme.h" @interface FeedViewController () @@ -48,11 +47,6 @@ [super viewDidLoad]; } --(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - NSString * cellIdentifier = @"messageCell"; - MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; - [self performSegueWithIdentifier:@"threadViewSegue" sender:cell]; -} - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (!self.dataLoading) { MessageCell *cell = (MessageCell *)[super tableView:tableView cellForRowAtIndexPath:indexPath]; @@ -67,35 +61,7 @@ self.selectedUser = uname; [self performSegueWithIdentifier:@"profileSegue" sender:self]; } - --(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - if ([segue.identifier isEqual: @"threadViewSegue"]) { - NSNumber *mid; - BOOL scrollToEnd = NO; - if ([AppDelegate shared].pushedThread != nil) { - mid = [[AppDelegate shared].pushedThread copy]; - [AppDelegate shared].pushedThread = nil; - [AppDelegate shared].pushedUname = nil; - scrollToEnd = YES; - } else { - Message *msg = [self.messages objectAtIndex:[self.tableView indexPathForSelectedRow].row]; - mid = msg.mid; - } - if ([mid integerValue] > 0) { - ThreadViewController *threadVC = (ThreadViewController *)segue.destinationViewController; - [threadVC setPath:[APIClient threadUrl]]; - [threadVC setParams:@{@"mid": mid }]; - [threadVC setShouldScrollToBottomOnRefresh:scrollToEnd]; - } - } - if ([segue.identifier isEqual: @"profileSegue"]) { - BlogViewController *blogVC = (BlogViewController *)segue.destinationViewController; - [blogVC setUname:self.selectedUser]; - [blogVC setTitle:self.selectedUser]; - blogVC.path = [NSString stringWithFormat:@"/messages?uname=%@", self.selectedUser]; - [blogVC setShouldScrollToBottomOnRefresh:NO]; - } -} +/* - (IBAction)filterAction:(id)sender { if (![[APIClient sharedClient] isAuthenticated]) { [self.navigationController performSegueWithIdentifier:@"loginSegue" sender:self.navigationController]; @@ -135,7 +101,7 @@ popover.permittedArrowDirections = UIPopoverArrowDirectionUp; } [self presentViewController:filterAlert animated:YES completion:nil]; -} +}*/ -(void) loadMore { Message *lastMsg = [self.messages lastObject]; diff --git a/Juick/ViewControllers/LoginViewController.m b/Juick/ViewControllers/LoginViewController.m index de18286..1894b1c 100644 --- a/Juick/ViewControllers/LoginViewController.m +++ b/Juick/ViewControllers/LoginViewController.m @@ -8,7 +8,6 @@ #import "LoginViewController.h" #import "User.h" -#import "ColorScheme.h" #import "AppDelegate.h" #import "APIClient.h" @@ -21,8 +20,8 @@ - (void) awakeFromNib { [super awakeFromNib]; self.title = @"Sign in"; - [self.view setBackgroundColor:[ColorScheme mainBackground]]; - [self.visualEffectView.contentView setBackgroundColor:[ColorScheme headerBackground]]; + [self.view setBackgroundColor:[UIColor colorNamed:@"Background"]]; + [self.visualEffectView.contentView setBackgroundColor:[UIColor colorNamed:@"Background"]]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelSignIn)]; diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index 9cece2c..8b4bfae 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -9,9 +9,9 @@ #import "MessagesViewController.h" #import "MessageCell.h" +#import "AppDelegate.h" #import "APIClient.h" #import "Message.h" -#import "ColorScheme.h" #import "NewPostViewController.h" #import "LoginViewController.h" @@ -85,7 +85,7 @@ { [super viewDidLoad]; self.dataLoading = YES; - [self.view setBackgroundColor:[ColorScheme mainBackground]]; + [self.view setBackgroundColor:[UIColor colorNamed:@"Background"]]; [self.tableView registerNib:[UINib nibWithNibName:@"MessageCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"messageCell"]; [self.tableView registerNib:[UINib nibWithNibName:@"ContentLoadingCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"contentLoadingCell"]; self.tableView.rowHeight = UITableViewAutomaticDimension; @@ -126,6 +126,42 @@ return self.dataLoading && self.messages.count == 0 ? 200.0f : [super tableView:tableView heightForRowAtIndexPath:indexPath]; } +-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + NSString * cellIdentifier = @"messageCell"; + MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; + [self performSegueWithIdentifier:@"threadViewSegue" sender:cell]; +} + +-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if ([segue.identifier isEqual: @"threadViewSegue"]) { + NSNumber *mid; + BOOL scrollToEnd = NO; + if ([AppDelegate shared].pushedThread != nil) { + mid = [[AppDelegate shared].pushedThread copy]; + [AppDelegate shared].pushedThread = nil; + [AppDelegate shared].pushedUname = nil; + scrollToEnd = YES; + } else { + Message *msg = [self.messages objectAtIndex:[self.tableView indexPathForSelectedRow].row]; + mid = msg.mid; + } + if ([mid integerValue] > 0) { + ThreadViewController *threadVC = (ThreadViewController *)segue.destinationViewController; + [threadVC setPath:[APIClient threadUrl]]; + [threadVC setParams:@{@"mid": mid }]; + [threadVC setShouldScrollToBottomOnRefresh:scrollToEnd]; + } + } + /* + if ([segue.identifier isEqual: @"profileSegue"]) { + BlogViewController *blogVC = (BlogViewController *)segue.destinationViewController; + [blogVC setUname:self.selectedUser]; + [blogVC setTitle:self.selectedUser]; + blogVC.path = [NSString stringWithFormat:@"/messages?uname=%@", self.selectedUser]; + [blogVC setShouldScrollToBottomOnRefresh:NO]; + }*/ +} + -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView_ { CGFloat actualPosition = scrollView_.contentOffset.y; CGFloat contentHeight = scrollView_.contentSize.height - scrollView_.contentSize.height / 2; diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m index 95672e8..5a59867 100644 --- a/Juick/ViewControllers/NewPostViewController.m +++ b/Juick/ViewControllers/NewPostViewController.m @@ -8,7 +8,6 @@ #import "NewPostViewController.h" #import "MessagesViewController.h" -#import "ColorScheme.h" #import "QuoteView.h" #import "APIClient.h" @@ -27,7 +26,7 @@ { [super viewDidLoad]; self.paddingValue = self.bottomConstraint.constant; - [self.view setBackgroundColor:[ColorScheme mainBackground]]; + [self.view setBackgroundColor:[UIColor colorNamed:@"Background"]]; if (_replyTo != nil) { QuoteView *inputView = (QuoteView *) self.inputAccessoryView; inputView.quoteText.text = _replyTo.text; diff --git a/Juick/Views/BubbleMessageCell.m b/Juick/Views/BubbleMessageCell.m index 70746cf..ce41002 100644 --- a/Juick/Views/BubbleMessageCell.m +++ b/Juick/Views/BubbleMessageCell.m @@ -7,7 +7,6 @@ // #import "BubbleMessageCell.h" -#import "ColorScheme.h" @implementation BubbleMessageCell @@ -23,10 +22,10 @@ } -(void) configureWithMessage:(Message *)message isMe:(BOOL)isMe { - self.message.backgroundColor = isMe ? [ColorScheme secondaryBackground] : [ColorScheme mainBackground]; - self.message.textColor = isMe ? [UIColor whiteColor] : [ColorScheme textColor]; + self.message.backgroundColor = isMe ? [UIColor colorNamed:@"Funny"] : [UIColor colorNamed:@"Chat"]; + self.message.textColor = isMe ? [UIColor whiteColor] : [UIColor colorNamed:@"Text"]; self.message.dataDetectorTypes = UIDataDetectorTypeAll; - self.message.tintColor = isMe? [UIColor whiteColor] : [ColorScheme linkColor]; + self.message.tintColor = isMe? [UIColor whiteColor] : [UIColor colorNamed:@"Title"]; self.name.text = message.user.uname; self.message.text = message.text; self.unreadMarker.text = @""; diff --git a/Juick/Views/ConversationCell.m b/Juick/Views/ConversationCell.m index bcf99e7..e4a000c 100644 --- a/Juick/Views/ConversationCell.m +++ b/Juick/Views/ConversationCell.m @@ -7,12 +7,11 @@ // #import "ConversationCell.h" -#import "ColorScheme.h" @implementation ConversationCell -(void) configureWithChat:(Chat *)chat { - self.chatName.textColor = [ColorScheme linkColor]; + self.chatName.textColor = [UIColor colorNamed:@"Title"]; self.chatName.text = chat.uname; self.lastMessage.text = chat.lastMessageText; self.unreadMarker.hidden = true; diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m index 6929436..fc7a821 100644 --- a/Juick/Views/MessageCell.m +++ b/Juick/Views/MessageCell.m @@ -7,7 +7,6 @@ // #import "MessageCell.h" -#import "ColorScheme.h" #import "APIClient.h" #import "Entity.h" @@ -21,12 +20,12 @@ - (void)awakeFromNib { [super awakeFromNib]; - self.text.textColor = [ColorScheme textColor]; + self.text.textColor = [UIColor colorNamed:@"Text"]; self.text.dataDetectorTypes = UIDataDetectorTypeAll; - self.text.tintColor = [ColorScheme linkColor]; - self.title.textColor = [ColorScheme linkColor]; - self.timestamp.textColor = [UIColor grayColor]; - self.summary.textColor = [UIColor grayColor]; + self.text.tintColor = [UIColor colorNamed:@"Title"]; + self.title.textColor = [UIColor colorNamed:@"Title"]; + self.timestamp.textColor = [UIColor colorNamed:@"Muted"]; + self.summary.textColor = [UIColor colorNamed:@"Muted"]; UIGestureRecognizer *avatarTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(avatarClicked:)]; [avatarTapRecognizer setEnabled:YES]; [self.avatar addGestureRecognizer:avatarTapRecognizer]; diff --git a/Juick/Views/MessageInputView.m b/Juick/Views/MessageInputView.m index f16f490..ab6b3e5 100644 --- a/Juick/Views/MessageInputView.m +++ b/Juick/Views/MessageInputView.m @@ -7,13 +7,12 @@ // #import "MessageInputView.h" -#import "ColorScheme.h" @implementation MessageInputView -(void) awakeFromNib { [super awakeFromNib]; - [self setTintColor:[ColorScheme linkColor]]; + [self setTintColor:[UIColor colorNamed:@"Title"]]; } @end diff --git a/Juick/Views/QuoteView.m b/Juick/Views/QuoteView.m index bb9cd75..4ff78ce 100644 --- a/Juick/Views/QuoteView.m +++ b/Juick/Views/QuoteView.m @@ -7,12 +7,11 @@ // #import "QuoteView.h" -#import "ColorScheme.h" @implementation QuoteView -(void) awakeFromNib { [super awakeFromNib]; - self.contentView.backgroundColor = [ColorScheme headerBackground]; + self.contentView.backgroundColor = [UIColor whiteColor]; } @end |