Skip to content

Commit

Permalink
Fix bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
titman committed Jun 29, 2015
1 parent 4707480 commit 6b781fc
Show file tree
Hide file tree
Showing 23 changed files with 116 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"提醒" = "Attention";
"确定要删除这个照片吗?" = "Are you sure to delete the photo?";
"确定要删除这个标签吗?" = "Are you sure to delete the tag?";
"确定要清除缓存吗?" = "Are you sure to remove caches?";
"您未安装微博客户端,无法分享" = "You haven't installed Weibo yet";
"您未安装QQ客户端,无法分享" = "You haven't installed QQ yet";
"您未安装微信客户端,无法分享" = "You haven't installed Wechat yet";
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
87 changes: 53 additions & 34 deletions LIKE/LIKE/LKApplication/Application/Home/LKHomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -525,33 +525,44 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion

-(void) searchAction
{

if(![LKLoginViewController needLoginOnViewController:[LCUIApplication sharedInstance].window.rootViewController]){

LC_FAST_ANIMATIONS(0.25, ^{
LC_FAST_ANIMATIONS_F(0.2, ^{

self.searchButton.alpha = 0;
self.notificationButton.alpha = 0;
self.header.headImageView.alpha = 0;
self.header.nameLabel.alpha = 0;
LC_APPDELEGATE.tabBarController.assistiveTouchButton.hidden = YES;

});

LKSearchViewController * view = LKSearchViewController.view;

[view showInViewController:self];

@weakly(self);

view.willHide = ^(){
}, ^(BOOL finished){

@normally(self);
LKSearchViewController * view = LKSearchViewController.view;

self.searchButton.alpha = 1;
self.notificationButton.alpha = 1;
self.header.headImageView.alpha = 1;
[self scrollViewDidScroll:self.tableView];
LC_APPDELEGATE.tabBarController.assistiveTouchButton.hidden = NO;
};
[view showInViewController:self];

@weakly(self);

view.willHide = ^(){

@normally(self);

[UIView animateWithDuration:0.2 delay:0.25 options:UIViewAnimationOptionCurveLinear animations:^{

self.searchButton.alpha = 1;
self.notificationButton.alpha = 1;
[self.header layoutSubviews];
LC_APPDELEGATE.tabBarController.assistiveTouchButton.hidden = NO;

} completion:^(BOOL finished) {

}];

};

});

}

}
Expand All @@ -560,30 +571,38 @@ -(void) notificationAction
{
if(![LKLoginViewController needLoginOnViewController:[LCUIApplication sharedInstance].window.rootViewController]){

LC_FAST_ANIMATIONS(0.25, ^{

LC_FAST_ANIMATIONS_F(0.2, ^{

self.searchButton.alpha = 0;
self.header.headImageView.alpha = 0;
self.header.nameLabel.alpha = 0;
LC_APPDELEGATE.tabBarController.assistiveTouchButton.hidden = YES;

});

LKNotificationViewController * view = LKNotificationViewController.view;

[view showInViewController:self];
}, ^(BOOL finished){

@weakly(self);

view.willHide = ^(){

@normally(self);
LKNotificationViewController * view = LKNotificationViewController.view;

self.searchButton.alpha = 1;
self.header.headImageView.alpha = 1;
[self scrollViewDidScroll:self.tableView];
LC_APPDELEGATE.tabBarController.assistiveTouchButton.hidden = NO;

};
[view showInViewController:self];

@weakly(self);

view.willHide = ^(){

@normally(self);

[UIView animateWithDuration:0.2 delay:0.25 options:UIViewAnimationOptionCurveLinear animations:^{

self.searchButton.alpha = 1;
self.notificationButton.alpha = 1;
[self.header layoutSubviews];
LC_APPDELEGATE.tabBarController.assistiveTouchButton.hidden = NO;

} completion:^(BOOL finished) {

}];
};
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion
page = self.page + 1;
}

LKHttpRequestInterface * interface = [LKHttpRequestInterface interfaceType:[NSString stringWithFormat:@"tag/search/%@/%@", self.searchString.URLCODE(), @(page)]].AUTO_SESSION();
LKHttpRequestInterface * interface = [LKHttpRequestInterface interfaceType:[NSString stringWithFormat:@"search/tag/%@/%@", self.searchString.URLCODE(), @(page)]].AUTO_SESSION();

@weakly(self);

Expand Down
29 changes: 20 additions & 9 deletions LIKE/LIKE/LKApplication/Application/Home/LKSearchViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ -(void) buildUI
self.ADD(self.searchBar);


[self.searchBar.searchField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0];
[self.searchBar.searchField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.5];


self.placeholderView = LKSearchPlaceholderView.view;
Expand Down Expand Up @@ -173,18 +173,29 @@ -(void) hide
UIView * view = self.FIND(1002);
self.userInteractionEnabled = NO;

[UIView animateWithDuration:0.5 delay:0 usingSpringWithDamping:1 initialSpringVelocity:3 options:UIViewAnimationOptionCurveEaseInOut animations:^{
LC_FAST_ANIMATIONS_F(0.25, ^{

view.alpha = 0;
self.searchBar.alpha = 0;
self.blur.viewFrameY = self.viewFrameHeight;
self.placeholderView.viewFrameY = self.viewFrameHeight;

((UIView *)self.FIND(1002)).alpha = 0;

} completion:^(BOOL finished) {
}, ^(BOOL finished){

[self removeFromSuperview];
}];
[UIView animateWithDuration:0.5 delay:0 usingSpringWithDamping:1 initialSpringVelocity:3 options:UIViewAnimationOptionCurveEaseInOut animations:^{

view.alpha = 0;
self.searchBar.alpha = 0;
self.blur.viewFrameY = self.viewFrameHeight;
self.placeholderView.viewFrameY = self.viewFrameHeight;


} completion:^(BOOL finished) {

[self removeFromSuperview];
}];

});

}

#pragma mark -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ -(void) buildUI

self.contentBack = UIView.view;
self.contentBack.clipsToBounds = YES;
// self.contentBack.layer.shadowColor = [UIColor lightGrayColor].CGColor;
// self.contentBack.layer.shadowOffset = CGSizeMake(0, 0);
// self.contentBack.layer.opacity = 1;
// self.contentBack.layer.shadowRadius = 2;
self.ADD(self.contentBack);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ -(void) handleScrollDidScroll:(UIScrollView *)scrollView

self.viewFrameHeight = newHeight;
self.backgroundView.viewFrameHeight = newHeight;


if(scrollView.contentOffset.y < -self.maximumBarHeight){

Expand Down
27 changes: 24 additions & 3 deletions LIKE/LIKE/LKApplication/Application/Home/Views/LKHotTagsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,35 @@
#import "LKHotTagsView.h"
#import "LKTag.h"

@interface LKHotTagItem ()

LC_PROPERTY(strong) UIView * maskView;

@end

@implementation LKHotTagItem

-(instancetype) init
{
if (self = [super init]) {

self.contentMode = UIViewContentModeScaleAspectFill;
self.userInteractionEnabled = YES;
self.cornerRadius = 4;
self.layer.masksToBounds = NO;
self.backgroundColor = LC_RGB(245, 240, 236);


self.maskView = UIView.view.COLOR([[UIColor blackColor] colorWithAlphaComponent:0.12]);
self.ADD(self.maskView);


self.tagLabel = LCUILabel.view;
self.tagLabel.font = LK_FONT_B(11);
self.tagLabel.textColor = [UIColor whiteColor];
self.ADD(self.tagLabel);


self.maskView.hidden = YES;


[self addTapGestureRecognizer:self selector:@selector(didTapAction)];
Expand Down Expand Up @@ -57,7 +71,14 @@ -(void) setTagString:(NSString *)tagString


self.cornerRadius = self.viewMidHeight;
self.layer.masksToBounds = NO;
self.maskView.frame = self.bounds;
}

-(void) setUrl:(NSString *)url
{
[super setUrl:url];

self.maskView.hidden = NO;
}

-(void) setSelected:(BOOL)selected
Expand Down Expand Up @@ -171,7 +192,7 @@ -(void) reloadData
item.tag = i;
item.tagString = tag.tag;

if (LC_NSSTRING_IS_INVALID(tag.image)) {
if (!LC_NSSTRING_IS_INVALID(tag.image)) {

item.url = tag.image;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ -(void) showInViewController:(UIViewController *)viewController

} completion:^(BOOL finished) {


}];

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ -(void) buildUI
label.font = LK_FONT(13);
label.textColor = LC_RGB(84, 79, 73);
label.text = LC_LO(@"绑定账号后可以使用它们登录like,如遇问题请发送邮件至[email protected]");
label.textAlignment = UITextAlignmentCenter;
label.FIT();
label.viewCenterX = self.view.viewMidWidth;
self.view.ADD(label);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,15 @@ -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
// 清除缓存
else if (indexPath.row == 3) {

[LCUIImageCache.singleton deleteAllImages];
[self.tableView reloadData];
[LCUIAlertView showWithTitle:LC_LO(@"提醒") message:LC_LO(@"确定要清除缓存吗?") cancelTitle:LC_LO(@"取消") otherTitle:LC_LO(@"确定") didTouchedBlock:^(NSInteger integerValue) {

if (integerValue == 1) {

[LCUIImageCache.singleton deleteAllImages];
[self.tableView reloadData];
}

}];
}
// 评价
else if (indexPath.row == 4){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ - (CGFloat)interpolateFromValue:(CGFloat)fromValue toValue:(CGFloat)toValue with
- (void)setProgress:(CGFloat)progress
{
_progress = fmin(progress, 1.0);

if((self.behaviorDefiner && !self.behaviorDefiner.isElasticMaximumHeightAtTop) || !self.behaviorDefiner)
{
_progress = fmax(_progress, 0.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
}

- (void)initialize {


self.userInteractionEnabled = YES;

_timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

[self.layer addSublayer:self.progressLayer];
Expand Down

0 comments on commit 6b781fc

Please sign in to comment.