From 45db8c19aa381b5ab059bae086eff0722a812e31 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Tue, 24 Sep 2024 22:19:41 +0530 Subject: [PATCH] Show loading indicator when loading many items --- .../org/fossify/gallery/activities/MediaActivity.kt | 3 +++ app/src/main/res/layout/activity_media.xml | 13 +++++++++++++ 2 files changed, 16 insertions(+) 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 2298d314b..8e03980e6 100644 --- a/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/org/fossify/gallery/activities/MediaActivity.kt @@ -164,6 +164,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { timeFormat = getTimeFormat() } + binding.loadingIndicator.setIndicatorColor(getProperPrimaryColor()) binding.mediaEmptyTextPlaceholder.setTextColor(getProperTextColor()) binding.mediaEmptyTextPlaceholder2.setTextColor(getProperPrimaryColor()) binding.mediaEmptyTextPlaceholder2.bringToFront() @@ -394,6 +395,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } } + binding.loadingIndicator.show() getMedia() setupLayoutManager() } @@ -858,6 +860,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { mMedia = media runOnUiThread { + binding.loadingIndicator.hide() binding.mediaRefreshLayout.isRefreshing = false binding.mediaEmptyTextPlaceholder.beVisibleIf(media.isEmpty() && !isFromCache) binding.mediaEmptyTextPlaceholder2.beVisibleIf(media.isEmpty() && !isFromCache) diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index f7d805868..daebcb237 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -1,6 +1,7 @@ @@ -10,6 +11,18 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> + +