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);
if (browsable == null)
return -1;
return 0;
EntityAccount account = db.account().getAccount(browsable.account);
if (account == null)
return -1;
return 0;
if (imessages == null)
try {

View File

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