mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-14 10:47:30 +00:00
restore slider position on resume
This commit is contained in:
parent
10447cd633
commit
bf1a05a38c
@ -294,7 +294,7 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Media media = (Media) feedModelSerializable;
|
final Media media = (Media) feedModelSerializable;
|
||||||
if (media.getMediaType() == MediaItemType.MEDIA_TYPE_SLIDER) {
|
if (media.getMediaType() == MediaItemType.MEDIA_TYPE_SLIDER && sliderPosition == -1) {
|
||||||
sliderPosition = arguments.getInt(ARG_SLIDER_POSITION, 0);
|
sliderPosition = arguments.getInt(ARG_SLIDER_POSITION, 0);
|
||||||
}
|
}
|
||||||
viewModel.setMedia(media);
|
viewModel.setMedia(media);
|
||||||
@ -1039,6 +1039,7 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme
|
|||||||
final String text = "1/" + carouselMedia.size();
|
final String text = "1/" + carouselMedia.size();
|
||||||
binding.mediaCounter.setText(text);
|
binding.mediaCounter.setText(text);
|
||||||
sliderItemsAdapter.submitList(media.getCarouselMedia());
|
sliderItemsAdapter.submitList(media.getCarouselMedia());
|
||||||
|
sliderParent.setCurrentItem(sliderPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pauseSliderPlayer() {
|
private void pauseSliderPlayer() {
|
||||||
|
Loading…
Reference in New Issue
Block a user