mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 22:57:29 +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))
|
.setPostId(media.getString(Constants.EXTRAS_ID))
|
||||||
.setDisplayUrl(isVideo ? media.getString("video_url")
|
.setDisplayUrl(isVideo ? media.getString("video_url")
|
||||||
: ResponseBodyUtils.getHighQualityImage(media))
|
: ResponseBodyUtils.getHighQualityImage(media))
|
||||||
|
.setThumbnailUrl(media.getString("display_url"))
|
||||||
|
.setImageHeight(media.getJSONObject("dimensions").getInt("height"))
|
||||||
|
.setImageWidth(media.getJSONObject("dimensions").getInt("width"))
|
||||||
.setShortCode(shortCode)
|
.setShortCode(shortCode)
|
||||||
.setPostCaption(TextUtils.isEmpty(postCaption) ? null : postCaption)
|
.setPostCaption(TextUtils.isEmpty(postCaption) ? null : postCaption)
|
||||||
.setProfileModel(profileModel)
|
.setProfileModel(profileModel)
|
||||||
|
@ -717,6 +717,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupCounts() {
|
private void setupCounts() {
|
||||||
|
try {
|
||||||
final int commentsCount = (int) feedModel.getCommentsCount();
|
final int commentsCount = (int) feedModel.getCommentsCount();
|
||||||
final String commentsString = getResources().getQuantityString(R.plurals.comments_count, commentsCount, commentsCount);
|
final String commentsString = getResources().getQuantityString(R.plurals.comments_count, commentsCount, commentsCount);
|
||||||
binding.commentsCount.setText(commentsString);
|
binding.commentsCount.setText(commentsString);
|
||||||
@ -724,6 +725,8 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
|
|||||||
final String likesString = getResources().getQuantityString(R.plurals.likes_count, likesCount, likesCount);
|
final String likesString = getResources().getQuantityString(R.plurals.likes_count, likesCount, likesCount);
|
||||||
binding.likesCount.setText(likesString);
|
binding.likesCount.setText(likesString);
|
||||||
}
|
}
|
||||||
|
catch (IllegalStateException e) {}
|
||||||
|
}
|
||||||
|
|
||||||
private void setupPostTypeLayout() {
|
private void setupPostTypeLayout() {
|
||||||
switch (feedModel.getItemType()) {
|
switch (feedModel.getItemType()) {
|
||||||
|
@ -188,7 +188,7 @@ public class StoriesService extends BaseService {
|
|||||||
model.setVideoUrl(ResponseBodyUtils.getHighQualityPost(videoResources, true, true, false));
|
model.setVideoUrl(ResponseBodyUtils.getHighQualityPost(videoResources, true, true, false));
|
||||||
|
|
||||||
if (data.has("story_feed_media")) {
|
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
|
// TODO: this may not be limited to spotify
|
||||||
|
Loading…
Reference in New Issue
Block a user