Browse Source

Simplification

main
M66B 6 years ago
parent
commit
3efd67b2cf
3 changed files with 1 additions and 12 deletions
  1. +0
    -4
      app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java
  2. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  3. +0
    -7
      app/src/main/java/eu/faircode/email/ViewModelBrowse.java

+ 0
- 4
app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java View File

@ -70,10 +70,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
return searching; return searching;
} }
int getLoaded() {
return model.getLoaded();
}
@Override @Override
public void onZeroItemsLoaded() { public void onZeroItemsLoaded() {
Log.i(Helper.TAG, "onZeroItemsLoaded"); Log.i(Helper.TAG, "onZeroItemsLoaded");


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -919,7 +919,7 @@ public class FragmentMessages extends FragmentEx {
@Override @Override
public void onLoaded() { public void onLoaded() {
pbWait.setVisibility(View.GONE); pbWait.setVisibility(View.GONE);
if (searchCallback.getLoaded() == 0)
if (messages.getValue().size() == 0)
tvNoEmail.setVisibility(View.VISIBLE); tvNoEmail.setVisibility(View.VISIBLE);
} }


+ 0
- 7
app/src/main/java/eu/faircode/email/ViewModelBrowse.java View File

@ -38,7 +38,6 @@ public class ViewModelBrowse extends ViewModel {
private Message[] imessages = null; private Message[] imessages = null;
private int index = -1; private int index = -1;
private int loaded = 0;
void set(Context context, long folder, String search, int pageSize) { void set(Context context, long folder, String search, int pageSize) {
this.context = context; this.context = context;
@ -47,7 +46,6 @@ public class ViewModelBrowse extends ViewModel {
this.pageSize = pageSize; this.pageSize = pageSize;
this.index = -1; this.index = -1;
this.loaded = 0;
} }
@Override @Override
@ -62,10 +60,6 @@ public class ViewModelBrowse extends ViewModel {
return context; return context;
} }
int getLoaded() {
return loaded;
}
void load() throws MessagingException, FolderClosedIOException { void load() throws MessagingException, FolderClosedIOException {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
EntityFolder folder = db.folder().getFolder(fid); EntityFolder folder = db.folder().getFolder(fid);
@ -135,7 +129,6 @@ public class ViewModelBrowse extends ViewModel {
if (message == null) { if (message == null) {
ServiceSynchronize.synchronizeMessage(context, folder, ifolder, (IMAPMessage) isub[j], search != null); ServiceSynchronize.synchronizeMessage(context, folder, ifolder, (IMAPMessage) isub[j], search != null);
count++; count++;
loaded++;
} }
} catch (MessageRemovedException ex) { } catch (MessageRemovedException ex) {
Log.w(Helper.TAG, "Boundary " + ex + "\n" + Log.getStackTraceString(ex)); Log.w(Helper.TAG, "Boundary " + ex + "\n" + Log.getStackTraceString(ex));


Loading…
Cancel
Save