mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Show correct image in the gallery in ViewRedditGalleryActivity.
This commit is contained in:
parent
2d62332e8d
commit
2eaf8a8a01
@ -169,14 +169,14 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA
|
||||
haulerView.setDragEnabled(false);
|
||||
}
|
||||
|
||||
setupViewPager();
|
||||
setupViewPager(savedInstanceState);
|
||||
}
|
||||
|
||||
public boolean isUseBottomAppBar() {
|
||||
return useBottomAppBar;
|
||||
}
|
||||
|
||||
private void setupViewPager() {
|
||||
private void setupViewPager(Bundle savedInstanceState) {
|
||||
if (!useBottomAppBar) {
|
||||
setToolbarTitle(0);
|
||||
viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||
@ -189,6 +189,9 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA
|
||||
sectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
||||
viewPager.setAdapter(sectionsPagerAdapter);
|
||||
viewPager.setOffscreenPageLimit(3);
|
||||
if (savedInstanceState == null) {
|
||||
viewPager.setCurrentItem(getIntent().getIntExtra(EXTRA_GALLERY_ITEM_INDEX, 0), false);
|
||||
}
|
||||
}
|
||||
|
||||
private void setToolbarTitle(int position) {
|
||||
|
Loading…
Reference in New Issue
Block a user