mirror of https://github.com/M66B/FairEmail.git
Added primary inbox start screen
This commit is contained in:
parent
704a994c7d
commit
6c52d14966
|
@ -779,6 +779,33 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
private void init() {
|
||||
Bundle args = new Bundle();
|
||||
|
||||
if ("inbox".equals(startup)) {
|
||||
new SimpleTask<EntityFolder>() {
|
||||
@Override
|
||||
protected EntityFolder onExecute(Context context, Bundle args) throws Throwable {
|
||||
DB db = DB.getInstance(context);
|
||||
return db.folder().getFolderPrimary(EntityFolder.INBOX);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, EntityFolder inbox) {
|
||||
FragmentBase fragment = new FragmentMessages();
|
||||
if (inbox != null) {
|
||||
args.putLong("account", inbox.account);
|
||||
args.putLong("folder", inbox.id);
|
||||
}
|
||||
fragment.setArguments(args);
|
||||
setFragment(fragment);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex);
|
||||
}
|
||||
}.execute(this, new Bundle(), "primary");
|
||||
return;
|
||||
}
|
||||
|
||||
FragmentBase fragment;
|
||||
switch (startup) {
|
||||
case "accounts":
|
||||
|
@ -798,7 +825,10 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
}
|
||||
|
||||
fragment.setArguments(args);
|
||||
setFragment(fragment);
|
||||
}
|
||||
|
||||
private void setFragment(Fragment fragment) {
|
||||
FragmentManager fm = getSupportFragmentManager();
|
||||
FragmentTransaction fragmentTransaction = fm.beginTransaction();
|
||||
for (Fragment existing : fm.getFragments())
|
||||
|
|
|
@ -245,8 +245,8 @@ public interface DaoFolder {
|
|||
" JOIN account ON account.id = folder.account" +
|
||||
" WHERE account.synchronize" +
|
||||
" AND account.`primary`" +
|
||||
" AND type = '" + EntityFolder.DRAFTS + "'")
|
||||
EntityFolder getPrimaryDrafts();
|
||||
" AND type = :type")
|
||||
EntityFolder getFolderPrimary(String type);
|
||||
|
||||
@Query("SELECT * FROM folder WHERE type = '" + EntityFolder.OUTBOX + "'")
|
||||
EntityFolder getOutbox();
|
||||
|
|
|
@ -267,7 +267,7 @@ public class FragmentDialogIdentity extends FragmentDialogBase {
|
|||
|
||||
DB db = DB.getInstance(context);
|
||||
if (account < 0)
|
||||
return db.folder().getPrimaryDrafts();
|
||||
return db.folder().getFolderPrimary(EntityFolder.DRAFTS);
|
||||
else
|
||||
return db.folder().getFolderByType(account, EntityFolder.DRAFTS);
|
||||
}
|
||||
|
|
|
@ -2551,6 +2551,7 @@
|
|||
<item>folders</item>
|
||||
<item>primary</item>
|
||||
<item>accounts</item>
|
||||
<item>inbox</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="startupNames">
|
||||
|
@ -2558,6 +2559,7 @@
|
|||
<item>Unified folders</item>
|
||||
<item>Primary account folders</item>
|
||||
<item>Accounts</item>
|
||||
<item>Primary inbox</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="downloadNames">
|
||||
|
|
Loading…
Reference in New Issue