mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 06:31:17 +00:00
Small improvements
This commit is contained in:
parent
9fe22c7609
commit
f6199ef010
2 changed files with 16 additions and 15 deletions
|
@ -67,7 +67,6 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URL;
|
||||
import java.text.Collator;
|
||||
import java.text.DateFormat;
|
||||
|
@ -310,7 +309,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
}
|
||||
});
|
||||
|
||||
if (getSupportFragmentManager().getFragments().size() == 0) {
|
||||
if (getSupportFragmentManager().getFragments().size() == 0 &&
|
||||
!getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) {
|
||||
FragmentEx fragment = (unified ? new FragmentMessages() : new FragmentFolders());
|
||||
fragment.setArguments(new Bundle());
|
||||
|
||||
|
@ -737,7 +737,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
|
||||
new SimpleTask<Long>() {
|
||||
@Override
|
||||
protected Long onLoad(Context context, Bundle args) throws Throwable {
|
||||
protected Long onLoad(Context context, Bundle args) {
|
||||
long account = args.getLong("account");
|
||||
return DB.getInstance(context).folder().getFolderByType(account, EntityFolder.INBOX).id;
|
||||
}
|
||||
|
@ -842,9 +842,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
private void onDebugInfo() {
|
||||
new SimpleTask<Long>() {
|
||||
@Override
|
||||
protected Long onLoad(Context context, Bundle args) throws UnsupportedEncodingException {
|
||||
protected Long onLoad(Context context, Bundle args) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(context.getString(R.string.title_debug_info_remark) + "\n\n\n\n");
|
||||
sb.append(context.getString(R.string.title_debug_info_remark)).append("\n\n\n\n");
|
||||
sb.append(Helper.getAppInfo(context));
|
||||
|
||||
String body = "<pre>" + sb.toString().replaceAll("\\r?\\n", "<br />") + "</pre>";
|
||||
|
@ -1026,7 +1026,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
private void onCleanup() {
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected Void onLoad(Context context, Bundle args) throws Throwable {
|
||||
protected Void onLoad(Context context, Bundle args) {
|
||||
JobDaily.cleanup(ActivityView.this);
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1198,10 +1198,12 @@ public class FragmentMessages extends FragmentEx {
|
|||
db.folder().liveUnified().observe(getViewLifecycleOwner(), new Observer<List<TupleFolderEx>>() {
|
||||
@Override
|
||||
public void onChanged(List<TupleFolderEx> folders) {
|
||||
if (folders == null)
|
||||
folders = new ArrayList<>();
|
||||
|
||||
int unseen = 0;
|
||||
if (folders != null)
|
||||
for (TupleFolderEx folder : folders)
|
||||
unseen += folder.unseen;
|
||||
for (TupleFolderEx folder : folders)
|
||||
unseen += folder.unseen;
|
||||
String name = getString(R.string.title_folder_unified);
|
||||
if (unseen > 0)
|
||||
setSubtitle(getString(R.string.title_folder_unseen, name, unseen));
|
||||
|
@ -1275,12 +1277,11 @@ public class FragmentMessages extends FragmentEx {
|
|||
if (actionbar && viewType == AdapterMessage.ViewType.THREAD) {
|
||||
boolean hasTrash = false;
|
||||
boolean hasArchive = false;
|
||||
if (folders != null)
|
||||
for (EntityFolder folder : folders)
|
||||
if (EntityFolder.TRASH.equals(folder.type))
|
||||
hasTrash = true;
|
||||
else if (EntityFolder.ARCHIVE.equals(folder.type))
|
||||
hasArchive = true;
|
||||
for (EntityFolder folder : folders)
|
||||
if (EntityFolder.TRASH.equals(folder.type))
|
||||
hasTrash = true;
|
||||
else if (EntityFolder.ARCHIVE.equals(folder.type))
|
||||
hasArchive = true;
|
||||
|
||||
ViewModelMessages model = ViewModelProviders.of(getActivity()).get(ViewModelMessages.class);
|
||||
ViewModelMessages.Target[] pn = model.getPrevNext(thread);
|
||||
|
|
Loading…
Reference in a new issue