From 81130ca7e4577efe33ebd9201b1dde120ecc87d6 Mon Sep 17 00:00:00 2001 From: GuoLiCheng Date: Thu, 6 Aug 2015 17:46:59 +0800 Subject: [PATCH] no message --- LIKE/LIKE/AppDelegate.m | 50 ++++--- LIKE/LIKE/Info.plist | 2 +- .../da.lproj/Localizable.strings | 4 +- .../de.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../en.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../es.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../fr.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../it.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../ja.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../pt-PT.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../pt.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../ru.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../tr.lproj/Localizable.strings | Bin 10268 -> 10330 bytes .../zh-Hans.lproj/Localizable.strings | Bin 7668 -> 7742 bytes .../zh-Hant.lproj/Localizable.strings | Bin 7668 -> 7742 bytes .../UIKit/Extension/UIView+LCExtension.m | 6 + LIKE/LIKE/LCFramework/UIKit/LCUIImageView.m | 8 +- .../Camera/LKCameraRollViewController.m | 2 +- .../Camera/LKNewPostViewController.m | 2 +- .../Application/Home/LKHomeViewController.m | 38 ++++- .../Home/LKPostDetailViewController.m | 77 ++++++---- .../Home/LKTagCommentsViewController.m | 33 ++++- .../Application/Home/Views/LKHomeHeader.m | 27 ++-- .../Home/Views/LKHomeTableViewCell.m | 4 +- .../Application/Home/Views/LKPostDetailCell.m | 2 +- .../Application/Home/Views/LKShareTools.h | 2 + .../Application/Home/Views/LKTagsView.m | 11 +- .../Application/Home/Views/LKUploadingCell.m | 1 + .../Application/Login/LKLoginViewController.m | 25 ++-- .../Search/LKSearchViewController.m | 66 +++++---- .../Search/Views/LKHotTagsSegmentView.m | 3 +- .../Application/Search/Views/LKHotUserView.m | 1 + .../Search/Views/LKSearchPlaceholderView.h | 3 + .../Search/Views/LKSearchPlaceholderView.m | 136 ++++++++++++++---- .../Views/LKSearchResultCollectionViewCell.m | 3 +- .../UserCenter/LKUserCenterViewController.m | 5 +- .../Model/HTTPModel/LKUserCenterModel.h | 1 + .../Model/HTTPModel/LKUserCenterModel.m | 61 +++++++- .../LKExternal/INSSearchBar/INSSearchBar.m | 5 +- .../RDVTabBarController/RDVTabBarController.m | 7 + LIKE/LIKE/LKTabBarController.mm | 1 + LIKE/LIKE/LKUIKit/LKInputView.h | 2 +- LIKE/LIKE/LKUIKit/LKInputView.m | 2 +- 43 files changed, 426 insertions(+), 164 deletions(-) diff --git a/LIKE/LIKE/AppDelegate.m b/LIKE/LIKE/AppDelegate.m index 42497a9..8f01755 100755 --- a/LIKE/LIKE/AppDelegate.m +++ b/LIKE/LIKE/AppDelegate.m @@ -78,12 +78,6 @@ -(void) load:(NSDictionary *)launchOptions self.home = [LKHomeViewController viewController]; - self.tabBarController = [[LKTabBarController alloc] initWithViewControllers:@[LC_UINAVIGATION(self.home)]]; - - self.window.rootViewController = self.tabBarController; - - - if (IOS8_OR_LATER) { UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert) categories:nil]; @@ -108,27 +102,39 @@ -(void) load:(NSDictionary *)launchOptions } + self.tabBarController = [[LKTabBarController alloc] initWithViewControllers:@[LC_UINAVIGATION(self.home)]]; + + self.window.rootViewController = self.tabBarController; + + if (!LKLocalUser.singleton.isLogin) { - LCUIImageView * imageView = LCUIImageView.view; - imageView.image = [LKWelcome image]; - imageView.viewFrameWidth = LC_DEVICE_WIDTH; - imageView.viewFrameHeight = LC_DEVICE_HEIGHT + 20; - imageView.contentMode = UIViewContentModeScaleAspectFit; - [LC_KEYWINDOW addSubview:imageView]; - - [LCUIApplication presentViewController:LKLoginViewController.viewController]; + + LCUIImageView * imageView = LCUIImageView.view; + imageView.image = [LKWelcome image]; + imageView.viewFrameWidth = LC_DEVICE_WIDTH; + imageView.viewFrameHeight = LC_DEVICE_HEIGHT + 20; + imageView.contentMode = UIViewContentModeScaleAspectFit; + [LC_KEYWINDOW addSubview:imageView]; - [UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ - - imageView.transform = CGAffineTransformMakeScale(1.5, 1.5); - imageView.alpha = 0; - - } completion:^(BOOL finished) { - - [imageView removeFromSuperview]; + LKLoginViewController * login = LKLoginViewController.viewController; + [login view]; + + [self.tabBarController presentViewController:login animated:NO completion:^{ + [UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ + + imageView.transform = CGAffineTransformMakeScale(1.5, 1.5); + imageView.alpha = 0; + + } completion:^(BOOL finished) { + + [imageView removeFromSuperview]; + + }]; }]; + + } // // welcom... diff --git a/LIKE/LIKE/Info.plist b/LIKE/LIKE/Info.plist index 60a294e..bdf4622 100755 --- a/LIKE/LIKE/Info.plist +++ b/LIKE/LIKE/Info.plist @@ -74,7 +74,7 @@ CFBundleVersion - 1.1.0.4 + 1.1.0.7 FacebookAppID 368579790017819 FacebookDisplayName diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/da.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/da.lproj/Localizable.strings index db45c93..0d40447 100755 --- a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/da.lproj/Localizable.strings +++ b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/da.lproj/Localizable.strings @@ -117,8 +117,8 @@ "添加标签(最多12个字)" = "New tag (12-character limit)"; // LKSearchPlaceHolderView -"搜索" = "Related tags "; -"相关内容" = " "; +"搜索相关内容" = "Related tags \"%@\""; +"搜索相关用户" = "Related users \"%@\""; "最近搜索过的标签" = "Search history"; " 发现更多有趣内容" = " Search & Explore"; diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/de.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/de.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/en.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/en.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/es.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/es.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/fr.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/fr.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/it.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/it.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/ja.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/ja.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/pt-PT.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/pt-PT.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/pt.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/pt.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/ru.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/ru.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/tr.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/tr.lproj/Localizable.strings index fd0c854ab9ca3e6f7ad4c3bd363ed5ae09020028..b5ba7755a1c6f01f23b17f6a9d6e93b74e17e2e2 100755 GIT binary patch delta 86 zcmbOea4TR#js(Y#vf{wjz@5>Pb0kz0Vi=SdR2du?K(rErH3Jurlu1#l1u4=fHBSO6 ak`gavC}v1yC<2lSV1-Z(n^#K|@&f=qRTeA& delta 36 scmcZ=FehL`j>O~=2^D@N25SZ`1|^0cWyOK5fjcL!mloapNg{(E0OcYKjQ{`u diff --git a/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/zh-Hans.lproj/Localizable.strings b/LIKE/LIKE/LCFramework/Foundation/Resource/LCInternationalization.bundle/zh-Hans.lproj/Localizable.strings index 96c03539b25f13f89a11a36d9d4d5c240152a339..858e2e29057a49cdd6a74ea65c2bde50c0346522 100755 GIT binary patch delta 113 zcmexjz0YPtn_!Aeic;;5vf{wjz@5=b3Ka-03skA>Hq)$ delta 39 ncmdmI^Tm2Yo1oN>vf{wjz@5=b3Ka-03skA>Hq)$ delta 39 ncmdmI^Tm2Yo1oN>vf{wjz@5=b3 maxWidth ? maxWidth : self.userName.viewFrameWidth; self.userLikes.viewFrameX = self.userName.viewRightX + 5; - self.likesTip.viewFrameX = self.userLikes. viewRightX + 5; + + CGFloat width = [self.post.user.likes.description sizeWithFont:self.userLikes.font byWidth:1000].width; + + self.likesTip.viewFrameX = self.userLikes.viewFrameX + width + 5; self.postTime.text = [NSString stringWithFormat:@"%@ %@ %@", [LKTime dateNearByTimestamp:self.post.timestamp], self.post.place.length ? LC_LO(@"来自") : @"", self.post.place.length ? self.post.place : @""]; @@ -903,6 +902,15 @@ - (UITableViewCell *)tableView:(LCUITableView *)tableView cellForRowAtIndexPath: } self.userLikes.text = self.post.user.likes.description; + + [UIView animateWithDuration:0.25 animations:^{ + + CGFloat width = [self.post.user.likes.description sizeWithFont:self.userLikes.font byWidth:1000].width; + + self.likesTip.viewFrameX = self.userLikes.viewFrameX + width + 5; + }]; + + [self.shareTools hideTools]; }; cell.willRequest = ^(LKTagItem * item){ @@ -960,6 +968,7 @@ - (UITableViewCell *)tableView:(LCUITableView *)tableView cellForRowAtIndexPath: }; + [self.shareTools hideTools]; }; @@ -968,6 +977,8 @@ - (UITableViewCell *)tableView:(LCUITableView *)tableView cellForRowAtIndexPath: @normally(self); + [self.shareTools hideTools]; + [self _beginComment:tag]; }; @@ -977,6 +988,8 @@ - (UITableViewCell *)tableView:(LCUITableView *)tableView cellForRowAtIndexPath: @normally(self); + [self.shareTools hideTools]; + if(![LKLoginViewController needLoginOnViewController:self]){ [self.inputView resignFirstResponder]; @@ -1006,6 +1019,8 @@ - (UITableViewCell *)tableView:(LCUITableView *)tableView cellForRowAtIndexPath: @normally(self); + [self.shareTools hideTools]; + if(![LKLoginViewController needLoginOnViewController:self]){ [self.inputView resignFirstResponder]; @@ -1233,6 +1248,8 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [self.shareTools hideTools]; + if (indexPath.section == 0) { [LKUserCenterViewController pushUserCenterWithUser:self.post.user navigationController:self.navigationController]; diff --git a/LIKE/LIKE/LKApplication/Application/Home/LKTagCommentsViewController.m b/LIKE/LIKE/LKApplication/Application/Home/LKTagCommentsViewController.m index fda723d..88fc9fd 100644 --- a/LIKE/LIKE/LKApplication/Application/Home/LKTagCommentsViewController.m +++ b/LIKE/LIKE/LKApplication/Application/Home/LKTagCommentsViewController.m @@ -12,6 +12,7 @@ #import "LKTime.h" #import "LKInputView.h" #import "LKLocationManager.h" +#import "LCUIKeyBoard.h" @interface LKTagCommentsViewController () @@ -29,6 +30,8 @@ @interface LKTagCommentsViewController () -LC_PROPERTY(strong) LCUIBlurView * blur; +LC_PROPERTY(strong) UIView * blur; LC_PROPERTY(assign) UIViewController * inViewController; LC_PROPERTY(strong) LKSearchBar * searchBar; LC_PROPERTY(strong) UIScrollView * scrollView; @@ -99,34 +99,11 @@ -(void) buildUI // self.ADD(self.searchBar); - self.placeholderView = LKSearchPlaceholderView.view; - self.placeholderView.viewFrameWidth = self.viewFrameWidth; - self.placeholderView.viewFrameHeight = self.viewFrameHeight; - self.placeholderView.viewFrameY = 0; - self.placeholderView.alpha = 0; - self.ADD(self.placeholderView); - - @weakly(self); - - self.placeholderView.didTap = ^(){ - - @normally(self); - - [self.searchBar.searchField resignFirstResponder]; - }; - - self.placeholderView.didSelectRow = ^(NSString * tagString){ - - LKSearchResultsViewController * search = [[LKSearchResultsViewController alloc] initWithSearchString:tagString]; - - [LC_APPDELEGATE.home.navigationController pushViewController:search animated:YES]; - }; - - self.hotTags = LKHotTagsSegmentView.view; self.ADD(self.hotTags); - + @weakly(self); + self.hotTags.itemDidLoad = ^(NSArray * value){ @normally(self); @@ -150,6 +127,28 @@ -(void) buildUI [self.hotTags performSelector:@selector(loadHotTags) withObject:nil afterDelay:0]; + + + self.placeholderView = LKSearchPlaceholderView.view; + self.placeholderView.viewFrameWidth = self.viewFrameWidth; + self.placeholderView.viewFrameHeight = self.viewFrameHeight; + self.placeholderView.viewFrameY = 0; + self.placeholderView.alpha = 0; + self.ADD(self.placeholderView); + + self.placeholderView.didTap = ^(){ + + @normally(self); + + [self.searchBar.searchField resignFirstResponder]; + }; + + self.placeholderView.didSelectRow = ^(NSString * tagString){ + + LKSearchResultsViewController * search = [[LKSearchResultsViewController alloc] initWithSearchString:tagString]; + + [LC_APPDELEGATE.home.navigationController pushViewController:search animated:YES]; + }; } #pragma mark - @@ -315,7 +314,7 @@ -(void) searchPlaceHolderTags:(NSString *)searchString } - LKHttpRequestInterface * interface = [LKHttpRequestInterface interfaceType:[NSString stringWithFormat:@"tag/guess/%@" ,searchString.URLCODE()]].AUTO_SESSION(); + LKHttpRequestInterface * interface = [LKHttpRequestInterface interfaceType:[NSString stringWithFormat:@"search/topsearch/%@" ,searchString.URLCODE()]].AUTO_SESSION(); @weakly(self); @@ -325,7 +324,18 @@ -(void) searchPlaceHolderTags:(NSString *)searchString if (result.state == LKHttpRequestStateFinished) { - NSArray * array = result.json[@"data"]; + NSArray * array0 = result.json[@"data"][@"users"]; + + NSMutableArray * users = [NSMutableArray array]; + + for (NSDictionary * dic in array0) { + + [users addObject:[LKUser objectFromDictionary:dic]]; + } + + self.placeholderView.users = users; + + NSArray * array = result.json[@"data"][@"tags"]; NSMutableArray * tags = [NSMutableArray array]; diff --git a/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotTagsSegmentView.m b/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotTagsSegmentView.m index 5bc95a1..ec5e91b 100644 --- a/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotTagsSegmentView.m +++ b/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotTagsSegmentView.m @@ -25,7 +25,7 @@ -(instancetype) init self.itemArray = [NSMutableArray array]; - self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.8]; + self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:1]; self.alpha = 0; } @@ -76,6 +76,7 @@ -(void) setHotTags:(NSArray *)tags { self.scrollView = UIScrollView.view; self.scrollView.frame = self.bounds; + self.scrollView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:1]; self.scrollView.showsHorizontalScrollIndicator = NO; self.ADD(self.scrollView); diff --git a/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotUserView.m b/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotUserView.m index 1d3ef55..c27400c 100644 --- a/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotUserView.m +++ b/LIKE/LIKE/LKApplication/Application/Search/Views/LKHotUserView.m @@ -32,6 +32,7 @@ -(instancetype) initWithFrame:(CGRect)frame self.scrollView.backgroundColor = [UIColor whiteColor]; self.scrollView.cornerRadius = 2; self.ADD(self.scrollView); + } return self; diff --git a/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.h b/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.h index 384f06f..96fc9d3 100644 --- a/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.h +++ b/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.h @@ -8,6 +8,7 @@ #import +LC_BLOCK(void, LKSearchPlaceholderViewDidSelectRow, (NSString * tagString)); LC_BLOCK(void, LKSearchPlaceholderViewDidSelectRow, (NSString * tagString)); @interface LKSearchPlaceholderView : LCUITableView @@ -16,4 +17,6 @@ LC_PROPERTY(strong) NSArray * tags; LC_PROPERTY(copy) NSString * searchString; LC_PROPERTY(copy) LKSearchPlaceholderViewDidSelectRow didSelectRow; +LC_PROPERTY(strong) NSArray * users; + @end diff --git a/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.m b/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.m index 837be0a..69f8e4e 100644 --- a/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.m +++ b/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchPlaceholderView.m @@ -54,6 +54,8 @@ -(void) setTags:(NSArray *)tags if (tags == nil) { + self.users = nil; + NSArray * history = [LKSearchHistory history]; NSMutableArray * result = [NSMutableArray array]; @@ -82,6 +84,10 @@ -(void) setSearchString:(NSString *)searchString tags:(NSArray *)tags - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; { + if (self.users.count) { + return 4; + } + return 2; } @@ -92,20 +98,100 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger return 1; } - if (!self.tags) { + if (section == 1) { + + if (!self.tags) { + + return self.history.count; + } + + return self.tags.count; + } + + if (section == 2) { + return 1; + } + + if (section == 3) { - return self.history.count; + return self.users.count; } - return self.tags.count; + return 0; } - (UITableViewCell *)tableView:(LCUITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - LCUITableViewCell * cell = [tableView autoCreateDequeueReusableCellWithIdentifier:@"Content" andClass:[LCUITableViewCell class] configurationCell:^(LCUITableViewCell * configurationCell) { + + if (indexPath.section == 0 || indexPath.section == 1) { + + LCUITableViewCell * cell = [tableView autoCreateDequeueReusableCellWithIdentifier:@"Content" andClass:[LCUITableViewCell class] configurationCell:^(LCUITableViewCell * configurationCell) { + + LCUILabel * label = LCUILabel.view; + label.viewFrameX = 20; + label.viewFrameWidth = self.viewFrameWidth; + label.viewFrameHeight = 117. / 3.; + label.font = LK_FONT(13); + label.textColor = LC_RGB(79, 62, 56); + label.tag = 1000; + configurationCell.ADD(label); + + + UIView * line = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"TalkLine.png" useCache:YES]]; + line.viewFrameWidth = LC_DEVICE_WIDTH; + line.viewFrameY = 117. / 3. - line.viewFrameHeight - 0.5; + configurationCell.ADD(line); + + }]; + + LCUILabel * label = cell.FIND(1000); + + if (indexPath.section == 0) { + + if (self.tags == nil) { + + label.text = LC_LO(@"最近搜索过的标签"); + } + else{ + + label.text = [NSString stringWithFormat:LC_LO(@"搜索相关内容"), self.searchString]; + } + } + else{ + + LKTag * tag = nil ; + + if (self.tags == nil) { + + tag = self.history[indexPath.row]; + } + else{ + + tag = self.tags[indexPath.row]; + } + + label.text = tag.tag; + } + + return cell; + + } + + LCUITableViewCell * cell = [tableView autoCreateDequeueReusableCellWithIdentifier:@"User" andClass:[LCUITableViewCell class] configurationCell:^(LCUITableViewCell * configurationCell) { + + + LCUIImageView * head = LCUIImageView.view; + head.viewFrameWidth = 25; + head.viewFrameHeight = 25; + head.cornerRadius = 25 / 2; + head.viewFrameX = 20; + head.viewFrameY = 117 / 3 / 2 - 25 / 2; + head.tag = 1001; + configurationCell.ADD(head); + LCUILabel * label = LCUILabel.view; - label.viewFrameX = 20; + label.viewFrameX = head.viewRightX + 10; label.viewFrameWidth = self.viewFrameWidth; label.viewFrameHeight = 117. / 3.; label.font = LK_FONT(13); @@ -116,38 +202,30 @@ - (UITableViewCell *)tableView:(LCUITableView *)tableView cellForRowAtIndexPath: UIView * line = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"TalkLine.png" useCache:YES]]; line.viewFrameWidth = LC_DEVICE_WIDTH; - line.viewFrameY = 117. / 3. - line.viewFrameHeight; + line.viewFrameY = 117. / 3. - line.viewFrameHeight - 0.5; configurationCell.ADD(line); }]; + LCUIImageView * head = cell.FIND(1001); LCUILabel * label = cell.FIND(1000); - - if (indexPath.section == 0) { + + if (indexPath.section == 2) { - if (self.tags == nil) { - - label.text = LC_LO(@"最近搜索过的标签"); - } - else{ + head.alpha = 0; + label.viewFrameX = 20; - label.text = [NSString stringWithFormat:@"%@\"%@\"%@", LC_LO(@"搜索"), self.searchString, LC_LO(@"相关内容")]; - } + label.text = [NSString stringWithFormat:LC_LO(@"搜索相关用户"), self.searchString]; } else{ - - LKTag * tag = nil ; + + LKUser * user = self.users[indexPath.row]; - if (self.tags == nil) { - - tag = self.history[indexPath.row]; - } - else{ - - tag = self.tags[indexPath.row]; - } + head.url = user.avatar; + label.text = user.name; - label.text = tag.tag; + head.alpha = 1; + label.viewFrameX = head.viewRightX + 10; } return cell; @@ -179,6 +257,12 @@ -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath self.didSelectRow(tag.tag); } } + else if (indexPath.section == 3){ + + LKUser * user = self.users[indexPath.row]; + + self.SEND(@"PushUserCenter").object = user; + } } diff --git a/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchResultCollectionViewCell.m b/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchResultCollectionViewCell.m index 97b9655..87d43d8 100644 --- a/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchResultCollectionViewCell.m +++ b/LIKE/LIKE/LKApplication/Application/Search/Views/LKSearchResultCollectionViewCell.m @@ -84,6 +84,7 @@ -(instancetype) initWithFrame:(CGRect)frame self.backgroundColor = [UIColor whiteColor]; self.cornerRadius = 2; + self.layer.masksToBounds = YES; } return self; @@ -138,7 +139,7 @@ -(void) setPost:(LKPost *)post self.contentImage.url = post.content; - [LKSearchResultCollectionViewCell roundCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight forView:self.contentImage]; + //[LKSearchResultCollectionViewCell roundCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight forView:self.contentImage]; } -(void) handleHeadTap:(UITapGestureRecognizer *)tap diff --git a/LIKE/LIKE/LKApplication/Application/UserCenter/LKUserCenterViewController.m b/LIKE/LIKE/LKApplication/Application/UserCenter/LKUserCenterViewController.m index 3c6db4d..40757d3 100644 --- a/LIKE/LIKE/LKApplication/Application/UserCenter/LKUserCenterViewController.m +++ b/LIKE/LIKE/LKApplication/Application/UserCenter/LKUserCenterViewController.m @@ -482,6 +482,8 @@ -(void) setCurrentType:(LKUserCenterModelType)currentType { _currentType = currentType; + self.pullLoader.canLoadMore = [self.userCenterModel canLoadMoreWithType:currentType]; + [self loadData:currentType diretion:LCUIPullLoaderDiretionTop]; } @@ -504,6 +506,8 @@ -(void) loadData:(LKUserCenterModelType)type diretion:(LCUIPullLoaderDiretion)di [self showTopMessageErrorHud:error];; } + + self.pullLoader.canLoadMore = [self.userCenterModel canLoadMoreWithType:type]; }; } @@ -521,7 +525,6 @@ -(void) loadData:(LKUserCenterModelType)type diretion:(LCUIPullLoaderDiretion)di [postDetail setPresendModelAnimationOpen]; [self.navigationController presentViewController:nav animated:YES completion:nil]; - } #pragma mark - diff --git a/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.h b/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.h index 1f5fb75..7596874 100644 --- a/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.h +++ b/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.h @@ -29,5 +29,6 @@ LC_PROPERTY(copy) LKUserCenterModelRequestFinished requestFinished; -(NSMutableArray *) dataWithType:(LKUserCenterModelType)type; +-(BOOL) canLoadMoreWithType:(LKUserCenterModelType)type; @end diff --git a/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.m b/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.m index a0adf3e..69c3a62 100644 --- a/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.m +++ b/LIKE/LIKE/LKApplication/Model/HTTPModel/LKUserCenterModel.m @@ -15,6 +15,10 @@ @interface LKUserCenterModel () LC_PROPERTY(assign) NSInteger focusPage; LC_PROPERTY(assign) NSInteger fansPage; +LC_PROPERTY(assign) BOOL photoCanLoadMore; +LC_PROPERTY(assign) BOOL focusCanLoadMore; +LC_PROPERTY(assign) BOOL fansCanLoadMore; + @end @implementation LKUserCenterModel @@ -24,6 +28,19 @@ -(void) dealloc [self cancelAllRequests]; } +-(instancetype) init +{ + if (self = [super init]) { + + self.photoCanLoadMore = YES; + self.focusCanLoadMore = YES; + self.fansCanLoadMore = YES; + } + + return self; +} + + -(void) getDataAtFirstPage:(BOOL)isFirstPage type:(LKUserCenterModelType)type uid:(NSNumber *)uid { NSInteger page = 0; @@ -58,7 +75,7 @@ -(void) getDataAtFirstPage:(BOOL)isFirstPage type:(LKUserCenterModelType)type ui if (result.state == LKHttpRequestStateFinished) { [self handleResultWithType:type isFirstPage:isFirstPage result:result]; - + [self setPageWithType:type page:page]; if (self.requestFinished) { @@ -75,6 +92,32 @@ -(void) getDataAtFirstPage:(BOOL)isFirstPage type:(LKUserCenterModelType)type ui } +-(BOOL) canLoadMoreWithType:(LKUserCenterModelType)type +{ + switch (type) { + case LKUserCenterModelTypePhotos: + + return self.photoCanLoadMore; + + break; + case LKUserCenterModelTypeFocus: + + return self.focusCanLoadMore; + + break; + case LKUserCenterModelTypeFans: + + return self.fansCanLoadMore; + + break; + default: + + return YES; + + break; + } +} + -(void) handleResultWithType:(LKUserCenterModelType)type isFirstPage:(BOOL)isFirstPage result:(LKHttpRequestResult *)result { switch (type) { @@ -98,6 +141,12 @@ -(void) handleResultWithType:(LKUserCenterModelType)type isFirstPage:(BOOL)isFir [self.photoArray addObjectsFromArray:resultData]; } + + if (datasource.count < 21) { + + self.photoCanLoadMore = NO; + } + } break; case LKUserCenterModelTypeFocus: @@ -119,6 +168,11 @@ -(void) handleResultWithType:(LKUserCenterModelType)type isFirstPage:(BOOL)isFir [self.focusArray addObjectsFromArray:resultData]; } + + if (datasource.count < 20) { + + self.focusCanLoadMore = NO; + } } break; case LKUserCenterModelTypeFans: @@ -140,6 +194,11 @@ -(void) handleResultWithType:(LKUserCenterModelType)type isFirstPage:(BOOL)isFir [self.fansArray addObjectsFromArray:resultData]; } + + if (datasource.count < 20) { + + self.fansCanLoadMore = NO; + } } break; default: diff --git a/LIKE/LIKE/LKExternal/INSSearchBar/INSSearchBar.m b/LIKE/LIKE/LKExternal/INSSearchBar/INSSearchBar.m index bdad63c..b5c4b98 100755 --- a/LIKE/LIKE/LKExternal/INSSearchBar/INSSearchBar.m +++ b/LIKE/LIKE/LKExternal/INSSearchBar/INSSearchBar.m @@ -86,10 +86,7 @@ - (id)initWithFrame:(CGRect)frame self.searchFrame.backgroundColor = [UIColor clearColor]; self.searchFrame.opaque = NO; self.searchFrame.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - self.searchFrame.layer.masksToBounds = YES; - self.searchFrame.layer.cornerRadius = CGRectGetHeight(self.bounds) / 2; - self.searchFrame.layer.borderWidth = 0.5; - self.searchFrame.layer.borderColor = [UIColor clearColor].CGColor; + self.searchFrame.cornerRadius = CGRectGetHeight(self.bounds) / 2; self.searchFrame.contentMode = UIViewContentModeRedraw; [self addSubview:self.searchFrame]; diff --git a/LIKE/LIKE/LKExternal/RDVTabBarController/RDVTabBarController.m b/LIKE/LIKE/LKExternal/RDVTabBarController/RDVTabBarController.m index 7eee511..6b8c871 100755 --- a/LIKE/LIKE/LKExternal/RDVTabBarController/RDVTabBarController.m +++ b/LIKE/LIKE/LKExternal/RDVTabBarController/RDVTabBarController.m @@ -44,6 +44,7 @@ @implementation RDVTabBarController #pragma mark - View lifecycle - (void)viewDidLoad { + [super viewDidLoad]; [self.view addSubview:[self contentView]]; @@ -51,6 +52,7 @@ - (void)viewDidLoad { } - (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; [self setSelectedIndex:[self selectedIndex]]; @@ -58,6 +60,11 @@ - (void)viewWillAppear:(BOOL)animated { [self setTabBarHidden:self.isTabBarHidden animated:NO]; } +-(void) viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; +} + - (UIStatusBarStyle)preferredStatusBarStyle { return self.selectedViewController.preferredStatusBarStyle; } diff --git a/LIKE/LIKE/LKTabBarController.mm b/LIKE/LIKE/LKTabBarController.mm index c8aee65..0166451 100755 --- a/LIKE/LIKE/LKTabBarController.mm +++ b/LIKE/LIKE/LKTabBarController.mm @@ -47,6 +47,7 @@ -(void) viewWillAppear:(BOOL)animated tip.tag = 100; tip.translatesAutoresizingMaskIntoConstraints = NO; tip.alpha = 0; + tip.userInteractionEnabled = NO; [tip startAnimating]; self.assistiveTouchButton.ADD(tip); diff --git a/LIKE/LIKE/LKUIKit/LKInputView.h b/LIKE/LIKE/LKUIKit/LKInputView.h index 6bfe8a0..3f87aeb 100755 --- a/LIKE/LIKE/LKUIKit/LKInputView.h +++ b/LIKE/LIKE/LKUIKit/LKInputView.h @@ -13,7 +13,7 @@ LC_BLOCK(void, LKInputViewWillDismiss, (NSString * text)); LC_BLOCK(void, LKInputViewDidShow, ()); -@interface LKInputView : LCUIBlurView +@interface LKInputView : UIView LC_PROPERTY(copy) LKInputViewWillDismiss willDismiss; LC_PROPERTY(copy) LKInputViewSend sendAction; diff --git a/LIKE/LIKE/LKUIKit/LKInputView.m b/LIKE/LIKE/LKUIKit/LKInputView.m index 4ff97c6..7154c60 100755 --- a/LIKE/LIKE/LKUIKit/LKInputView.m +++ b/LIKE/LIKE/LKUIKit/LKInputView.m @@ -23,7 +23,7 @@ -(instancetype) init // self.ADD(view); - self.tintColor = [UIColor whiteColor]; + self.backgroundColor = [UIColor whiteColor]; self.viewFrameWidth = LC_DEVICE_WIDTH; self.viewFrameHeight = 44;