-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Reader second pass: detail view redesign, refactoring, and improvement #716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
155c5b5
Refactored Reader's new design for reuse elsewhere
mikejohnstn 05b42a6
Start of major refactoring of Reader's detail view
mikejohnstn db69aca
Refactor button actions as delegate methods
mikejohnstn c78a31a
Make detail view use new delegate methods
mikejohnstn e11dbd5
Move reader tap actions to delegate methods
mikejohnstn 12be3ea
Remove ReaderDetailView now that it has been generalized away
mikejohnstn 8da2bfb
Fix some videos not opening properly inline
mikejohnstn dbd74fb
Merge branch 'develop' into feature/602-reader-detail
mikejohnstn 7c865ff
Replaced deprecated sizeWithFont
mikejohnstn ded137e
Code format cleanup
mikejohnstn e126c6a
Removed iOS6-specific code
mikejohnstn 211d61c
Don't allow selection of content 'row'
mikejohnstn 551b546
Made Reader detail display at narrower width on iPad
mikejohnstn c591d70
Format fixes for iPad
mikejohnstn 14aa7ea
Remove KVO for isReblogged
mikejohnstn 32be7a5
Make image caching resilient to rounding and only use widths
mikejohnstn fda4592
Various sizing fixes, disable scroll detection for now
mikejohnstn 85f986f
Override fetched results controller to prevent table updates from con…
mikejohnstn ca8955b
Remove iOS6-specific code
mikejohnstn ad87de1
Change iPad tables to have a fixed and wider width
mikejohnstn 85f2cf6
Make Reader comments narrower on iPad as well
mikejohnstn 94b9f9f
Fix comment form not displaying correctly
mikejohnstn 9a61327
Changed detail view background colors
mikejohnstn dbc7195
Fix cell contentView not being sized
mikejohnstn f42bcbf
Changed Reader comment design
tomwitkin 0814a8a
Remove logic for loading visible images
mikejohnstn eb14d25
Code for preloading images (disabled for now)
mikejohnstn 4d22195
Remove remaining presentAsModal global antipatterns (fixes #620)
mikejohnstn e0869c0
Remove unimplemented failure handler (fixes #645)
mikejohnstn 80650e1
Remove another reference to removed handler
mikejohnstn 34bec83
Merge branch 'develop' into feature/602-reader-detail
mikejohnstn 5db9f40
Reenable and improve trick for preloading images
mikejohnstn 73304f6
Don't display the placeholder icon for images
mikejohnstn 5b2eafc
Set state of follow button on configuration (fixes #704)
mikejohnstn e70e689
Fix reblog form not displaying correctly
mikejohnstn f6dc6c6
Comment cleanup
mikejohnstn ef99356
Constrain the width of the follow button
mikejohnstn 829a467
Swap out topic change delegate for NSNotification for easier reuse
mikejohnstn ee078e4
Handle tapping a tag in the Reader detail view
mikejohnstn e2711e7
Comment cleanup
mikejohnstn 73ed940
Remove unused isScrollingFast logic
mikejohnstn 4ada971
Don't use self to set properties in init
mikejohnstn 390e2e9
Move code from viewDidUnload to dealloc
mikejohnstn 507ddd9
Merge branch 'develop' into feature/602-reader-detail
mikejohnstn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| #import "NSDate+StringFormatting.h" | ||
|
|
||
| #define RCTVCVerticalPadding 5.0f | ||
| #define RCTVCIndentationWidth 10.0f | ||
| #define RCTVCIndentationWidth 15.0f | ||
| #define RCTVCAuthorLabelHeight 20.0f | ||
|
|
||
| @interface ReaderCommentTableViewCell()<DTAttributedTextContentViewDelegate> | ||
|
|
@@ -96,17 +96,15 @@ + (NSAttributedString *)convertHTMLToAttributedString:(NSString *)html withOptio | |
| - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | ||
| self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
| if (self) { | ||
|
|
||
| UIColor *color = DTColorCreateWithHexString(@"EFEFEF"); | ||
| CGFloat width = self.frame.size.width; | ||
| self.backgroundColor = color; | ||
| self.backgroundColor = [WPStyleGuide itsEverywhereGrey]; | ||
|
|
||
| [self.cellImageView setFrame:CGRectMake(10.0f, 10.0f, 20.0f, 20.0f)]; | ||
| self.cellImageView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; | ||
|
|
||
| self.textContentView = [[DTAttributedTextContentView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.frame.size.width, 44.0f)]; | ||
| _textContentView.autoresizingMask = UIViewAutoresizingFlexibleWidth; | ||
| _textContentView.backgroundColor = color; | ||
| _textContentView.backgroundColor = [UIColor clearColor]; | ||
| _textContentView.edgeInsets = UIEdgeInsetsMake(0.0f, 10.0f, 0.0f, 10.0f); | ||
| _textContentView.delegate = self; | ||
| _textContentView.shouldDrawImages = NO; | ||
|
|
@@ -118,40 +116,26 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus | |
| _dateLabel.textColor = [WPStyleGuide littleEddieGrey]; | ||
| _dateLabel.textAlignment = NSTextAlignmentRight; | ||
| _dateLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; | ||
| _dateLabel.backgroundColor = color; | ||
| _dateLabel.backgroundColor = [UIColor clearColor]; | ||
| [self.contentView addSubview:_dateLabel]; | ||
|
|
||
| self.authorLabel = [[UILabel alloc] initWithFrame:CGRectMake(40.0f, 10.0f, (_dateLabel.frame.origin.x - 50.0f), 20.0f)]; | ||
| self.authorLabel = [[UILabel alloc] initWithFrame:CGRectMake(10.0f, 10.0f, (_dateLabel.frame.origin.x - 50.0f), 20.0f)]; | ||
| [_authorLabel setFont:[WPStyleGuide subtitleFont]]; | ||
| _authorLabel.textColor = [WPStyleGuide littleEddieGrey]; | ||
| _authorLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; | ||
| _authorLabel.backgroundColor = color; | ||
| _authorLabel.backgroundColor = [UIColor clearColor]; | ||
| [self.contentView addSubview:_authorLabel]; | ||
|
|
||
| UIImageView *separatorImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell-separator"]]; | ||
| separatorImageView.frame = CGRectMake(0.0f, 0.0f, width, 2.0f); | ||
| UIImageView *separatorImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.indentationWidth, 0.0f, width - self.indentationWidth, 1.0f)]; | ||
| separatorImageView.backgroundColor = [UIColor colorWithHexString:@"e5e5e5"]; | ||
| separatorImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth; | ||
| [self.contentView addSubview:separatorImageView]; | ||
|
|
||
| self.textContentView.frame = CGRectMake(0.0f, _authorLabel.frame.size.height + 10.0f, width, 44.0f); | ||
|
|
||
| UIView *view = [[UIView alloc] initWithFrame:self.bounds]; | ||
| UIView *view = [[UIView alloc] initWithFrame:self.frame]; | ||
| view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; | ||
| view.backgroundColor = DTColorCreateWithHexString(@"A9E2F3"); | ||
|
|
||
| CGRect rect = CGRectMake(0, 0, 1, 1); | ||
| UIGraphicsBeginImageContext(rect.size); | ||
| CGContextRef context = UIGraphicsGetCurrentContext(); | ||
| CGContextSetFillColorWithColor(context, [color CGColor]); | ||
| CGContextFillRect(context, rect); | ||
| UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); | ||
| UIGraphicsEndImageContext(); | ||
|
|
||
| UIView *colorView = [[UIImageView alloc] initWithImage:img]; | ||
| colorView.frame = CGRectMake(0.0f, 0.0f, width, 2.0f); | ||
| colorView.autoresizingMask = UIViewAutoresizingFlexibleWidth; | ||
|
|
||
| [view addSubview:colorView]; | ||
| view.backgroundColor = DTColorCreateWithHexString(@"e5e5e5"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally not a big fan of using the DTCoreText methods ... naming the colors is my favorite. No need to change, my two cents. |
||
|
|
||
| [self setSelectedBackgroundView:view]; | ||
| } | ||
|
|
@@ -165,8 +149,9 @@ - (void)layoutSubviews { | |
|
|
||
| // We have to manually update the indentation of the content view? wtf. | ||
| CGRect frame = self.contentView.frame; | ||
| frame.origin.x += (self.indentationWidth * self.indentationLevel); | ||
| frame.size.width -= frame.origin.x; | ||
| CGFloat indent = self.indentationWidth * self.indentationLevel; | ||
| frame.origin.x += indent; | ||
| frame.size.width -= indent; | ||
| self.contentView.frame = frame; | ||
|
|
||
| [self.cellImageView setFrame:CGRectMake(10.0f, 10.0f, 20.0f, 20.0f)]; | ||
|
|
||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay!