Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
leoru committed Apr 13, 2015
2 parents ffb4833 + c4692f7 commit d54f4b0
Show file tree
Hide file tree
Showing 23 changed files with 128 additions and 96 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (id)initWithStyle:(UITableViewStyle)style
}

- (void)viewWillAppear:(BOOL)animated{
if(editingMode){
if(editingMode) {
[self.favouritesTable setEditing:NO animated:NO];
editingMode = NO;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ -(void)initTopBar {

NSString *star;
NSString *starPush;
if([self isInFavourites]){
if([self isInFavourites]) {
star = @"add_to_favorite_filled.png";
starPush = @"add_to_favorite.png";
}else{
Expand Down Expand Up @@ -335,7 +335,7 @@ -(void)loadHTMLContent {
NSString *filtered = [[html stringByReplacingOccurrencesOfString:@" " withString:@""] stringByReplacingOccurrencesOfString:@"\n" withString:@""];
NSLog(@"%@", filtered);
NSRange range = [filtered rangeOfString:@"<body>(null)</body>"];
if(range.length > 0){
if(range.length > 0) {
html = [FLHTMLUtils descriptionForbidden:html];
}
[self.webView loadHTMLString:html baseURL:baseURL];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

if (indexPath.row == self.freelancers.count) {
if (!stopSearch) {
if(![FLInternetConnectionUtils isConnectedToInternet]){
if(![FLInternetConnectionUtils isConnectedToInternet]) {
cell = [tableView dequeueReusableCellWithIdentifier:emptyCellIdentifier];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:emptyCellIdentifier owner:nil options:nil][0];
Expand Down
6 changes: 0 additions & 6 deletions freelansim-client/Classes/FLDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,3 @@ extern NSString * const errorMessageServertDontRespond;
#define kNavBarColor [UIColor colorWithRed:0.35 green:0.41 blue:0.48 alpha:1]
#define kDefaultBlueColor [UIColor colorWithRed:0.36 green:0.7 blue:0.93 alpha:1]
#define kDEFAULT_TEXT_COLOR [UIColor colorWithRed:(93/255.f) green:(101/255.f) blue:(119/255.f) alpha:1];

@interface FLDefines : NSObject

+(UIImage *)radialGradientImage:(CGSize)size startColor:(CGFloat [4])startColor endcolor:(CGFloat [4])endColor centre:(CGPoint)centre radius:(float)radius;

@end
38 changes: 0 additions & 38 deletions freelansim-client/Classes/FLDefines.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,3 @@
NSString * const errorMessageNetworkDisable = @"Проверьте настройки интернет";
NSString * const errorMessageServertDontRespond = @"Ошибка на сервере. Попробуйте повторить позднее";

@implementation FLDefines

+(UIImage *)radialGradientImage:(CGSize)size startColor:(CGFloat [4])startColor endcolor:(CGFloat [4])endColor centre:(CGPoint)centre radius:(float)radius {

UIGraphicsBeginImageContextWithOptions(size, YES, 1);
// Create the gradient's colours
size_t num_locations = 2;
CGFloat locations[2] = { 0.7, 1.0 };
CGFloat components[8] = { startColor[0],startColor[1],startColor[2],startColor[3] ,endColor[0],endColor[1], endColor[2],endColor[3] }; // End color


CGColorSpaceRef myColorspace = CGColorSpaceCreateDeviceRGB();
CGGradientRef myGradient = CGGradientCreateWithColorComponents (myColorspace, components, locations, num_locations);

// Normalise the 0-1 ranged inputs to the width of the image
CGPoint myCentrePoint = CGPointMake(centre.x * size.width, centre.y * size.height);
float myRadius = MIN(size.width, size.height) * radius;

// Draw it!
CGContextDrawRadialGradient (UIGraphicsGetCurrentContext(), myGradient, myCentrePoint,
0, myCentrePoint, myRadius,
kCGGradientDrawsAfterEndLocation);

// Grab it as an autoreleased image
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

// Clean up
CGColorSpaceRelease(myColorspace);
CGGradientRelease(myGradient);
UIGraphicsEndImageContext();
return image;
}





@end
2 changes: 1 addition & 1 deletion freelansim-client/Classes/FLHTMLParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ -(FLFreelancer *)parseFreelancer:(FLFreelancer *)fl {
// site
NSString *site;
HTMLNode *siteNode = [contactsNode findChildOfClass:@"site"];
if(siteNode){
if(siteNode) {
site = [siteNode getAttributeNamed:@"href"];
}
if (site) {
Expand Down
2 changes: 1 addition & 1 deletion freelansim-client/Classes/Models/FLManagedTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ -(void)mapWithTask:(FLTask *)task{

NSLog(@"TASKCOUNT!!! = %d",task.viewCount);

for(NSString *tag in task.tags){
for(NSString *tag in task.tags) {
FLManagedTag *managedTag = [FLManagedTag MR_createInContext:localContext];
managedTag.value = tag;
managedTag.task = self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <UIKit/UIKit.h>

@interface MINLoadingCell : UITableViewCell
@interface FLLoadingCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UIImageView *loadingImage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// Copyright (c) 2015 Kirill Kunst. All rights reserved.
//

#import "MINLoadingCell.h"
#import "FLLoadingCell.h"

@implementation MINLoadingCell
@implementation FLLoadingCell

@synthesize loadingImage;

Expand Down
18 changes: 9 additions & 9 deletions freelansim-client/MainStoryboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fG6-jQ-AR4">
<rect key="frame" x="44" y="13" width="581" height="21"/>
<rect key="frame" x="44" y="13" width="901" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="tintColor" red="0.36470588240000001" green="0.39607843139999999" blue="0.46666666670000001" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
<color key="textColor" red="0.36470588240000001" green="0.39607843139999999" blue="0.46666666670000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" id="gvg-De-3u7">
<rect key="frame" x="44" y="40" width="596" height="1"/>
<rect key="frame" x="44" y="40" width="916" height="1"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
<color key="backgroundColor" red="0.79433973648190348" green="0.79315585596400584" blue="0.81383529974489799" alpha="1" colorSpace="calibratedRGB"/>
</view>
Expand Down Expand Up @@ -105,7 +105,7 @@
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="v2X-HV-zfV">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="v2X-HV-zfV">
<rect key="frame" x="0.0" y="0.0" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -359,7 +359,7 @@
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="mnL-0t-txz">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="mnL-0t-txz">
<rect key="frame" x="0.0" y="0.0" width="320" height="504"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand All @@ -373,7 +373,7 @@
</searchBar>
</tableView>
<view hidden="YES" autoresizesSubviews="NO" contentMode="scaleToFill" id="ME7-SB-5rq">
<rect key="frame" x="-29" y="44" width="380" height="460"/>
<rect key="frame" x="-30" y="44" width="380" height="460"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="search_no_results.png" id="X6b-R2-Sfd">
Expand Down Expand Up @@ -417,7 +417,7 @@
<scene sceneID="k7x-up-LGU">
<objects>
<tableViewController title="Избранное" id="09X-e2-HdT" customClass="FLFavouritesController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="rbd-th-f7B">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="rbd-th-f7B">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -594,7 +594,7 @@
<nil key="highlightedColor"/>
</label>
<activityIndicatorView opaque="NO" contentMode="scaleToFill" animating="YES" style="whiteLarge" id="Vi4-Fy-VF2">
<rect key="frame" x="15" y="19" width="37" height="37"/>
<rect key="frame" x="18" y="17" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="color" red="0.96078431369999995" green="0.67450980390000004" blue="0.25882352939999997" alpha="1" colorSpace="calibratedRGB"/>
</activityIndicatorView>
Expand Down Expand Up @@ -717,8 +717,8 @@
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="Ywv-uo-V9T"/>
<segue reference="VT8-2P-bpd"/>
<segue reference="cyE-FZ-hGI"/>
<segue reference="SXZ-wO-cMx"/>
<segue reference="x9E-yU-h1c"/>
</inferredMetricsTieBreakers>
</document>
13 changes: 13 additions & 0 deletions freelansim-client/UIImage+RadialGradient.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// RTImageCategorie.h
// freelansim
//
// Created by Morozov Ivan on 12.04.15.
// Copyright (c) 2015 Kirill Kunst. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (RadialGradient)
+(UIImage *)radialGradientImage:(CGSize)size startColor:(CGFloat [4])startColor endcolor:(CGFloat [4])endColor centre:(CGPoint)centre radius:(float)radius;
@end
42 changes: 42 additions & 0 deletions freelansim-client/UIImage+RadialGradient.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// RTImageCategorie.m
// freelansim
//
// Created by Morozov Ivan on 12.04.15.
// Copyright (c) 2015 Kirill Kunst. All rights reserved.
//

#import "UIImage+RadialGradient.h"

@implementation UIImage (RTRadialImage)
+(UIImage *)radialGradientImage:(CGSize)size startColor:(CGFloat [4])startColor endcolor:(CGFloat [4])endColor centre:(CGPoint)centre radius:(float)radius {

UIGraphicsBeginImageContextWithOptions(size, YES, 1);
// Create the gradient's colours
size_t num_locations = 2;
CGFloat locations[2] = { 0.7, 1.0 };
CGFloat components[8] = { startColor[0],startColor[1],startColor[2],startColor[3] ,endColor[0],endColor[1], endColor[2],endColor[3] }; // End color


CGColorSpaceRef myColorspace = CGColorSpaceCreateDeviceRGB();
CGGradientRef myGradient = CGGradientCreateWithColorComponents (myColorspace, components, locations, num_locations);

// Normalise the 0-1 ranged inputs to the width of the image
CGPoint myCentrePoint = CGPointMake(centre.x * size.width, centre.y * size.height);
float myRadius = MIN(size.width, size.height) * radius;

// Draw it!
CGContextDrawRadialGradient (UIGraphicsGetCurrentContext(), myGradient, myCentrePoint,
0, myCentrePoint, myRadius,
kCGGradientDrawsAfterEndLocation);

// Grab it as an autoreleased image
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

// Clean up
CGColorSpaceRelease(myColorspace);
CGGradientRelease(myGradient);
UIGraphicsEndImageContext();
return image;
}
@end
2 changes: 1 addition & 1 deletion freelansim-client/Views/Cells/CategoryCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];

if (selected==YES){
if (selected == YES) {
[self.customCategoryCheckmark setHidden:NO];
self.customCategoryTitle.textColor =[UIColor colorWithRed:(82/255.f)
green:(166/255.f)
Expand Down
8 changes: 4 additions & 4 deletions freelansim-client/Views/Cells/FLFreelancerCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "FLFreelancerCell.h"
#import "UIImageView+WebCache.h"
#import "FLDefines.h"
#import "UIImage+RadialGradient.h"

@implementation FLFreelancerCell{
BOOL animationcomplete;
Expand Down Expand Up @@ -38,7 +38,7 @@ - (void)awakeFromNib

CGFloat end[4] ={1,1,1,1};

UIImage * im = [FLDefines radialGradientImage:self.animationBody.frame.size startColor:start endcolor:end centre:CGPointMake(0.4,0.4) radius:0.7];
UIImage * im = [UIImage radialGradientImage:self.animationBody.frame.size startColor:start endcolor:end centre:CGPointMake(0.4,0.4) radius:0.7];
UIImageView * imageview = [[UIImageView alloc] initWithImage:im];

[self.animationBody addSubview:imageview];
Expand All @@ -56,8 +56,8 @@ - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
animations:^{
self.animationBody.transform = CGAffineTransformMakeScale(75, 75);
}
completion:^(BOOL b){
if (!isSelected){
completion:^(BOOL b) {
if (!isSelected) {
self.animationBody.transform = CGAffineTransformMakeScale(0, 0);
}
animationcomplete=YES; }];
Expand Down
4 changes: 2 additions & 2 deletions freelansim-client/Views/Cells/FLTaskCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "FLTaskCell.h"
#import "FLDefines.h"
#import "UIImage+RadialGradient.h"

@implementation FLTaskCell{
BOOL animationcomplete;
Expand Down Expand Up @@ -35,7 +35,7 @@ - (void)awakeFromNib
CGFloat start[4] ={(232/255.f),(237/255.f),(242/255.f), 1.0};
CGFloat end[4] ={1,1,1,1};

UIImage * im = [FLDefines radialGradientImage:self.animationBody.frame.size startColor:start endcolor:end centre:CGPointMake(0.4,0.4) radius:0.7];
UIImage * im = [UIImage radialGradientImage:self.animationBody.frame.size startColor:start endcolor:end centre:CGPointMake(0.4,0.4) radius:0.7];
UIImageView * imageview = [[UIImageView alloc] initWithImage:im];

[self.animationBody addSubview:imageview];
Expand Down
18 changes: 9 additions & 9 deletions freelansim-client/Views/Cells/FavouriteCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "FavouriteCell.h"
#import "FLValueTransformer.h"
#import "FLDefines.h"
#import "UIImage+RadialGradient.h"
#import "FLTask.h"


Expand Down Expand Up @@ -37,11 +37,11 @@ - (void)awakeFromNib
[super awakeFromNib];
animationcomplete = YES;
isSelected = NO;
CGFloat start[4] ={(232/255.f),(237/255.f),(242/255.f), 1.0};
CGFloat end[4] ={1,1,1,1};
CGFloat start[4] = {(232/255.f),(237/255.f),(242/255.f), 1.0};
CGFloat end[4] = {1,1,1,1};

UIImage * im = [FLDefines radialGradientImage:self.animationBody.frame.size startColor:start endcolor:end centre:CGPointMake(0.3,0.4) radius:0.7];
UIImageView * imageview = [[UIImageView alloc] initWithImage:im];
UIImage * im = [UIImage radialGradientImage:self.animationBody.frame.size startColor:start endcolor:end centre:CGPointMake(0.3,0.4) radius:0.7];
UIImageView *imageview = [[UIImageView alloc] initWithImage:im];

[self.animationBody addSubview:imageview];

Expand All @@ -57,18 +57,18 @@ - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated

isSelected = highlighted;
if (highlighted) {
animationcomplete=NO;
animationcomplete = NO;
[UIView animateWithDuration:0.3
delay:0
options:UIViewAnimationOptionCurveEaseIn
animations:^{
self.animationBody.transform = CGAffineTransformMakeScale(65, 65);
}
completion:^(BOOL b){
if (!isSelected){
completion:^(BOOL b) {
if (!isSelected) {
self.animationBody.transform = CGAffineTransformMakeScale(0, 0);
}
animationcomplete=YES; }];
animationcomplete = YES;}];
} else {
if (animationcomplete) {
self.animationBody.transform = CGAffineTransformMakeScale(0, 0);
Expand Down
Loading

0 comments on commit d54f4b0

Please sign in to comment.