From 923306f25e05be3dfc3995664d89b414ea0be762 Mon Sep 17 00:00:00 2001 From: nvtu Date: Thu, 10 Aug 2017 16:44:09 +0700 Subject: [PATCH] add UI for SNS screen --- LifeLog/LifeLog.xcodeproj/project.pbxproj | 16 +++ LifeLog/LifeLog/AppDelegate.m | 3 +- LifeLog/LifeLog/AutoTransButton.h | 15 +++ LifeLog/LifeLog/AutoTransButton.m | 20 ++++ LifeLog/LifeLog/HistoryViewController.h | 1 - LifeLog/LifeLog/HistoryViewController.m | 1 - LifeLog/LifeLog/HistoryViewController.xib | 6 +- LifeLog/LifeLog/Localizable.strings | Bin 4009 -> 4229 bytes LifeLog/LifeLog/RankingViewController.h | 2 - LifeLog/LifeLog/RankingViewController.m | 1 - LifeLog/LifeLog/RankingViewController.xib | 10 +- LifeLog/LifeLog/SNSRecentTopicTableViewCell.h | 21 ++++ LifeLog/LifeLog/SNSRecentTopicTableViewCell.m | 24 ++++ LifeLog/LifeLog/SNSRecentTopicTableViewCell.xib | 141 ++++++++++++++++++++++++ LifeLog/LifeLog/SNSViewController.h | 2 + LifeLog/LifeLog/SNSViewController.m | 30 +++++ LifeLog/LifeLog/SNSViewController.xib | 133 +++++++++++++++++++++- 17 files changed, 411 insertions(+), 15 deletions(-) create mode 100644 LifeLog/LifeLog/AutoTransButton.h create mode 100644 LifeLog/LifeLog/AutoTransButton.m create mode 100644 LifeLog/LifeLog/SNSRecentTopicTableViewCell.h create mode 100644 LifeLog/LifeLog/SNSRecentTopicTableViewCell.m create mode 100644 LifeLog/LifeLog/SNSRecentTopicTableViewCell.xib diff --git a/LifeLog/LifeLog.xcodeproj/project.pbxproj b/LifeLog/LifeLog.xcodeproj/project.pbxproj index 49fa243..b111bf4 100644 --- a/LifeLog/LifeLog.xcodeproj/project.pbxproj +++ b/LifeLog/LifeLog.xcodeproj/project.pbxproj @@ -49,6 +49,9 @@ E9373E4D1F361A230059355A /* HistoryGraphObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E9373E4C1F361A230059355A /* HistoryGraphObject.m */; }; E9682E2E1F39675A00FE05A2 /* RankingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E9682E2C1F39675A00FE05A2 /* RankingTableViewCell.m */; }; E9682E2F1F39675A00FE05A2 /* RankingTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E9682E2D1F39675A00FE05A2 /* RankingTableViewCell.xib */; }; + E968550A1F3C444900317CEF /* AutoTransButton.m in Sources */ = {isa = PBXBuildFile; fileRef = E96855091F3C444900317CEF /* AutoTransButton.m */; }; + E96855111F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E968550F1F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.m */; }; + E96855121F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E96855101F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.xib */; }; E997E0261F3AB66500709FB1 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E997E0251F3AB66500709FB1 /* Social.framework */; }; E99E13AB1F336F3600C78787 /* CollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = E99E13AA1F336F3600C78787 /* CollectionView.m */; }; E99E13AD1F336F4500C78787 /* CollectionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E99E13AC1F336F4500C78787 /* CollectionView.xib */; }; @@ -152,6 +155,11 @@ E9682E2B1F39675A00FE05A2 /* RankingTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankingTableViewCell.h; sourceTree = ""; }; E9682E2C1F39675A00FE05A2 /* RankingTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankingTableViewCell.m; sourceTree = ""; }; E9682E2D1F39675A00FE05A2 /* RankingTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RankingTableViewCell.xib; sourceTree = ""; }; + E96855081F3C444900317CEF /* AutoTransButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoTransButton.h; sourceTree = ""; }; + E96855091F3C444900317CEF /* AutoTransButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoTransButton.m; sourceTree = ""; }; + E968550E1F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SNSRecentTopicTableViewCell.h; sourceTree = ""; }; + E968550F1F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SNSRecentTopicTableViewCell.m; sourceTree = ""; }; + E96855101F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SNSRecentTopicTableViewCell.xib; sourceTree = ""; }; E997E0251F3AB66500709FB1 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; E99E13A91F336F3600C78787 /* CollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionView.h; sourceTree = ""; }; E99E13AA1F336F3600C78787 /* CollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CollectionView.m; sourceTree = ""; }; @@ -383,6 +391,9 @@ 6E84E3BC1F27A9B1001EB88E /* SNSViewController.h */, 6E84E3BD1F27A9B1001EB88E /* SNSViewController.m */, 6E84E3BE1F27A9B1001EB88E /* SNSViewController.xib */, + E968550E1F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.h */, + E968550F1F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.m */, + E96855101F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.xib */, ); name = SNS; sourceTree = ""; @@ -481,6 +492,8 @@ children = ( E9373E451F3596940059355A /* AutoTransLabel.h */, E9373E461F3596940059355A /* AutoTransLabel.m */, + E96855081F3C444900317CEF /* AutoTransButton.h */, + E96855091F3C444900317CEF /* AutoTransButton.m */, ); name = AutoTranslateView; sourceTree = ""; @@ -631,6 +644,7 @@ 6EF1630A1F29069300DA306C /* Localizable.strings in Resources */, 6E84E3B11F27A975001EB88E /* HomeViewController.xib in Resources */, 6E84E3B61F27A98B001EB88E /* HistoryViewController.xib in Resources */, + E96855121F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.xib in Resources */, E99E13B21F33720600C78787 /* LabelCollectionViewCell.xib in Resources */, E9F73DCD1F338A0F004A3A6F /* HistoryListTableViewCell.xib in Resources */, ); @@ -708,6 +722,7 @@ 6E18CED81F2E3C840029891F /* ServerAPI.m in Sources */, 6E7F93431F35872B00EFBC71 /* TPKeyboardAvoidingScrollView.m in Sources */, 6E7F93421F35872B00EFBC71 /* TPKeyboardAvoidingCollectionView.m in Sources */, + E968550A1F3C444900317CEF /* AutoTransButton.m in Sources */, 9CBDA0FA1F2ECE2C0055DED1 /* BaseViewController.m in Sources */, 6E8DA0F71F2BAC3400CCE941 /* TodayViewController.m in Sources */, 6E7F93451F35872B00EFBC71 /* UIScrollView+TPKeyboardAvoidingAdditions.m in Sources */, @@ -726,6 +741,7 @@ 9CA8AEEA1F31BB4600C5FC74 /* ConfirmForgetPassViewController.m in Sources */, E99E13B11F33720600C78787 /* LabelCollectionViewCell.m in Sources */, 6EDC8BEE1F2C2FB800765ACC /* Utilities.m in Sources */, + E96855111F3C5D9A00317CEF /* SNSRecentTopicTableViewCell.m in Sources */, 6E84E3C51F27ACAE001EB88E /* MapViewController.m in Sources */, 6E18CEDC1F2E40F50029891F /* User.m in Sources */, 6ECC40711F2A5FEB00AAEB97 /* NSDate+helper.m in Sources */, diff --git a/LifeLog/LifeLog/AppDelegate.m b/LifeLog/LifeLog/AppDelegate.m index 2acab68..79ccea1 100644 --- a/LifeLog/LifeLog/AppDelegate.m +++ b/LifeLog/LifeLog/AppDelegate.m @@ -97,7 +97,8 @@ SNSViewController *snsVC = [[SNSViewController alloc] initWithNibName:@"SNSViewController" bundle:nil]; UINavigationController *naviSNS = [[UINavigationController alloc] initWithRootViewController:snsVC]; naviSNS.tabBarItem = [[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"lifelog.tapbar.sns", @"") image:[UIImage imageNamed:@"tapbar_sns"] tag:5]; - + naviSNS.navigationBar.hidden = YES; + tabBarViewController.viewControllers = [NSArray arrayWithObjects:naviToday, naviHistory, naviRanking, naviMap, naviSNS, nil]; self.window.rootViewController = tabBarViewController; diff --git a/LifeLog/LifeLog/AutoTransButton.h b/LifeLog/LifeLog/AutoTransButton.h new file mode 100644 index 0000000..9622285 --- /dev/null +++ b/LifeLog/LifeLog/AutoTransButton.h @@ -0,0 +1,15 @@ +// +// AutoTransButton.h +// LifeLog +// +// Created by nvtu on 8/10/17. +// Copyright © 2017 PhongNV. All rights reserved. +// + +#import + +@interface AutoTransButton : UIButton + +@property (nonatomic) IBInspectable NSString *localizeKey; + +@end diff --git a/LifeLog/LifeLog/AutoTransButton.m b/LifeLog/LifeLog/AutoTransButton.m new file mode 100644 index 0000000..5d44ae6 --- /dev/null +++ b/LifeLog/LifeLog/AutoTransButton.m @@ -0,0 +1,20 @@ +// +// AutoTransButton.m +// LifeLog +// +// Created by nvtu on 8/10/17. +// Copyright © 2017 PhongNV. All rights reserved. +// + +#import "AutoTransButton.h" + +@implementation AutoTransButton + +-(void) awakeFromNib { + [super awakeFromNib]; + if(![self.localizeKey isEqual: @""] && self.titleLabel != NULL) { + self.titleLabel.text = NSLocalizedString(self.localizeKey, nil); + } +} + +@end diff --git a/LifeLog/LifeLog/HistoryViewController.h b/LifeLog/LifeLog/HistoryViewController.h index 8221ff4..a099807 100644 --- a/LifeLog/LifeLog/HistoryViewController.h +++ b/LifeLog/LifeLog/HistoryViewController.h @@ -22,7 +22,6 @@ int _curPageIndex; } -@property (weak, nonatomic) IBOutlet UILabel *lblHeader; @property (weak, nonatomic) IBOutlet UILabel *lblCircleStep; @property (weak, nonatomic) IBOutlet UILabel *lblCircleRemain; diff --git a/LifeLog/LifeLog/HistoryViewController.m b/LifeLog/LifeLog/HistoryViewController.m index edd960f..4e46fdd 100644 --- a/LifeLog/LifeLog/HistoryViewController.m +++ b/LifeLog/LifeLog/HistoryViewController.m @@ -22,7 +22,6 @@ [super viewDidLoad]; // Do any additional setup after loading the view from its nib. self.title = NSLocalizedString(@"lifelog.history.title", nil); - self.lblHeader.text = NSLocalizedString(@"lifelog.history.title", nil); [self setupView]; [self setupChartView]; diff --git a/LifeLog/LifeLog/HistoryViewController.xib b/LifeLog/LifeLog/HistoryViewController.xib index 960f1b5..55a716b 100644 --- a/LifeLog/LifeLog/HistoryViewController.xib +++ b/LifeLog/LifeLog/HistoryViewController.xib @@ -15,7 +15,6 @@ - @@ -37,11 +36,14 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.8.5.3