Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refined stack display

  • Loading branch information...
commit 7fc491b4754c8b9fef9d906b4fc6e846dcd0e925 1 parent 4e9aa28
@c61746961 c61746961 authored
View
74 Humalog.xcodeproj/project.pbxproj
@@ -14,16 +14,6 @@
849891F2152151200038DAA7 /* ONSET and OFFSET study, 2009.png in Resources */ = {isa = PBXBuildFile; fileRef = 849891EF152151200038DAA7 /* ONSET and OFFSET study, 2009.png */; };
849891F3152151200038DAA7 /* PLATO trial, 2009.png in Resources */ = {isa = PBXBuildFile; fileRef = 849891F0152151200038DAA7 /* PLATO trial, 2009.png */; };
849891F4152151200038DAA7 /* Wallentin Spanish.png in Resources */ = {isa = PBXBuildFile; fileRef = 849891F1152151200038DAA7 /* Wallentin Spanish.png */; };
- 8499BAD01547D33600D8F14E /* AQGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BABC1547D33600D8F14E /* AQGridView.m */; };
- 8499BAD11547D33600D8F14E /* AQGridViewAnimatorItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BABE1547D33600D8F14E /* AQGridViewAnimatorItem.m */; };
- 8499BAD21547D33600D8F14E /* AQGridViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BAC11547D33600D8F14E /* AQGridViewCell.m */; };
- 8499BAD31547D33600D8F14E /* AQGridViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BAC31547D33600D8F14E /* AQGridViewController.m */; };
- 8499BAD41547D33600D8F14E /* AQGridViewData.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BAC51547D33600D8F14E /* AQGridViewData.m */; };
- 8499BAD51547D33600D8F14E /* AQGridViewUpdateInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BAC71547D33600D8F14E /* AQGridViewUpdateInfo.m */; };
- 8499BAD61547D33600D8F14E /* AQGridViewUpdateItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BAC91547D33600D8F14E /* AQGridViewUpdateItem.m */; };
- 8499BAD71547D33600D8F14E /* NSIndexSet+AQIndexesOutsideSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BACB1547D33600D8F14E /* NSIndexSet+AQIndexesOutsideSet.m */; };
- 8499BAD81547D33600D8F14E /* NSIndexSet+AQIsSetContiguous.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BACD1547D33600D8F14E /* NSIndexSet+AQIsSetContiguous.m */; };
- 8499BAD91547D33600D8F14E /* UIColor+AQGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499BACF1547D33600D8F14E /* UIColor+AQGridView.m */; };
84C9DF8A15009F6700E16B3B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C9DF8915009F6700E16B3B /* UIKit.framework */; };
84C9DF8C15009F6700E16B3B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C9DF8B15009F6700E16B3B /* Foundation.framework */; };
84C9DF8E15009F6700E16B3B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C9DF8D15009F6700E16B3B /* CoreGraphics.framework */; };
@@ -116,29 +106,6 @@
849891EF152151200038DAA7 /* ONSET and OFFSET study, 2009.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ONSET and OFFSET study, 2009.png"; sourceTree = "<group>"; };
849891F0152151200038DAA7 /* PLATO trial, 2009.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PLATO trial, 2009.png"; sourceTree = "<group>"; };
849891F1152151200038DAA7 /* Wallentin Spanish.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Wallentin Spanish.png"; sourceTree = "<group>"; };
- 8499BAB91547D33600D8F14E /* AQGridView+CellLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AQGridView+CellLayout.h"; sourceTree = "<group>"; };
- 8499BABA1547D33600D8F14E /* AQGridView+CellLocationDelegation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AQGridView+CellLocationDelegation.h"; sourceTree = "<group>"; };
- 8499BABB1547D33600D8F14E /* AQGridView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AQGridView.h; sourceTree = "<group>"; };
- 8499BABC1547D33600D8F14E /* AQGridView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AQGridView.m; sourceTree = "<group>"; };
- 8499BABD1547D33600D8F14E /* AQGridViewAnimatorItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AQGridViewAnimatorItem.h; sourceTree = "<group>"; };
- 8499BABE1547D33600D8F14E /* AQGridViewAnimatorItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AQGridViewAnimatorItem.m; sourceTree = "<group>"; };
- 8499BABF1547D33600D8F14E /* AQGridViewCell+AQGridViewCellPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AQGridViewCell+AQGridViewCellPrivate.h"; sourceTree = "<group>"; };
- 8499BAC01547D33600D8F14E /* AQGridViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AQGridViewCell.h; sourceTree = "<group>"; };
- 8499BAC11547D33600D8F14E /* AQGridViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AQGridViewCell.m; sourceTree = "<group>"; };
- 8499BAC21547D33600D8F14E /* AQGridViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AQGridViewController.h; sourceTree = "<group>"; };
- 8499BAC31547D33600D8F14E /* AQGridViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AQGridViewController.m; sourceTree = "<group>"; };
- 8499BAC41547D33600D8F14E /* AQGridViewData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AQGridViewData.h; sourceTree = "<group>"; };
- 8499BAC51547D33600D8F14E /* AQGridViewData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AQGridViewData.m; sourceTree = "<group>"; };
- 8499BAC61547D33600D8F14E /* AQGridViewUpdateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AQGridViewUpdateInfo.h; sourceTree = "<group>"; };
- 8499BAC71547D33600D8F14E /* AQGridViewUpdateInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AQGridViewUpdateInfo.m; sourceTree = "<group>"; };
- 8499BAC81547D33600D8F14E /* AQGridViewUpdateItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AQGridViewUpdateItem.h; sourceTree = "<group>"; };
- 8499BAC91547D33600D8F14E /* AQGridViewUpdateItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AQGridViewUpdateItem.m; sourceTree = "<group>"; };
- 8499BACA1547D33600D8F14E /* NSIndexSet+AQIndexesOutsideSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSIndexSet+AQIndexesOutsideSet.h"; sourceTree = "<group>"; };
- 8499BACB1547D33600D8F14E /* NSIndexSet+AQIndexesOutsideSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSIndexSet+AQIndexesOutsideSet.m"; sourceTree = "<group>"; };
- 8499BACC1547D33600D8F14E /* NSIndexSet+AQIsSetContiguous.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSIndexSet+AQIsSetContiguous.h"; sourceTree = "<group>"; };
- 8499BACD1547D33600D8F14E /* NSIndexSet+AQIsSetContiguous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSIndexSet+AQIsSetContiguous.m"; sourceTree = "<group>"; };
- 8499BACE1547D33600D8F14E /* UIColor+AQGridView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+AQGridView.h"; sourceTree = "<group>"; };
- 8499BACF1547D33600D8F14E /* UIColor+AQGridView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+AQGridView.m"; sourceTree = "<group>"; };
84C9DF8515009F6700E16B3B /* Humalog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Humalog.app; sourceTree = BUILT_PRODUCTS_DIR; };
84C9DF8915009F6700E16B3B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
84C9DF8B15009F6700E16B3B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -280,36 +247,6 @@
path = previews;
sourceTree = "<group>";
};
- 8499BAB81547D33600D8F14E /* AQGridView */ = {
- isa = PBXGroup;
- children = (
- 8499BAB91547D33600D8F14E /* AQGridView+CellLayout.h */,
- 8499BABA1547D33600D8F14E /* AQGridView+CellLocationDelegation.h */,
- 8499BABB1547D33600D8F14E /* AQGridView.h */,
- 8499BABC1547D33600D8F14E /* AQGridView.m */,
- 8499BABD1547D33600D8F14E /* AQGridViewAnimatorItem.h */,
- 8499BABE1547D33600D8F14E /* AQGridViewAnimatorItem.m */,
- 8499BABF1547D33600D8F14E /* AQGridViewCell+AQGridViewCellPrivate.h */,
- 8499BAC01547D33600D8F14E /* AQGridViewCell.h */,
- 8499BAC11547D33600D8F14E /* AQGridViewCell.m */,
- 8499BAC21547D33600D8F14E /* AQGridViewController.h */,
- 8499BAC31547D33600D8F14E /* AQGridViewController.m */,
- 8499BAC41547D33600D8F14E /* AQGridViewData.h */,
- 8499BAC51547D33600D8F14E /* AQGridViewData.m */,
- 8499BAC61547D33600D8F14E /* AQGridViewUpdateInfo.h */,
- 8499BAC71547D33600D8F14E /* AQGridViewUpdateInfo.m */,
- 8499BAC81547D33600D8F14E /* AQGridViewUpdateItem.h */,
- 8499BAC91547D33600D8F14E /* AQGridViewUpdateItem.m */,
- 8499BACA1547D33600D8F14E /* NSIndexSet+AQIndexesOutsideSet.h */,
- 8499BACB1547D33600D8F14E /* NSIndexSet+AQIndexesOutsideSet.m */,
- 8499BACC1547D33600D8F14E /* NSIndexSet+AQIsSetContiguous.h */,
- 8499BACD1547D33600D8F14E /* NSIndexSet+AQIsSetContiguous.m */,
- 8499BACE1547D33600D8F14E /* UIColor+AQGridView.h */,
- 8499BACF1547D33600D8F14E /* UIColor+AQGridView.m */,
- );
- path = AQGridView;
- sourceTree = "<group>";
- };
84C9DF7A15009F6700E16B3B = {
isa = PBXGroup;
children = (
@@ -464,7 +401,6 @@
84E05FB5151298FC009FE5AF /* Libs */ = {
isa = PBXGroup;
children = (
- 8499BAB81547D33600D8F14E /* AQGridView */,
84E05FB6151298FC009FE5AF /* iCarousel */,
);
path = Libs;
@@ -694,16 +630,6 @@
84E06023151319A8009FE5AF /* Viewport.m in Sources */,
84E64C27151D1388001F7E0A /* ThumbnailStackView.m in Sources */,
84E64C2A151D141B001F7E0A /* SlideController.m in Sources */,
- 8499BAD01547D33600D8F14E /* AQGridView.m in Sources */,
- 8499BAD11547D33600D8F14E /* AQGridViewAnimatorItem.m in Sources */,
- 8499BAD21547D33600D8F14E /* AQGridViewCell.m in Sources */,
- 8499BAD31547D33600D8F14E /* AQGridViewController.m in Sources */,
- 8499BAD41547D33600D8F14E /* AQGridViewData.m in Sources */,
- 8499BAD51547D33600D8F14E /* AQGridViewUpdateInfo.m in Sources */,
- 8499BAD61547D33600D8F14E /* AQGridViewUpdateItem.m in Sources */,
- 8499BAD71547D33600D8F14E /* NSIndexSet+AQIndexesOutsideSet.m in Sources */,
- 8499BAD81547D33600D8F14E /* NSIndexSet+AQIsSetContiguous.m in Sources */,
- 8499BAD91547D33600D8F14E /* UIColor+AQGridView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
BIN  Humalog.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
41 Humalog/Controllers/SlideController.m
@@ -22,6 +22,7 @@ @interface SlideController () {
ThumbnailStackView *stackView;
NSUInteger currentSlide;
NSUInteger currentCategoryIndex;
+ NSUInteger previousIndex;
enum NavigationPosition navigationPosition;
BOOL drawThumbnails;
}
@@ -211,19 +212,30 @@ - (UIView *)carousel:(iCarousel *)carousel
viewForItemAtIndex:(NSUInteger)index
reusingView:(UIView *)view
{
+ NSUInteger documentIndex = [slideProvider rangeForCategoryIndex:currentCategoryIndex].location + index;
+
// Title
UILabel *title = [[UILabel alloc] init];
title.backgroundColor = [UIColor clearColor];
- title.textColor = [UIColor whiteColor];
- title.text = [slideProvider titleForDocumentAtIndex:[slideProvider rangeForCategoryIndex:currentCategoryIndex].location + index];
+ title.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.75];
+ title.text = [slideProvider titleForDocumentAtIndex:documentIndex];
title.font = [UIFont boldSystemFontOfSize:15.0];
- title.frame = CGRectMake(0, 0, carousel.bounds.size.width - 12.0, carousel.itemWidth / 2.0);
+ title.frame = CGRectMake(0, 0, carousel.bounds.size.width - 16.0, title.font.lineHeight * 2.0);
title.textAlignment = UITextAlignmentCenter;
title.lineBreakMode = UILineBreakModeWordWrap;
title.numberOfLines = 0;
// Container
UIView *container = [[UIView alloc] init];
+// container.backgroundColor = [UIColor grayColor];
+
+ // Hilight selected
+ if (currentSlide == documentIndex) {
+ container.layer.shadowOpacity = 1.0;
+ container.layer.shadowRadius = 10.0;
+ container.layer.shadowColor = [UIColor whiteColor].CGColor;
+ title.textColor = [UIColor whiteColor];
+ }
if (!drawThumbnails) {
container.frame = title.frame;
@@ -231,8 +243,8 @@ - (UIView *)carousel:(iCarousel *)carousel
// HR
if (index < carousel.numberOfItems - 1) {
- UIView *hr = [[UIView alloc] initWithFrame:CGRectMake(0, title.bounds.size.height + 9.0,
- carousel.bounds.size.width * 0.75, 1)];
+ UIView *hr = [[UIView alloc] initWithFrame:CGRectMake(0, title.bounds.size.height + 4.0,
+ title.bounds.size.width - 12.0, 1)];
hr.center = CGPointMake(title.center.x, hr.center.y);
hr.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.25];
hr.opaque = YES;
@@ -242,21 +254,15 @@ - (UIView *)carousel:(iCarousel *)carousel
}
// Image
- UIView *thumb = [slideProvider previewForDocumentAtIndex:[slideProvider rangeForCategoryIndex:currentCategoryIndex].location + index];
-
+ UIView *thumb = [slideProvider previewForDocumentAtIndex:documentIndex];
thumb.clipsToBounds = YES;
thumb.layer.cornerRadius = 4.0f;
- // Hilight selected
-// if (carousel.currentItemIndex == index) {
-// thumb.layer.borderColor = [UIColor blueColor].CGColor;
-// thumb.layer.borderWidth = 8.0f;
-// }
-
// Container
- container.frame = thumb.frame;
+ container.frame = CGRectInset(thumb.frame, 0, -title.bounds.size.height / 2.0);
[container addSubview:thumb];
- title.center = CGPointMake(thumb.center.x, thumb.center.y + title.bounds.size.height);
+ title.frame = CGRectOffset(title.frame, 0, thumb.bounds.size.height);
+ title.center = CGPointMake(thumb.center.x, title.center.y);
[container addSubview:title];
return container;
@@ -264,7 +270,7 @@ - (UIView *)carousel:(iCarousel *)carousel
- (CGFloat)carouselItemWidth:(iCarousel *)carousel
{
- return 36.0 + (drawThumbnails? [slideProvider previewForDocumentAtIndex:0].bounds.size.height : 0.0);
+ return 8.0 + [UIFont boldSystemFontOfSize:15.0].lineHeight * 2.0 + (drawThumbnails? [slideProvider previewForDocumentAtIndex:0].bounds.size.height : 0.0);
}
- (BOOL)carouselShouldWrap:(iCarousel *)carousel
@@ -281,6 +287,9 @@ - (void)carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index
{
// Feed document view
currentSlide = [slideProvider rangeForCategoryIndex:currentCategoryIndex].location + index;
+ [carousel reloadItemAtIndex:previousIndex animated:YES];
+ [carousel reloadItemAtIndex:index animated:YES];
+ previousIndex = index;
[self loadContent];
}
View
2  Humalog/Views/ThumbnailStackView.m
@@ -40,7 +40,7 @@ - (void)setNeedsLayout
{
self.bounds = CGRectMake(0, 0, self.bounds.size.width, self.numberOfItems * self.itemWidth + 32.0);
self.frame = CGRectOffset(self.bounds, baseline.x - self.bounds.size.width / 2.0, baseline.y - self.bounds.size.height);
- self.contentOffset = CGSizeMake(0, (self.itemWidth - self.bounds.size.height + 16.0) / 2.0);
+ self.contentOffset = CGSizeMake(0, (self.itemWidth - self.bounds.size.height + 32.0) / 2.0);
[super setNeedsLayout];
}
Please sign in to comment.
Something went wrong with that request. Please try again.