From e54f200bdef5169b465e312064078ecd12a4488b Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 27 Jan 2019 14:14:32 +0000 Subject: [PATCH] Small behavior improvement --- .../main/java/eu/faircode/email/FragmentMessages.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 8d7e72f1e1..92e469c574 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -1748,6 +1748,8 @@ public class FragmentMessages extends FragmentBase { new BoundaryCallbackMessages.IBoundaryCallbackMessages() { @Override public void onLoading() { + pbWait.setTag(true); + tvNoEmail.setVisibility(View.GONE); pbWait.setVisibility(View.VISIBLE); } @@ -1757,6 +1759,7 @@ public class FragmentMessages extends FragmentBase { int items = (adapter == null ? 0 : adapter.getItemCount()); tvNoEmail.setVisibility(items + fetched == 0 ? View.VISIBLE : View.GONE); pbWait.setVisibility(View.GONE); + pbWait.setTag(null); } @Override @@ -1976,10 +1979,10 @@ public class FragmentMessages extends FragmentBase { Log.i("Submit messages=" + messages.size()); adapter.submitList(messages); - if (messages.size() > 0 || - !(viewType == AdapterMessage.ViewType.FOLDER || viewType == AdapterMessage.ViewType.SEARCH)) { + if (pbWait.getTag() == null) { pbWait.setVisibility(View.GONE); - tvNoEmail.setVisibility(messages.size() == 0 ? View.VISIBLE : View.GONE); + if (!(viewType == AdapterMessage.ViewType.FOLDER || viewType == AdapterMessage.ViewType.SEARCH)) + tvNoEmail.setVisibility(messages.size() == 0 ? View.VISIBLE : View.GONE); grpReady.setVisibility(messages.size() > 0 ? View.VISIBLE : View.GONE); } }