Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
64 changes: 60 additions & 4 deletions newsPicks.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>1D770B83-773D-40DC-B6EB-8B677E8AF950</string>
<string>C042A238-AAF2-4F84-AB2A-69911559926F</string>
<key>IDESourceControlProjectName</key>
<string>newsPicks</string>
<key>IDESourceControlProjectOriginsDictionary</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26942272197BFE9E00515F9E"
BuildableName = "newsPicks.app"
BlueprintName = "newsPicks"
ReferencedContainer = "container:newsPicks.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2694228D197BFE9E00515F9E"
BuildableName = "newsPicksTests.xctest"
BlueprintName = "newsPicksTests"
ReferencedContainer = "container:newsPicks.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26942272197BFE9E00515F9E"
BuildableName = "newsPicks.app"
BlueprintName = "newsPicks"
ReferencedContainer = "container:newsPicks.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26942272197BFE9E00515F9E"
BuildableName = "newsPicks.app"
BlueprintName = "newsPicks"
ReferencedContainer = "container:newsPicks.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26942272197BFE9E00515F9E"
BuildableName = "newsPicks.app"
BlueprintName = "newsPicks"
ReferencedContainer = "container:newsPicks.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>newsPicks.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>26942272197BFE9E00515F9E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>2694228D197BFE9E00515F9E</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
Binary file modified newsPicks/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions newsPicks/cell/NPFollowCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@
@property(nonatomic,assign)id<NPFollowCellDelegate>delegate;
-(void)restSubView:(NPUserDetaiInfolModel *)infoModel;
+(float)cellHight;
- (id)initWithStyle2:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier;

@end
52 changes: 49 additions & 3 deletions newsPicks/cell/NPFollowCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,67 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
}
return self;
}
- (id)initWithStyle2:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self initSub2];
// Initialization code
}
return self;
}
-(void)initSub
{
BOOL isIPhone = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone;
headView=[[UIImageView alloc]init];
headView.frame=CGRectMake(5, 5, 60, 60);
[self.contentView addSubview:headView];

name=[[UILabel alloc] init];
name.frame=CGRectMake(headView.frame.size.width+headView.frame.origin.x+5, headView.frame.origin.y, (isIPhone?320:270)-headView.frame.origin.x-headView.frame.origin.y-10, 20);
name.font=[UIFont boldSystemFontOfSize:17];
name.textColor=[UIColor blackColor];
name.backgroundColor=[UIColor clearColor];
[self.contentView addSubview:name];
followBtn=[NPUserFollowingButton buttonWithType:UIButtonTypeCustom];
followBtn.titleLabel.font=[UIFont systemFontOfSize:13];
followBtn.frame=CGRectMake((isIPhone?320:270)-75, 0, 70, 30);
[followBtn addTarget:self action:@selector(clickFollow:) forControlEvents:UIControlEventTouchUpInside];
followBtn.center=CGPointMake(followBtn.center.x, headView.center.y);
[self.contentView addSubview:followBtn];

typeContent=[[UILabel alloc] init];
typeContent.frame=CGRectMake(name.frame.origin.x, 0, followBtn.frame.origin.x-name.frame.origin.x-5, 15);
typeContent.font=[UIFont systemFontOfSize:14];
typeContent.textColor=[UIColor blackColor];
typeContent.backgroundColor=[UIColor clearColor];
typeContent.center=CGPointMake(typeContent.center.x, headView.center.y+4);
[self.contentView addSubview:typeContent];

likeNum=[[UILabel alloc]init];
likeNum.frame=CGRectMake(typeContent.frame.origin.x, headView.frame.origin.y+headView.frame.size.height-typeContent.frame.size.height, name.frame.size.width, typeContent.frame.size.height);
likeNum.backgroundColor=[UIColor clearColor];
likeNum.font=typeContent.font;
likeNum.textColor=typeContent.textColor;
[self.contentView addSubview:likeNum];
}
-(void)initSub2
{
BOOL isIPhone = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone;

headView=[[UIImageView alloc]init];
headView.frame=CGRectMake(5, 5, 60, 60);
[self.contentView addSubview:headView];

name=[[UILabel alloc] init];
name.frame=CGRectMake(headView.frame.size.width+headView.frame.origin.x+5, headView.frame.origin.y, [UIScreen mainScreen].bounds.size.width-headView.frame.origin.x-headView.frame.origin.y-10, 20);
name.frame=CGRectMake(headView.frame.size.width+headView.frame.origin.x+5, headView.frame.origin.y, 500-headView.frame.origin.x-headView.frame.origin.y-10, 20);
name.font=[UIFont boldSystemFontOfSize:17];
name.textColor=[UIColor blackColor];
name.backgroundColor=[UIColor clearColor];
[self.contentView addSubview:name];
followBtn=[NPUserFollowingButton buttonWithType:UIButtonTypeCustom];
followBtn.titleLabel.font=[UIFont systemFontOfSize:13];
followBtn.frame=CGRectMake([UIScreen mainScreen].bounds.size.width-75, 0, 70, 30);
followBtn.frame=CGRectMake(500-75, 0, 70, 30);
[followBtn addTarget:self action:@selector(clickFollow:) forControlEvents:UIControlEventTouchUpInside];
followBtn.center=CGPointMake(followBtn.center.x, headView.center.y);
[self.contentView addSubview:followBtn];
Expand Down Expand Up @@ -85,7 +131,7 @@ -(void)changeFollowStatus:(BOOL)follow
{
followBtn.layer.borderColor=[[UIColor clearColor]CGColor];
followBtn.layer.borderWidth=0;
[followBtn setTitle:@"following" forState:UIControlStateNormal];
[followBtn setTitle:@"unfollow" forState:UIControlStateNormal];
[followBtn setBackgroundImage:[NPCustomMethod createImageWithColor:[UIColor colorWithRed:62.0f/255.0f green:69.0f/255.0f blue:113.0f/255.0f alpha:1] size:followBtn.frame.size] forState:UIControlStateNormal];

}
Expand Down
16 changes: 16 additions & 0 deletions newsPicks/cell/NPThemeOfInterestCellTableViewCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// NPThemeOfInterestCellTableViewCell.h
// newsPicks
//
// Created by kangxv on 14-8-16.
// Copyright (c) 2014年 kangxv. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NPThemeOfInterestCellTableViewCell : UITableViewCell

@property (retain, nonatomic) UILabel *conte_text;

- (void)selected_cell:(BOOL )isSelect;
@end
64 changes: 64 additions & 0 deletions newsPicks/cell/NPThemeOfInterestCellTableViewCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// NPThemeOfInterestCellTableViewCell.m
// newsPicks
//
// Created by kangxv on 14-8-16.
// Copyright (c) 2014年 kangxv. All rights reserved.
//

#import "NPThemeOfInterestCellTableViewCell.h"

@implementation NPThemeOfInterestCellTableViewCell
{
UIImageView *select_tag;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
[self creatContentView];
}
return self;
}

- (void)awakeFromNib
{
// Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

- (void)creatContentView
{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10.0f, 5.0f, 10.0f, self.frame.size.height-10.0f)];
label.backgroundColor = [UIColor colorWithRed:arc4random()%100*0.01 green:0 blue:0 alpha:1];
self.conte_text = [[UILabel alloc] initWithFrame:CGRectMake(30.09f, 5.0f, 100.0f, self.frame.size.height - 10.0f)];
self.conte_text.textColor = [UIColor blackColor];
[self.contentView addSubview:label];
[self.contentView addSubview:self.conte_text];

select_tag = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width-30.0f, 5.0f, 20.0f, 20.0f)];
[self.contentView addSubview:select_tag];
}

- (void)selected_cell:(BOOL )isSelect
{
if(isSelect)
{
select_tag.image = [UIImage imageNamed:@"success-black.png"];
self.conte_text.textColor = [UIColor blackColor];
}else
{
select_tag.image = [UIImage imageNamed:@"registerPhoto_1"];
self.conte_text.textColor = [UIColor darkGrayColor];
}
}

@end
19 changes: 15 additions & 4 deletions newsPicks/cell/NPTimeOnlineCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ -(void)restCell:(NPListModel *)model


UILabel *contentLable=[[UILabel alloc]init];
contentLable.frame=CGRectMake(NPTimeOnlineCell_content_LeftPlace, contLableTop, contentView.frame.size.width-contentImageView.frame.size.width-NPTimeOnlineCell_content_LeftPlace*2, NPTimeOnlineCell_content_imagHight-2*contLableTop);
contentLable.frame=CGRectMake(NPTimeOnlineCell_content_LeftPlace, contLableTop, contentView.frame.size.width-contentImageView.frame.size.width-NPTimeOnlineCell_content_LeftPlace*2, NPTimeOnlineCell_content_imagHight);
contentLable.numberOfLines=3;
contentLable.textAlignment=NSTextAlignmentLeft;
contentLable.font=[UIFont boldSystemFontOfSize:13];
Expand All @@ -56,15 +56,26 @@ -(void)restCell:(NPListModel *)model
}else
{
UILabel *contentLable=[[UILabel alloc]init];
contentLable.frame=CGRectMake(NPTimeOnlineCell_content_LeftPlace, contLableTop, contentView.frame.size.width-NPTimeOnlineCell_content_LeftPlace*2, NPTimeOnlineCell_content_imagHight-2*contLableTop);
contentLable.frame=CGRectMake(NPTimeOnlineCell_content_LeftPlace, contLableTop, contentView.frame.size.width-NPTimeOnlineCell_content_LeftPlace*2, NPTimeOnlineCell_content_imagHight);
contentLable.numberOfLines=3;
contentLable.textAlignment=NSTextAlignmentLeft;
contentLable.font=[UIFont boldSystemFontOfSize:13];
contentLable.backgroundColor=[UIColor clearColor];
contentLable.textColor=[UIColor blackColor];
contentLable.text=model.title;
[contentView addSubview:contentLable];

}

UILabel *userNameLabel = [[UILabel alloc] init];
userNameLabel.frame = CGRectMake(NPTimeOnlineCell_content_LeftPlace, NPTimeOnlineCell_content_imagHight-2, contentView.frame.size.width-NPTimeOnlineCell_content_LeftPlace*2, 10);
userNameLabel.font = [UIFont systemFontOfSize:10];
userNameLabel.backgroundColor = [UIColor clearColor];
userNameLabel.textColor = [UIColor lightGrayColor];
userNameLabel.textAlignment = NSTextAlignmentLeft;
userNameLabel.text = model.loginname;
[contentView addSubview:userNameLabel];

UILabel *contLableSubTitle=[[UILabel alloc]init];
contLableSubTitle.font=[UIFont systemFontOfSize:10];
contLableSubTitle.frame=CGRectMake(NPTimeOnlineCell_content_LeftPlace, NPTimeOnlineCell_content_imagHight, contentView.frame.size.width-NPTimeOnlineCell_content_imagWidth-NPTimeOnlineCell_content_LeftPlace*2, NPTimeOnlineCell_content_timeHigth);
Expand Down Expand Up @@ -139,7 +150,7 @@ -(void)restCell:(NPListModel *)model
UIImageView *contentFollowView=[[UIImageView alloc]init];
contentFollowView.frame=CGRectMake(NPTimeOnlineCell_content_LeftPlace, contentTime.frame.size.height+contentTime.frame.origin.y+NPTimeOnlineCell_content_time_replayImg, NPTimeOnlineCell_content_replyImg_higth-15, NPTimeOnlineCell_content_replyImg_higth-15);
contentFollowView.contentMode=UIViewContentModeScaleAspectFill;
[contentFollowView setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:NP_IMG_TIME_ONLINE_DEFAULT]];
[contentFollowView setImageWithURL:[NSURL URLWithString:model.userimage] placeholderImage:[UIImage imageNamed:NP_IMG_TIME_ONLINE_DEFAULT]];
[contentView addSubview:contentFollowView];
contentView.frame=CGRectMake(contentView.frame.origin.x, contentView.frame.origin.y, contentView.frame.size.width, contentFollowView.frame.size.height+contentFollowView.frame.origin.y+NPTimeOnlineCell_buttomPlace);
}
Expand All @@ -161,7 +172,7 @@ -(void)restPopularUsers:(NPlistPopularUsers *)popularUsers
NPPopularUserView *popularView=[[NPPopularUserView alloc]init];
popularView.frame=CGRectMake(x, NPTimeOnlineCell_leftPlace, NPTimeOnlineCell_PopularUser_Higth-2*NPTimeOnlineCell_leftPlace, NPTimeOnlineCell_PopularUser_Higth-2*NPTimeOnlineCell_leftPlace);
[popularView setImageWithURL:[NSURL URLWithString:user.headImageUrl] placeholderImage:[UIImage imageNamed:NP_IMG_TIME_ONLINE_DEFAULT]];
popularView.leveImageView.image=[UIImage imageNamed:NP_IMG_TIME_ONLINE_DEFAULT];
// popularView.leveImageView.image=[UIImage imageNamed:NP_IMG_TIME_ONLINE_DEFAULT];
[contentView addSubview:popularView];
x=popularView.frame.size.width+popularView.frame.origin.x+NPTimeOnlineCell_leftPlace;

Expand Down
15 changes: 15 additions & 0 deletions newsPicks/cell/NPTimeOnlineCell_iPad.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@
@property (weak, nonatomic) IBOutlet UIButton *pickBtn5;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel5;
@property (weak, nonatomic) IBOutlet UIView *mContentView;
@property (weak, nonatomic) IBOutlet UILabel *title0;
@property (weak, nonatomic) IBOutlet UIView *avatarview0;
@property (weak, nonatomic) IBOutlet UILabel *title1;
@property (weak, nonatomic) IBOutlet UIView *avatarview1;
@property (weak, nonatomic) IBOutlet UILabel *title2;
@property (weak, nonatomic) IBOutlet UIView *avatarview2;
@property (weak, nonatomic) IBOutlet UILabel *title3;
@property (weak, nonatomic) IBOutlet UIView *avatarview3;
@property (weak, nonatomic) IBOutlet UILabel *title4;
@property (weak, nonatomic) IBOutlet UIView *avatarview4;
@property (weak, nonatomic) IBOutlet UILabel *time0;
@property (weak, nonatomic) IBOutlet UILabel *time1;
@property (weak, nonatomic) IBOutlet UILabel *time2;
@property (weak, nonatomic) IBOutlet UILabel *time3;
@property (weak, nonatomic) IBOutlet UILabel *time4;

@property (assign, nonatomic) IBOutlet id<NPTimeOnlineCellDelegate_iPad> delegate;
@property (strong,nonatomic)NSArray *modelArray;
Expand Down
Loading