Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
e54f9c7
First pass at ReaderTagStrip
nbradbury Sep 29, 2016
10c34bc
2nd pass at ReaderTagStrip
nbradbury Sep 29, 2016
d0b2322
Remove tag from footer
nbradbury Sep 29, 2016
56033b8
Removed avatar from dateline
nbradbury Sep 29, 2016
f621d86
Removed author name from dateline
nbradbury Sep 29, 2016
e1bbbba
use larger font size for tag
nbradbury Sep 29, 2016
1f0368c
Changed tag icon size
nbradbury Sep 29, 2016
54af70a
Increase dateline font size to match tag font size
nbradbury Sep 29, 2016
271cb3d
Fixed bug in ReaderPost that caused second tag to be skipped
nbradbury Sep 29, 2016
68e8e8a
Removed tag icon, using "#" before tag name to match list view
nbradbury Sep 29, 2016
6f09250
Don't add secondary tag if it will take up too much space
nbradbury Sep 29, 2016
90bd2a3
Minor tweaks
nbradbury Sep 29, 2016
4ba2531
Show longer like/comment labels in footer
nbradbury Sep 29, 2016
7bf8d7b
Minor tweaks to like/comment counts
nbradbury Sep 29, 2016
ab930c9
First pass at header view
nbradbury Sep 30, 2016
74f47be
Second pass at header view
nbradbury Sep 30, 2016
accd1a4
Merge branch 'feature/reader-full-post-refresh-tags' of https://githu…
nbradbury Sep 30, 2016
547d3bd
Replaced existing detail header
nbradbury Sep 30, 2016
a48c2c0
Show blog preview when header views are tapped
nbradbury Sep 30, 2016
dd94335
Bold the title
nbradbury Sep 30, 2016
18e4026
don't show the header for blog preview
nbradbury Sep 30, 2016
5c818a8
Added follower count
nbradbury Sep 30, 2016
36b78ad
Increased margin between follower count and follow button
nbradbury Sep 30, 2016
d1f5276
Added divider
nbradbury Sep 30, 2016
ecfdf5a
Enlarged follower count
nbradbury Sep 30, 2016
6a95489
First pass at blavatar
nbradbury Sep 30, 2016
fb956fc
Added oval background to avatar
nbradbury Sep 30, 2016
547de1f
Switched positions of author/blog names
nbradbury Sep 30, 2016
47ffd10
Adjust orientation in landscape (percursor to showing at left of cont…
nbradbury Sep 30, 2016
f36a183
Remove background color from avatar oval
nbradbury Sep 30, 2016
74b7c22
Increase margin below dateline
nbradbury Sep 30, 2016
75600be
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Sep 30, 2016
ed235f1
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Sep 30, 2016
1fb0a15
Increase margin below dateline
nbradbury Sep 30, 2016
ea7c550
Fix follow/unfollow bug
nbradbury Sep 30, 2016
8320b3c
Update follower count after follow/unfollow
nbradbury Sep 30, 2016
5bc3e15
Update follower count as soon as follow button is clicked
nbradbury Sep 30, 2016
1f7f457
Check for null blogInfo
nbradbury Oct 1, 2016
0295363
Added solid background to oval shape
nbradbury Oct 1, 2016
bca2c93
Use blavatar from blog info
nbradbury Oct 1, 2016
442b715
Reset follow count when call fails
nbradbury Oct 1, 2016
38bf356
Switch to using isExternal to determine whether to get feed info or b…
nbradbury Oct 2, 2016
c9928df
Only load blavatar if changed
nbradbury Oct 2, 2016
d123fc7
Rely solely on blog info for blavatar
nbradbury Oct 3, 2016
3d6f698
Hide blavatar when there isn't one
nbradbury Oct 3, 2016
25f571c
Always add 2nd tag (skip checking whether there's space for it)
nbradbury Oct 4, 2016
c9881d6
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 4, 2016
c5c0d00
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 4, 2016
87d8b01
Merge pull request #4582 from wordpress-mobile/feature/reader-full-po…
nbradbury Oct 5, 2016
5a22112
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 5, 2016
a659bc7
Slightly larger gravatar
nbradbury Oct 5, 2016
3100c8e
Don't load avatar until we know whether there's a blavatar and can se…
nbradbury Oct 5, 2016
f6cbbe9
Removed unused mBlavatarUrl
nbradbury Oct 5, 2016
060c614
Moved loading avatar to separate routine
nbradbury Oct 5, 2016
d23350f
Left align site-level content
nbradbury Oct 5, 2016
a321621
Same layout regardless of orientation
nbradbury Oct 5, 2016
da06308
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPre…
nbradbury Oct 7, 2016
c7b59b7
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 7, 2016
b0dd5bd
Removed follower count
nbradbury Oct 7, 2016
bdaf85a
Added separate routines for requesting local/global related posts
nbradbury Oct 7, 2016
c29a20a
Separate container views for local/global
nbradbury Oct 7, 2016
c23f357
Separate label views for local/global
nbradbury Oct 7, 2016
3dcc500
Reduce font size
nbradbury Oct 7, 2016
bd55106
Show site name in local related posts
nbradbury Oct 7, 2016
6b0fa7b
No divider between related posts
nbradbury Oct 7, 2016
7f593df
Show excerpt rather than byline
nbradbury Oct 7, 2016
3b882be
Show byline only for global
nbradbury Oct 7, 2016
cc835d1
Simplify related posts by only requesting & parsing necessary fields
nbradbury Oct 7, 2016
d65c124
Flattened heirarchy or related post view
nbradbury Oct 7, 2016
9ceb179
First pass at site header for global related posts
nbradbury Oct 7, 2016
acd35fd
Removed featured image
nbradbury Oct 7, 2016
515b817
Moved related posts to a separate view object
nbradbury Oct 7, 2016
de88c29
Re-implemented click listener
nbradbury Oct 7, 2016
40943c8
Removed background & padding, added dividers
nbradbury Oct 7, 2016
20b661c
Margin cleanup, fixed gravatar bug
nbradbury Oct 7, 2016
a7770d8
Added back featured image
nbradbury Oct 7, 2016
0fefbfd
Reversed author name & site name in the header
nbradbury Oct 7, 2016
0ca61a5
Don't show featured image unless there's an excerpt
nbradbury Oct 7, 2016
6b84144
Added RELATED_POST_FIELDS constant
nbradbury Oct 7, 2016
d72b4cf
Moved featured image to the left
nbradbury Oct 7, 2016
b8e579c
Removed unused background drawable
nbradbury Oct 8, 2016
cab591f
Make featured image fit the height of the related post view
nbradbury Oct 8, 2016
7d5e08f
First pass at follow button
nbradbury Oct 8, 2016
1f7b6e9
2nd pass at follow button
nbradbury Oct 8, 2016
fabbe9d
Modify follow button to have no caption
nbradbury Oct 8, 2016
e018e61
Correct bug that caused site header on local related posts
nbradbury Oct 8, 2016
68454e7
Increased featured image width
nbradbury Oct 8, 2016
ed23a6b
Request local related posts first
nbradbury Oct 8, 2016
c6c065f
Use single call to get all related posts at once
nbradbury Oct 8, 2016
64973a5
Split related posts in the action
nbradbury Oct 8, 2016
8e6ac3c
Get featured image from featured_media
nbradbury Oct 8, 2016
7593c9d
Enlarge follow icon when there's no caption
nbradbury Oct 9, 2016
f7b71dc
Ellipsize site header text and limit to single line
nbradbury Oct 9, 2016
1816251
Corrected comment
nbradbury Oct 9, 2016
0e197fe
Removed unused blavatar
nbradbury Oct 11, 2016
73b2be1
When author and blog names are the same, show author name since it's …
nbradbury Oct 11, 2016
51596a0
Merge pull request #4588 from wordpress-mobile/feature/reader-full-po…
khaykov Oct 11, 2016
554fedd
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPre…
nbradbury Oct 11, 2016
49a1032
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 11, 2016
c984492
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPre…
nbradbury Oct 12, 2016
a7c244c
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPre…
nbradbury Oct 12, 2016
d8ff755
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 12, 2016
6ec376b
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 12, 2016
0e16e07
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPre…
nbradbury Oct 12, 2016
db19a10
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 12, 2016
e57687f
Pass JSON post array when creating `ReaderRelatedPostList`
nbradbury Oct 12, 2016
8521709
Always use passed context in `initView`
nbradbury Oct 12, 2016
eb101af
Added `@NonNull` annotation to showRelatedPosts
nbradbury Oct 12, 2016
185662b
Remove all views from the container before checking if passed list is…
nbradbury Oct 12, 2016
fae16eb
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPre…
nbradbury Oct 12, 2016
7a5a202
Merge branch 'feature/reader-full-post-refresh-master' of https://git…
nbradbury Oct 12, 2016
10be46e
Use context.getResources()
nbradbury Oct 13, 2016
69c0909
Null check ReaderRelatedPost.fromJSON
nbradbury Oct 13, 2016
419aa41
Use getLong
nbradbury Oct 13, 2016
01b30aa
Merge pull request #4626 from wordpress-mobile/feature/reader-full-po…
hypest Oct 13, 2016
fb5af09
Resize/crop downloaded featured image
nbradbury Oct 13, 2016
f05cf71
Passing cropping when setting download image url
nbradbury Oct 13, 2016
df9ea15
Prevent possible /0 exception
nbradbury Oct 13, 2016
e5e41e1
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPre…
nbradbury Oct 19, 2016
89bdf94
Use ThumbnailUtils.extractThumbnail
nbradbury Oct 19, 2016
2de8946
Merge pull request #4652 from wordpress-mobile/feature/reader-full-po…
khaykov Oct 19, 2016
7adc395
Fix blockquote styling
nbradbury Oct 20, 2016
0a002e3
Use `blue_medium` follow icon
nbradbury Oct 20, 2016
ede159c
Add "ago" to timespan
nbradbury Oct 21, 2016
8ff1215
Remove selectable background from follow icon
nbradbury Oct 21, 2016
b9b8367
Rewrote logic for showing blavatar+avatar
nbradbury Oct 21, 2016
11b2a02
Don't hide byline in blog preview
nbradbury Oct 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,21 @@ private static void assignAuthorFromJson(ReaderPost post, JSONObject jsonAuthor)

post.authorName = JSONUtils.getStringDecoded(jsonAuthor, "name");
post.authorFirstName = JSONUtils.getStringDecoded(jsonAuthor, "first_name");
post.postAvatar = JSONUtils.getString(jsonAuthor, "avatar_URL");
post.authorId = jsonAuthor.optLong("ID");

// v1.2 endpoint contains a "has_avatar" boolean which tells us whether the author
// has a valid avatar - if this field exists and is set to false, skip setting
// the avatar URL
boolean hasAvatar;
if (jsonAuthor.has("has_avatar")) {
hasAvatar = jsonAuthor.optBoolean("has_avatar");
} else {
hasAvatar = true;
}
if (hasAvatar) {
post.postAvatar = JSONUtils.getString(jsonAuthor, "avatar_URL");
}

// site_URL doesn't exist for /sites/ endpoints, so get it from the author
if (TextUtils.isEmpty(post.blogUrl)) {
post.setBlogUrl(JSONUtils.getString(jsonAuthor, "URL"));
Expand All @@ -272,15 +284,18 @@ private static void assignTagsFromJson(ReaderPost post, JSONObject jsonTags) {

while (it.hasNext()) {
JSONObject jsonThisTag = jsonTags.optJSONObject(it.next());
String thisTagName = JSONUtils.getStringDecoded(jsonThisTag, "slug");

// if the number of posts on this blog that use this tag is higher than previous,
// set this as the most popular tag, and set the second most popular tag to
// the current most popular tag
int postCount = jsonThisTag.optInt("post_count");
if (postCount > popularCount) {
nextMostPopularTag = mostPopularTag;
mostPopularTag = JSONUtils.getStringDecoded(jsonThisTag, "slug");
mostPopularTag = thisTagName;
popularCount = postCount;
} else if (nextMostPopularTag == null) {
nextMostPopularTag = thisTagName;
}
}

Expand Down Expand Up @@ -461,7 +476,7 @@ public void setPrimaryTag(String tagName) {
this.primaryTag = StringUtils.notNullStr(tagName);
}
}
boolean hasPrimaryTag() {
public boolean hasPrimaryTag() {
return !TextUtils.isEmpty(primaryTag);
}

Expand All @@ -473,6 +488,9 @@ public void setSecondaryTag(String tagName) {
this.secondaryTag = StringUtils.notNullStr(tagName);
}
}
public boolean hasSecondaryTag() {
return !TextUtils.isEmpty(secondaryTag);
}

/*
* attachments are stored as the actual JSON to avoid having a separate table for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.support.annotation.NonNull;

import org.wordpress.android.models.ReaderPost;
import org.wordpress.android.models.ReaderPostList;
import org.wordpress.android.models.ReaderTag;
import org.wordpress.android.ui.reader.actions.ReaderActions;
import org.wordpress.android.ui.reader.models.ReaderRelatedPostList;
Expand Down Expand Up @@ -119,17 +118,35 @@ public ReaderActions.UpdateResult getResult() {
}

public static class RelatedPostsUpdated {
private final ReaderPost mSourcePost;
private final ReaderRelatedPostList mRelatedPosts;
public RelatedPostsUpdated(@NonNull ReaderPost sourcePost, @NonNull ReaderPostList relatedPosts) {
mSourcePost = sourcePost;
mRelatedPosts = new ReaderRelatedPostList(relatedPosts);
}
public ReaderPost getSourcePost() {
return mSourcePost;
}
public ReaderRelatedPostList getRelatedPosts() {
return mRelatedPosts;
private final long mSourcePostId;
private final long mSourceSiteId;
private final ReaderRelatedPostList mLocalRelatedPosts;
private final ReaderRelatedPostList mGlobalRelatedPosts;
public RelatedPostsUpdated(@NonNull ReaderPost sourcePost,
@NonNull ReaderRelatedPostList localRelatedPosts,
@NonNull ReaderRelatedPostList globalRelatedPosts) {
mSourcePostId = sourcePost.postId;
mSourceSiteId = sourcePost.blogId;
mLocalRelatedPosts = localRelatedPosts;
mGlobalRelatedPosts = globalRelatedPosts;
}
public long getSourcePostId() {
return mSourcePostId;
}
public long getSourceSiteId() {
return mSourceSiteId;
}
public ReaderRelatedPostList getLocalRelatedPosts() {
return mLocalRelatedPosts;
}
public ReaderRelatedPostList getGlobalRelatedPosts() {
return mGlobalRelatedPosts;
}
public boolean hasLocalRelatedPosts() {
return mLocalRelatedPosts.size() > 0;
}
public boolean hasGlobalRelatedPosts() {
return mGlobalRelatedPosts.size() > 0;
}
}
}
Loading