1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 22:57:29 +00:00
This commit is contained in:
Austin Huang 2020-12-23 14:29:45 -05:00
parent 40da4baf01
commit 61e7e5671e
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
4 changed files with 12 additions and 6 deletions

View File

@ -226,13 +226,13 @@ public final class FollowViewerFragment extends Fragment implements SwipeRefresh
lazyLoader = new RecyclerLazyLoader(layoutManager, (page, totalItemsCount) -> { lazyLoader = new RecyclerLazyLoader(layoutManager, (page, totalItemsCount) -> {
if (!TextUtils.isEmpty(endCursor)) { if (!TextUtils.isEmpty(endCursor)) {
binding.swipeRefreshLayout.setRefreshing(true); binding.swipeRefreshLayout.setRefreshing(true);
layoutManager.setStackFromEnd(true);
friendshipService.getList(isFollowersList, profileId, endCursor, cb); friendshipService.getList(isFollowersList, profileId, endCursor, cb);
} }
endCursor = null; endCursor = null;
}); });
binding.rvFollow.addOnScrollListener(lazyLoader); binding.rvFollow.addOnScrollListener(lazyLoader);
binding.rvFollow.setLayoutManager(layoutManager); binding.rvFollow.setLayoutManager(layoutManager);
layoutManager.setStackFromEnd(true);
if (moreAvailable) { if (moreAvailable) {
binding.swipeRefreshLayout.setRefreshing(true); binding.swipeRefreshLayout.setRefreshing(true);
friendshipService.getList(isFollowersList, profileId, endCursor, cb); friendshipService.getList(isFollowersList, profileId, endCursor, cb);

View File

@ -714,6 +714,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
binding.date.setText(Utils.datetimeParser.format(new Date(feedModel.getTimestamp() * 1000L))); binding.date.setText(Utils.datetimeParser.format(new Date(feedModel.getTimestamp() * 1000L)));
if (TextUtils.isEmpty(postCaption)) { if (TextUtils.isEmpty(postCaption)) {
binding.caption.setVisibility(View.GONE); binding.caption.setVisibility(View.GONE);
binding.translateTitle.setVisibility(View.GONE);
binding.captionToggle.setVisibility(View.GONE); binding.captionToggle.setVisibility(View.GONE);
return; return;
} }
@ -751,7 +752,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment {
if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED) return; if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED) return;
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}); });
if (TextUtils.isEmpty(feedModel.getCaptionId()) || TextUtils.isEmpty(feedModel.getPostCaption())) if (TextUtils.isEmpty(feedModel.getCaptionId()))
binding.translateTitle.setVisibility(View.GONE); binding.translateTitle.setVisibility(View.GONE);
else binding.translateTitle.setOnClickListener(v -> { else binding.translateTitle.setOnClickListener(v -> {
mediaService.translate(feedModel.getCaptionId(), "1", new ServiceCallback<String>() { mediaService.translate(feedModel.getCaptionId(), "1", new ServiceCallback<String>() {

View File

@ -666,7 +666,9 @@ public final class ResponseBodyUtils {
break; break;
case MEDIA_TYPE_SLIDER: case MEDIA_TYPE_SLIDER:
final List<PostChild> childPosts = getChildPosts(itemJson); final List<PostChild> childPosts = getChildPosts(itemJson);
feedModelBuilder.setSliderItems(childPosts); feedModelBuilder.setSliderItems(childPosts)
.setImageHeight(childPosts.get(0).getHeight())
.setImageWidth(childPosts.get(0).getWidth());
break; break;
} }
return feedModelBuilder.build(); return feedModelBuilder.build();
@ -783,7 +785,9 @@ public final class ResponseBodyUtils {
final JSONArray children = sidecar.optJSONArray("edges"); final JSONArray children = sidecar.optJSONArray("edges");
if (children != null) { if (children != null) {
final List<PostChild> sliderItems = getSliderItems(children); final List<PostChild> sliderItems = getSliderItems(children);
feedModelBuilder.setSliderItems(sliderItems); feedModelBuilder.setSliderItems(sliderItems)
.setImageHeight(sliderItems.get(0).getHeight())
.setImageWidth(sliderItems.get(0).getWidth());
} }
} }
} }

View File

@ -276,13 +276,14 @@
<string name="light_bibliogram_theme" translatable="false">Bibliogram</string> <string name="light_bibliogram_theme" translatable="false">Bibliogram</string>
<string name="dark_material_dark_theme">Material Dark</string> <string name="dark_material_dark_theme">Material Dark</string>
<string name="added_to_favs">Added to Favorites</string> <string name="added_to_favs">Added to Favorites</string>
<string name="add_to_favorites">Add to favorites</string> <string name="added_to_favs_short" comment="Here it's an adjective (equivalent to verb past tense), used for the favorite chip on profile/hashtag/location fragments, so be short">Favorited</string>
<string name="add_to_favorites" comment="Here it's a verb, used for the favorite chip on profile/hashtag/location fragments, so be short">Favorite</string>
<string name="accounts">Accounts</string> <string name="accounts">Accounts</string>
<string name="hashtags">Hashtags</string> <string name="hashtags">Hashtags</string>
<string name="locations">Locations</string> <string name="locations">Locations</string>
<string name="unknown">Unknown</string> <string name="unknown">Unknown</string>
<string name="removed_from_favs">Removed from Favourites</string> <string name="removed_from_favs">Removed from Favourites</string>
<string name="backup_and_restore">Backup &amp; Restore</string> <string name="backup_and_restore">Settings Backup</string>
<string name="create_backup">Create</string> <string name="create_backup">Create</string>
<string name="restore_backup">Restore</string> <string name="restore_backup">Restore</string>
<string name="file_chosen_label">File:</string> <string name="file_chosen_label">File:</string>