mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-23 05:16:58 +00:00
fix story linked post, video post, and clicking back button too early on pvv2
This commit is contained in:
parent
e32002fac8
commit
7678446ba6
@ -117,6 +117,9 @@ public final class PostFetcher extends AsyncTask<Void, Void, FeedModel> {
|
||||
.setPostId(media.getString(Constants.EXTRAS_ID))
|
||||
.setDisplayUrl(isVideo ? media.getString("video_url")
|
||||
: ResponseBodyUtils.getHighQualityImage(media))
|
||||
.setThumbnailUrl(media.getString("display_url"))
|
||||
.setImageHeight(media.getJSONObject("dimensions").getInt("height"))
|
||||
.setImageWidth(media.getJSONObject("dimensions").getInt("width"))
|
||||
.setShortCode(shortCode)
|
||||
.setPostCaption(TextUtils.isEmpty(postCaption) ? null : postCaption)
|
||||
.setProfileModel(profileModel)
|
||||
|
@ -717,12 +717,15 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
|
||||
}
|
||||
|
||||
private void setupCounts() {
|
||||
final int commentsCount = (int) feedModel.getCommentsCount();
|
||||
final String commentsString = getResources().getQuantityString(R.plurals.comments_count, commentsCount, commentsCount);
|
||||
binding.commentsCount.setText(commentsString);
|
||||
final int likesCount = (int) feedModel.getLikesCount();
|
||||
final String likesString = getResources().getQuantityString(R.plurals.likes_count, likesCount, likesCount);
|
||||
binding.likesCount.setText(likesString);
|
||||
try {
|
||||
final int commentsCount = (int) feedModel.getCommentsCount();
|
||||
final String commentsString = getResources().getQuantityString(R.plurals.comments_count, commentsCount, commentsCount);
|
||||
binding.commentsCount.setText(commentsString);
|
||||
final int likesCount = (int) feedModel.getLikesCount();
|
||||
final String likesString = getResources().getQuantityString(R.plurals.likes_count, likesCount, likesCount);
|
||||
binding.likesCount.setText(likesString);
|
||||
}
|
||||
catch (IllegalStateException e) {}
|
||||
}
|
||||
|
||||
private void setupPostTypeLayout() {
|
||||
|
@ -188,7 +188,7 @@ public class StoriesService extends BaseService {
|
||||
model.setVideoUrl(ResponseBodyUtils.getHighQualityPost(videoResources, true, true, false));
|
||||
|
||||
if (data.has("story_feed_media")) {
|
||||
model.setTappableShortCode(data.getJSONArray("story_feed_media").getJSONObject(0).optString("media_id"));
|
||||
model.setTappableShortCode(data.getJSONArray("story_feed_media").getJSONObject(0).optString("media_code"));
|
||||
}
|
||||
|
||||
// TODO: this may not be limited to spotify
|
||||
|
Loading…
Reference in New Issue
Block a user