-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New Reader list design #575
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
39 commits
Select commit
Hold shift + click to select a range
516caf3
Don't show like counts
mikejohnstn 753b8a6
Small code style changes
mikejohnstn 98b2b59
Consts for control bar magic numbers
mikejohnstn 19fdfe3
Add comment button, reorder control buttons, remove borders
mikejohnstn 3ef7e5b
Fix reblog form not showing up
mikejohnstn 12a9b79
Code formatting cleanup
mikejohnstn 1612a96
Move author view to the top of the cell
mikejohnstn 60ff10f
New title font and padding
mikejohnstn 4ec8ab0
Render a horizontal line and update padding
mikejohnstn 5dbbe42
Make images display full-width
mikejohnstn 856f2ba
Prettier height handling
mikejohnstn 08fc38e
Add follow button, move time label
mikejohnstn 2f18ffc
Change color of follow icons
mikejohnstn f1e96d3
Improve alignment of time and buttons
mikejohnstn 74734ad
New colors for Reader buttons
mikejohnstn 25775a5
Add tag button (sample text for now)
mikejohnstn cc7ae0c
Move short date formatting to a category, and use it in main Reader list
mikejohnstn bfc46bd
Adjust image height ratio and make it a const
mikejohnstn 3ba885a
Refactor cells to decouple actions for better MVC separation
mikejohnstn 0641c6e
Better variable names
mikejohnstn f403cff
Hook up follow button
mikejohnstn 38124e0
Add clock icon to timestamp
mikejohnstn e92f761
Add title border when there's no image
mikejohnstn 2b98cdd
Support UILabel attributedText size suggestion
mikejohnstn 09c564e
Custom line heights for title and summary
mikejohnstn 9d85d42
Store primaryTag and tags in ReaderPost objects
mikejohnstn fbbd143
Tapping a tag lets you browse that tag's posts
mikejohnstn 07d119d
Fallback logic for displaying blog/display/author name
mikejohnstn 74fcaba
Made site/blog ID handling more robust to handle tag endpoint
mikejohnstn 3b5d039
Aesthetic tweaks: line heights, padding
mikejohnstn 282a33f
Clamp summary height and remove padding offset
mikejohnstn d838f58
Keep comment button hidden unless wpcom
mikejohnstn 8c7e830
Fix a small padding problem
mikejohnstn 233c601
Handle an empty topics list
mikejohnstn 60ee080
Remove unused code
mikejohnstn 812b3d3
Fix top table margin on first load
mikejohnstn 96c521f
Cleaned up defines and consts
mikejohnstn ab258b7
Fix black bar beneath reblog form
mikejohnstn 5d16a83
Merge branch 'develop' into feature/485-new-reader
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // | ||
| // NSDate+StringFormatting.h | ||
| // WordPress | ||
| // | ||
| // Created by Michael Johnston on 11/17/13. | ||
| // Copyright (c) 2013 WordPress. All rights reserved. | ||
| // | ||
|
|
||
| #import <Foundation/Foundation.h> | ||
|
|
||
| @interface NSDate (StringFormatting) | ||
|
|
||
| - (NSString *)shortString; | ||
|
|
||
| @end |
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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // | ||
| // NSDate+StringFormatting.m | ||
| // WordPress | ||
| // | ||
| // Created by Michael Johnston on 11/17/13. | ||
| // Copyright (c) 2013 WordPress. All rights reserved. | ||
| // | ||
|
|
||
| #import "NSDate+StringFormatting.h" | ||
|
|
||
| @implementation NSDate (StringFormatting) | ||
|
|
||
| - (NSString *)shortString { | ||
| NSString *shortString; | ||
| NSTimeInterval diff = [[NSDate date] timeIntervalSince1970] - [self timeIntervalSince1970]; | ||
|
|
||
| if(diff < 60) { | ||
| shortString = [NSString stringWithFormat:@"%is", (int)diff]; | ||
| } else if(diff < 3600) { | ||
| shortString = [NSString stringWithFormat:@"%im", (int)floor(diff / 60)]; | ||
| } else if (diff < 86400) { | ||
| shortString = [NSString stringWithFormat:@"%ih", (int)floor(diff / 3600)]; | ||
| } else { | ||
| shortString = [NSString stringWithFormat:@"%id", (int)floor(diff / 86400)]; | ||
| } | ||
|
|
||
| return shortString; | ||
| } | ||
|
|
||
| @end | ||
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
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
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
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.
This needs translation support
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.
This code was already in the app. I just moved it to a category. I've added #583 to localize this and ensure it makes sense for all supported languages.
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.
It's a pretty good rule of thumb that if you see 86400 in code, it's not the best way to calculate duration in days. Where you'll run into problems is with people using other than a Gregorian calendar or when daylight saving and leap years/seconds come into play.
I'd suggest using NSDateComponents (this code is typed from memory and may not be compilable) -
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.
I didn't write this (just moved it), but yeah, to do it 100% right, someone will need to research if this rendering of dates even makes sense in all the languages we support. It's a bigger task that I think we should defer to #583 (this code already exists in the production app).
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.
Whoops I didn't see #583 👍