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


Loading…
Cancel
Save