Small improvement

This commit is contained in:
M66B 2019-06-07 19:41:23 +02:00
parent f5132de1f4
commit 1e9f979364
2 changed files with 11 additions and 10 deletions

View File

@ -229,11 +229,11 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
final EntityFolder browsable = db.folder().getBrowsableFolder(folder, query != null); final EntityFolder browsable = db.folder().getBrowsableFolder(folder, query != null);
if (browsable == null) if (browsable == null)
return -1; return 0;
EntityAccount account = db.account().getAccount(browsable.account); EntityAccount account = db.account().getAccount(browsable.account);
if (account == null) if (account == null)
return -1; return 0;
if (imessages == null) if (imessages == null)
try { try {

View File

@ -2654,17 +2654,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
public void onLoading() { public void onLoading() {
loading = true; loading = true;
pbWait.setVisibility(View.VISIBLE); pbWait.setVisibility(View.VISIBLE);
tvNoEmail.setVisibility(View.GONE);
} }
@Override @Override
public void onLoaded(int fetched) { public void onLoaded(int fetched) {
loading = false; loading = false;
pbWait.setVisibility(View.GONE);
Integer submitted = (Integer) rvMessage.getTag(); Integer submitted = (Integer) rvMessage.getTag();
if (submitted == null) if (submitted == null)
submitted = 0; return;
if (submitted + fetched == 0 && fetched >= 0)
pbWait.setVisibility(View.GONE);
if (submitted + fetched == 0)
tvNoEmail.setVisibility(View.VISIBLE); tvNoEmail.setVisibility(View.VISIBLE);
} }
@ -2705,12 +2707,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
rvMessage.setTag(messages.size()); rvMessage.setTag(messages.size());
boolean hasBoundary = (viewType == AdapterMessage.ViewType.FOLDER || viewType == AdapterMessage.ViewType.SEARCH); if (!loading) {
if (!hasBoundary || !loading)
pbWait.setVisibility(View.GONE); pbWait.setVisibility(View.GONE);
if (!hasBoundary && messages.size() == 0) if (messages.size() == 0)
tvNoEmail.setVisibility(View.VISIBLE); tvNoEmail.setVisibility(View.VISIBLE);
}
if (messages.size() > 0) { if (messages.size() > 0) {
tvNoEmail.setVisibility(View.GONE); tvNoEmail.setVisibility(View.GONE);
grpReady.setVisibility(View.VISIBLE); grpReady.setVisibility(View.VISIBLE);