Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
BIN  ...hareClient_iOS.xcodeproj/project.xcworkspace/xcuserdata/hikui.xcuserdatad/UserInterfaceState.xcuserstate
View
Binary file not shown
43 ...reClient_iOS/PicShareClient_iOS.xcodeproj/xcuserdata/hikui.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
View
@@ -112,11 +112,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "PicShareClient_iOS/UserDetailViewController.m"
- timestampString = "355228502.165397"
+ timestampString = "356453491.799156"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "125"
- endingLineNumber = "125"
+ startingLineNumber = "132"
+ endingLineNumber = "132"
landmarkName = "-updateView"
landmarkType = "5">
</FileBreakpoint>
@@ -294,11 +294,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "PicShareClient_iOS/UserDetailViewController.m"
- timestampString = "355228502.165397"
+ timestampString = "356453491.799156"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "225"
- endingLineNumber = "225"
+ startingLineNumber = "232"
+ endingLineNumber = "232"
landmarkName = "-loadData"
landmarkType = "5">
</FileBreakpoint>
@@ -307,11 +307,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "PicShareClient_iOS/UserDetailViewController.m"
- timestampString = "355228502.165397"
+ timestampString = "356453491.799156"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "226"
- endingLineNumber = "226"
+ startingLineNumber = "233"
+ endingLineNumber = "233"
landmarkName = "-loadData"
landmarkType = "5">
</FileBreakpoint>
@@ -437,11 +437,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "PicShareClient_iOS/UsersListViewController.m"
- timestampString = "355232625.191591"
+ timestampString = "356452748.166865"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "131"
- endingLineNumber = "131"
+ startingLineNumber = "138"
+ endingLineNumber = "138"
landmarkName = "-tableView:cellForRowAtIndexPath:"
landmarkType = "5">
</FileBreakpoint>
@@ -450,11 +450,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "PicShareClient_iOS/UsersListViewController.m"
- timestampString = "355232553.993348"
+ timestampString = "356452748.166865"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "129"
- endingLineNumber = "129"
+ startingLineNumber = "136"
+ endingLineNumber = "136"
landmarkName = "-tableView:cellForRowAtIndexPath:"
landmarkType = "5">
</FileBreakpoint>
@@ -510,5 +510,18 @@
landmarkName = "-repin:toBoard:withDescription:"
landmarkType = "5">
</FileBreakpoint>
+ <FileBreakpoint
+ shouldBeEnabled = "No"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "PicShareClient_iOS/UserDetailViewController.m"
+ timestampString = "356453292.166389"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "118"
+ endingLineNumber = "118"
+ landmarkName = "-updateView"
+ landmarkType = "5">
+ </FileBreakpoint>
</FileBreakpoints>
</Bucket>
2  PicShareClient_iOS/PicShareClient_iOS/Common.h
View
@@ -7,6 +7,8 @@
//
#import <Foundation/Foundation.h>
+#define IS_RETINA [[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] && ([UIScreen mainScreen].scale == 2.0)
+#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
@interface Common : NSObject
11 PicShareClient_iOS/PicShareClient_iOS/PicDetailView.m
View
@@ -12,7 +12,8 @@
#import "ASIHTTPRequest.h"
#import "ASIDownloadCache.h"
#import "UIImageView+Resize.h"
-#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
+#import "UIImageView+WebCache.h"
+#import "Common.h"
@interface PicDetailView()
@@ -112,7 +113,13 @@ -(void)layout
if (self.pictureStatus != nil) {
avatarImageView.frame = CGRectMake(10, 20, 30, 30);
- [avatarImageView setImageWithUrl:[NSURL URLWithString:pictureStatus.owner.avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
+ NSString *avatarUrl;
+ if (IS_RETINA) {
+ avatarUrl = [pictureStatus.owner.avatarUrl stringByAppendingString:@"?size=120"];
+ }else {
+ avatarUrl = [pictureStatus.owner.avatarUrl stringByAppendingString:@"?size=60"];
+ }
+ [avatarImageView setImageWithURL:[NSURL URLWithString:avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
10 PicShareClient_iOS/PicShareClient_iOS/TimelineCell.m
View
@@ -11,7 +11,7 @@
#import "UIImageView+Resize.h"
#import "ASIDownloadCache.h"
#import "PicShareEngine.h"
-#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
+#import "Common.h"
@interface TimelineCell ()
@@ -76,7 +76,13 @@ - (void)layout
{
if (self.pictureStatus != nil) {
avatarImageView.frame = CGRectMake(10, 20, 30, 30);
- [avatarImageView setImageWithURL:[NSURL URLWithString:pictureStatus.owner.avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
+ NSString *avatarUrl;
+ if (IS_RETINA) {
+ avatarUrl = [pictureStatus.owner.avatarUrl stringByAppendingString:@"?size=120"];
+ }else {
+ avatarUrl = [pictureStatus.owner.avatarUrl stringByAppendingString:@"?size=60"];
+ }
+ [avatarImageView setImageWithURL:[NSURL URLWithString:avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
CGSize nameButtonSize = [pictureStatus.owner.username sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(147, 18) lineBreakMode:UILineBreakModeTailTruncation];
CGRect nameButtonFrame = CGRectMake(48, 32, nameButtonSize.width, nameButtonSize.height);
15 PicShareClient_iOS/PicShareClient_iOS/UserDetailViewController.m
View
@@ -15,7 +15,8 @@
#import "Common.h"
#import "MBProgressHUD.h"
#import "UserInfoEditorViewController.h"
-#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
+#import "Common.h"
+
@interface UserDetailViewController ()
@@ -115,14 +116,20 @@ - (void)updateView
{
self.scrollView.contentSize = CGSizeMake(320, 360);
self.introductionText.backgroundColor = RGBA(220, 220, 220, 1);
- self.introductionText.text = [[[NSString alloc]initWithFormat:@"个人简介:\n",user.introduction]autorelease];
+ self.introductionText.text = [[[NSString alloc]initWithFormat:@"个人简介:\n%@",user.introduction]autorelease];
self.followerCountLabel.text = [NSString stringWithFormat:@"%d",user.followersCount];
self.followingCountLabel.text = [NSString stringWithFormat:@"%d",user.followingCount];
self.picCountLabel.text = [NSString stringWithFormat:@"%d",user.picturesCount];
self.nameLabel.text = user.username;
self.locationLabel.text = user.location;
- NSString *avatarUrl = user.avatarUrl;
- [self.avatarImageView setImageWithURL:[NSURL URLWithString:user.avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
+ NSString *avatarUrl;
+ if (IS_RETINA) {
+ avatarUrl = [user.avatarUrl stringByAppendingString:@"?size=240"];
+ }else {
+ avatarUrl = [user.avatarUrl stringByAppendingString:@"?size=120"];
+ }
+
+ [self.avatarImageView setImageWithURL:[NSURL URLWithString:avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
PicShareEngine *engine = [PicShareEngine sharedEngine];
if ([engine.username isEqualToString:user.username]) {
//the current user's profile
21 PicShareClient_iOS/PicShareClient_iOS/UserDetailViewController.xib
View
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
- <int key="IBDocument.SystemTarget">1280</int>
- <string key="IBDocument.SystemVersion">11A2061</string>
- <string key="IBDocument.InterfaceBuilderVersion">1938</string>
- <string key="IBDocument.AppKitVersion">1138.1</string>
- <string key="IBDocument.HIToolboxVersion">566.00</string>
+ <int key="IBDocument.SystemTarget">1296</int>
+ <string key="IBDocument.SystemVersion">11D50b</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.32</string>
+ <string key="IBDocument.HIToolboxVersion">568.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">933</string>
+ <string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUITextView</string>
@@ -40,7 +40,7 @@
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIButton" id="744848174">
<reference key="NSNextResponder" ref="191373211"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{51, 271}, {219, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
@@ -76,10 +76,11 @@
</object>
<object class="IBUIButton" id="550128599">
<reference key="NSNextResponder" ref="191373211"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{51, 271}, {219, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
@@ -948,7 +949,7 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
- <real value="1280" key="NS.object.0"/>
+ <real value="1296" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
@@ -956,6 +957,6 @@
<string key="anonymous.png">{90, 107}</string>
<string key="button.png">{60, 62}</string>
</dictionary>
- <string key="IBCocoaTouchPluginVersion">933</string>
+ <string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>
9 PicShareClient_iOS/PicShareClient_iOS/UsersListViewController.m
View
@@ -9,6 +9,7 @@
#import "UsersListViewController.h"
#import "PicShareEngine.h"
#import "UIImageView+WebCache.h"
+#import "Common.h"
@interface UsersListViewController ()
@@ -100,7 +101,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
User *u = [usersArray objectAtIndex:indexPath.row];
cell.textLabel.text = u.username;
cell.detailTextLabel.text = [[[NSString alloc]initWithFormat:@"来自 %@",u.location]autorelease];
- [cell.imageView setImageWithURL:[NSURL URLWithString:u.avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
+ NSString *avatarUrl;
+ if (IS_RETINA) {
+ avatarUrl = [u.avatarUrl stringByAppendingString:@"?size=120"];
+ }else {
+ avatarUrl = [u.avatarUrl stringByAppendingString:@"?size=60"];
+ }
+ [cell.imageView setImageWithURL:[NSURL URLWithString:avatarUrl] placeholderImage:[UIImage imageNamed:@"anonymous.png"]];
UIButton *followButton = [UIButton buttonWithType:UIButtonTypeCustom];
followButton.titleLabel.font = [UIFont boldSystemFontOfSize:14];
8 PicShareServer/api/UploadImage.py
View
@@ -9,10 +9,11 @@
PICTURE_DIR = 'picture'
AVATAR_DIR = 'avatar'
ORIGINAL_IMAGE_DIR = 'origin'
-IMAGE_60_DIR ='X60'
+IMAGE_60_DIR = 'X60'
IMAGE_100_DIR = 'X100'
IMAGE_120_DIR = 'X120'
IMAGE_160_DIR = 'X160'
+IMAGE_240_DIR = 'X240'
IMAGE_320_DIR = 'X320'
IMAGE_640_DIR = 'X640'
@@ -65,8 +66,9 @@ def handle_upload_image(i,imgType):
elif imgType == ImgType.AVATAR:
x60_image_path = os.path.join(settings.MEDIA_ROOT,AVATAR_DIR,IMAGE_60_DIR)
- x120_image_path = os.path.join(settings.MEDIA_ROOT,AVATAR_DIR,IMAGE_120_DIR)
- paths = {origin_image_path:None,x60_image_path:60,x120_image_path:120}
+ x120_image_path = os.path.join(settings.MEDIA_ROOT,AVATAR_DIR,IMAGE_120_DIR)
+ x240_image_path = os.path.join(settings.MEDIA_ROOT,AVATAR_DIR,IMAGE_240_DIR)
+ paths = {origin_image_path:None,x60_image_path:60,x120_image_path:120,x240_image_path:240}
for aPath,size in paths.items():
# do resize

No commit comments for this range

Something went wrong with that request. Please try again.