From a1493b295d2d8451650f85b9962b3ef53bb292de Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Fri, 29 Apr 2022 18:29:01 +0600 Subject: [PATCH] 5346-Swipe_refreshing_notifier_issue issue: https://gitlab.e.foundation/e/backlog/-/issues/5346 - Disable progressBar when no item is actually loading - set progressBar's progress color to accent color --- .../src/main/java/com/fsck/k9/activity/MessageList.kt | 3 +++ .../main/java/com/fsck/k9/fragment/MessageListFragment.kt | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index f0223fbaff..a9abd17ba3 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -8,6 +8,7 @@ import android.content.Intent import android.content.IntentSender import android.content.res.Configuration import android.graphics.Color +import android.graphics.PorterDuffColorFilter import android.os.Bundle import android.os.Parcelable import android.util.TypedValue @@ -21,6 +22,7 @@ import android.widget.Toast import androidx.appcompat.app.ActionBar import androidx.appcompat.widget.SearchView import androidx.appcompat.widget.Toolbar +import androidx.core.content.ContextCompat import androidx.drawerlayout.widget.DrawerLayout import androidx.drawerlayout.widget.DrawerLayout.DrawerListener import androidx.fragment.app.FragmentManager @@ -334,6 +336,7 @@ open class MessageList : private fun initializeLayout() { progressBar = findViewById(R.id.message_list_progress) + progressBar?.progressDrawable?.colorFilter = PorterDuffColorFilter(ContextCompat.getColor(this, R.color.color_default_accent), android.graphics.PorterDuff.Mode.SRC_IN) messageViewPlaceHolder = PlaceholderFragment() } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index 246f6d9ef0..d9ed537fee 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -315,15 +315,16 @@ class MessageListFragment : } private fun setWindowProgress() { - var level = 0 if (currentFolder?.loading == true) { + var level = 0 val folderTotal = activityListener.getFolderTotal() if (folderTotal > 0) { level = (MAX_PROGRESS * activityListener.getFolderCompleted() / folderTotal).coerceAtMost(MAX_PROGRESS) } + fragmentListener.setMessageListProgress(level) + } else { + fragmentListener.setMessageListProgressEnabled(false) } - - fragmentListener.setMessageListProgress(level) } private fun setWindowTitle() { -- GitLab