Permalink
Browse files

First commit

  • Loading branch information...
0 parents commit 9c6d6a25df5a83a4cb41b4c518d10eaf18780e84 @joehewitt joehewitt committed Jan 23, 2009
Showing with 7,450 additions and 0 deletions.
  1. +13 −0 LICENSE
  2. +4 −0 README.mdown
  3. +11 −0 samples/T3Catalog/Classes/ImageTableViewCell.h
  4. +35 −0 samples/T3Catalog/Classes/ImageTableViewCell.m
  5. +8 −0 samples/T3Catalog/Classes/ImageTest1Controller.h
  6. +21 −0 samples/T3Catalog/Classes/ImageTest1Controller.m
  7. +7 −0 samples/T3Catalog/Classes/ImageTest2Controller.h
  8. +85 −0 samples/T3Catalog/Classes/ImageTest2Controller.m
  9. +6 −0 samples/T3Catalog/Classes/PhotoTest1Controller.h
  10. +210 −0 samples/T3Catalog/Classes/PhotoTest1Controller.m
  11. +6 −0 samples/T3Catalog/Classes/PhotoTest2Controller.h
  12. +210 −0 samples/T3Catalog/Classes/PhotoTest2Controller.m
  13. +7 −0 samples/T3Catalog/Classes/RootViewController.h
  14. +81 −0 samples/T3Catalog/Classes/RootViewController.m
  15. +31 −0 samples/T3Catalog/Classes/SamplePhotoSource.h
  16. +145 −0 samples/T3Catalog/Classes/SamplePhotoSource.m
  17. +9 −0 samples/T3Catalog/Classes/ScrollViewTestController.h
  18. +52 −0 samples/T3Catalog/Classes/ScrollViewTestController.m
  19. +12 −0 samples/T3Catalog/Classes/T3CatalogAppDelegate.h
  20. +20 −0 samples/T3Catalog/Classes/T3CatalogAppDelegate.m
  21. +8 −0 samples/T3Catalog/Classes/TextTest1Controller.h
  22. +24 −0 samples/T3Catalog/Classes/TextTest1Controller.m
  23. +7 −0 samples/T3Catalog/Classes/YouTubeTestController.h
  24. +21 −0 samples/T3Catalog/Classes/YouTubeTestController.m
  25. BIN samples/T3Catalog/DefaultAlbum.png
  26. BIN samples/T3Catalog/Icon.png
  27. +30 −0 samples/T3Catalog/Info.plist
  28. +272 −0 samples/T3Catalog/MainWindow.xib
  29. +195 −0 samples/T3Catalog/RootViewController.xib
  30. +448 −0 samples/T3Catalog/T3Catalog.xcodeproj/project.pbxproj
  31. +9 −0 samples/T3Catalog/T3Catalog_Prefix.pch
  32. +9 −0 samples/T3Catalog/main.m
  33. +157 −0 src/T3ActivityLabel.m
  34. +100 −0 src/T3ErrorView.m
  35. +492 −0 src/T3Global.m
  36. +135 −0 src/T3ImageView.m
  37. +366 −0 src/T3PaintedView.m
  38. +354 −0 src/T3Painter.m
  39. +244 −0 src/T3PhotoView.m
  40. +571 −0 src/T3PhotoViewController.m
  41. +293 −0 src/T3ScrollView.m
  42. +143 −0 src/T3ShinyLabel.m
  43. +52 −0 src/T3TableViewController.m
  44. +89 −0 src/T3ThumbView.m
  45. +121 −0 src/T3ThumbsTableViewCell.m
  46. +214 −0 src/T3ThumbsViewController.m
  47. +679 −0 src/T3URLCache.m
  48. +8 −0 src/T3URLImageRequest.m
  49. +39 −0 src/T3URLRequest.m
  50. +13 −0 src/T3UnclippedView.m
  51. +283 −0 src/T3ViewController.m
  52. +50 −0 src/T3YouTubeView.m
  53. +30 −0 src/Three20/T3ActivityLabel.h
  54. +15 −0 src/Three20/T3ErrorView.h
  55. +139 −0 src/Three20/T3Global.h
  56. +33 −0 src/Three20/T3ImageView.h
  57. +23 −0 src/Three20/T3Object.h
  58. +18 −0 src/Three20/T3PaintedView.h
  59. +57 −0 src/Three20/T3Painter.h
  60. +85 −0 src/Three20/T3PhotoSource.h
  61. +39 −0 src/Three20/T3PhotoView.h
  62. +44 −0 src/Three20/T3PhotoViewController.h
  63. +44 −0 src/Three20/T3ScrollView.h
  64. +24 −0 src/Three20/T3ShinyLabel.h
  65. +10 −0 src/Three20/T3TableViewController.h
  66. +15 −0 src/Three20/T3ThumbView.h
  67. +18 −0 src/Three20/T3ThumbsTableViewCell.h
  68. +12 −0 src/Three20/T3ThumbsViewController.h
  69. +157 −0 src/Three20/T3URLCache.h
  70. +15 −0 src/Three20/T3URLImageRequest.h
  71. +42 −0 src/Three20/T3URLRequest.h
  72. +8 −0 src/Three20/T3UnclippedView.h
  73. +195 −0 src/Three20/T3ViewController.h
  74. +11 −0 src/Three20/T3YouTubeView.h
  75. +17 −0 src/Three20/Three20.h
13 LICENSE
@@ -0,0 +1,13 @@
+Copyright 2008 Joe Hewitt
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
@@ -0,0 +1,4 @@
+Three20
+=======
+
+Three20 is an iPhone UI library.
@@ -0,0 +1,11 @@
+#import <UIKit/UIKit.h>
+
+@class T3ImageView;
+
+@interface ImageTableViewCell : UITableViewCell {
+ T3ImageView* imageView;
+}
+
+@property(nonatomic, copy) NSString* imageURL;
+
+@end
@@ -0,0 +1,35 @@
+#import "ImageTableViewCell.h"
+#import "T3ImageView.h"
+
+@implementation ImageTableViewCell
+
+- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
+ if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
+ self.indentationLevel = 1;
+ self.indentationWidth = 35;
+
+ imageView = [[T3ImageView alloc] initWithFrame:CGRectMake(0, 0, 70, 70)];
+ imageView.defaultImage = [UIImage imageNamed:@"DefaultAlbum.png"];
+ [self addSubview:imageView];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [imageView release];
+ [super dealloc];
+}
+
+- (void)prepareForReuse {
+ imageView.url = nil;
+}
+
+- (NSString*)imageURL {
+ return imageView.url;
+}
+
+- (void)setImageURL:(NSString*)url {
+ imageView.url = url;
+}
+
+@end
@@ -0,0 +1,8 @@
+#import <UIKit/UIKit.h>
+
+@interface ImageTest1Controller : UIViewController {
+
+}
+
+@end
+
@@ -0,0 +1,21 @@
+
+#import "ImageTest1Controller.h"
+#import "Three20/Three20.h"
+
+@implementation ImageTest1Controller
+
+- (void)loadView {
+ self.view = [[[UIView alloc] init] autorelease];
+
+ T3ImageView* imageView = [[[T3ImageView alloc] initWithFrame:CGRectMake(30, 30, 0, 0)]
+ autorelease];
+ imageView.autoresizesToImage = YES;
+ imageView.url = @"http://farm4.static.flickr.com/3163/3110335722_7a906f9d8b_m.jpg";
+ [self.view addSubview:imageView];
+}
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+@end
@@ -0,0 +1,7 @@
+#import "Three20/Three20.h"
+
+@interface ImageTest2Controller : UITableViewController {
+ NSArray* imageURLs;
+}
+
+@end
@@ -0,0 +1,85 @@
+
+#import "ImageTest2Controller.h"
+#import "ImageTableViewCell.h"
+
+@implementation ImageTest2Controller
+
+- (void)viewDidLoad {
+ imageURLs = [[NSArray alloc] initWithObjects:
+ @"http://ecx.images-amazon.com/images/I/41WZ2SA9MXL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/61kJCUXbJcL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/51ew2Gt8XfL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/51HNJzq9L6L._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/61kf7tWTUoL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/51PrwPHighL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/617vLnxZ9jL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/4102AVDXS4L._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/41WT0H8RHHL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/511KZDNW1GL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/51ltArHi27L._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/415NG3SBHDL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/31TIYo%2BzR5L._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/519sCNd1qrL._SL160_AA115_.jpg",
+ @"http://ecx.images-amazon.com/images/I/51pLRnH5RKL._SL160_AA115_.jpg",
+ nil
+ ];
+}
+
+- (void)viewDidDisappear:(BOOL)animated {
+ [T3URLCache sharedCache].paused = NO;
+}
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ return 1;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+ return 70;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ return 30;
+}
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ ImageTableViewCell* cell = (ImageTableViewCell*)[tableView dequeueReusableCellWithIdentifier:@"image"];
+ if (cell == nil) {
+ cell = [[[ImageTableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"image"] autorelease];
+ }
+
+ cell.imageURL = [imageURLs objectAtIndex:indexPath.row % imageURLs.count];
+ cell.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
+ return cell;
+}
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// UIScrollViewDelegate
+
+- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
+ [T3URLCache sharedCache].paused = YES;
+}
+
+- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
+ if (!decelerate) {
+ [T3URLCache sharedCache].paused = NO;
+ }
+}
+
+- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
+ [T3URLCache sharedCache].paused = NO;
+}
+
+- (BOOL)scrollViewWillScrollToTop:(UIScrollView *)scrollView {
+ [T3URLCache sharedCache].paused = YES;
+ return YES;
+}
+
+- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView {
+ [T3URLCache sharedCache].paused = NO;
+}
+
+@end
+
@@ -0,0 +1,6 @@
+#import "Three20/Three20.h"
+
+@interface PhotoTest1Controller : T3PhotoViewController {
+}
+
+@end
Oops, something went wrong.

0 comments on commit 9c6d6a2

Please sign in to comment.