From 654f0654a1d13d00a826979ef3bb24999e5c1f74 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Wed, 25 Sep 2024 10:16:10 +0530 Subject: [PATCH] Show loading indicator only on initial load --- .../kotlin/org/fossify/gallery/activities/MediaActivity.kt | 7 ++++++- app/src/main/res/layout/activity_media.xml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt index 8e03980e6..cb120b8f8 100644 --- a/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt @@ -49,6 +49,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private var mAllowPickingMultiple = false private var mShowAll = false private var mLoadedInitialPhotos = false + private var mShowLoadingIndicator = false private var mWasFullscreenViewOpen = false private var mLastSearchedText = "" private var mLatestMediaId = 0L @@ -395,7 +396,11 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } } - binding.loadingIndicator.show() + if (mShowLoadingIndicator) { + binding.loadingIndicator.show() + mShowLoadingIndicator = false + } + getMedia() setupLayoutManager() } diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index daebcb237..39691bb59 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -20,7 +20,7 @@ android:visibility="gone" app:hideAnimationBehavior="inward" app:showAnimationBehavior="outward" - app:showDelay="500" + app:showDelay="300" tools:visibility="visible" />