From 020ea47a06a465b1602e45e7cc16495e16e7148f Mon Sep 17 00:00:00 2001 From: Luca Stefani Date: Wed, 9 Aug 2023 11:58:31 +0200 Subject: [PATCH] Glimpse: Preload 2 pages on either side of current page Better user experience while scrolling Change-Id: Ic707c2f37a4cef1954be604e990e3bcab7778f4c --- .../java/org/lineageos/glimpse/fragments/MediaViewerFragment.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/lineageos/glimpse/fragments/MediaViewerFragment.kt b/app/src/main/java/org/lineageos/glimpse/fragments/MediaViewerFragment.kt index 13b66b0..c4592cc 100644 --- a/app/src/main/java/org/lineageos/glimpse/fragments/MediaViewerFragment.kt +++ b/app/src/main/java/org/lineageos/glimpse/fragments/MediaViewerFragment.kt @@ -294,6 +294,7 @@ class MediaViewerFragment : Fragment( } viewPager.adapter = mediaViewerAdapter + viewPager.offscreenPageLimit = 2 viewPager.registerOnPageChangeCallback(onPageChangeCallback) shareButton.setOnClickListener {