Browse Source

Fixed displaying folders of all accounts

main
M66B 6 years ago
parent
commit
0c1ea6c623
40 changed files with 19 additions and 46 deletions
  1. +2
    -4
      app/src/main/java/eu/faircode/email/DaoFolder.java
  2. +15
    -3
      app/src/main/java/eu/faircode/email/FragmentFolders.java
  3. +2
    -2
      app/src/main/java/eu/faircode/email/FragmentMessage.java
  4. +0
    -1
      app/src/main/res/values-af/strings.xml
  5. +0
    -1
      app/src/main/res/values-ar-rBH/strings.xml
  6. +0
    -1
      app/src/main/res/values-ar-rEG/strings.xml
  7. +0
    -1
      app/src/main/res/values-ar-rSA/strings.xml
  8. +0
    -1
      app/src/main/res/values-ar-rYE/strings.xml
  9. +0
    -1
      app/src/main/res/values-ar/strings.xml
  10. +0
    -1
      app/src/main/res/values-ca/strings.xml
  11. +0
    -1
      app/src/main/res/values-cs/strings.xml
  12. +0
    -1
      app/src/main/res/values-da/strings.xml
  13. +0
    -1
      app/src/main/res/values-de/strings.xml
  14. +0
    -1
      app/src/main/res/values-el/strings.xml
  15. +0
    -1
      app/src/main/res/values-en/strings.xml
  16. +0
    -1
      app/src/main/res/values-es-rES/strings.xml
  17. +0
    -1
      app/src/main/res/values-fi/strings.xml
  18. +0
    -1
      app/src/main/res/values-fr/strings.xml
  19. +0
    -1
      app/src/main/res/values-he/strings.xml
  20. +0
    -1
      app/src/main/res/values-hu/strings.xml
  21. +0
    -1
      app/src/main/res/values-it/strings.xml
  22. +0
    -1
      app/src/main/res/values-iw/strings.xml
  23. +0
    -1
      app/src/main/res/values-ja/strings.xml
  24. +0
    -1
      app/src/main/res/values-ko/strings.xml
  25. +0
    -1
      app/src/main/res/values-nb/strings.xml
  26. +0
    -1
      app/src/main/res/values-nl/strings.xml
  27. +0
    -1
      app/src/main/res/values-no/strings.xml
  28. +0
    -1
      app/src/main/res/values-pl/strings.xml
  29. +0
    -1
      app/src/main/res/values-pt-rBR/strings.xml
  30. +0
    -1
      app/src/main/res/values-pt-rPT/strings.xml
  31. +0
    -1
      app/src/main/res/values-ro/strings.xml
  32. +0
    -1
      app/src/main/res/values-ru/strings.xml
  33. +0
    -1
      app/src/main/res/values-sr/strings.xml
  34. +0
    -1
      app/src/main/res/values-sv-rSE/strings.xml
  35. +0
    -1
      app/src/main/res/values-tr/strings.xml
  36. +0
    -1
      app/src/main/res/values-uk/strings.xml
  37. +0
    -1
      app/src/main/res/values-vi/strings.xml
  38. +0
    -1
      app/src/main/res/values-zh-rCN/strings.xml
  39. +0
    -1
      app/src/main/res/values-zh-rTW/strings.xml
  40. +0
    -1
      app/src/main/res/values/strings.xml

+ 2
- 4
app/src/main/java/eu/faircode/email/DaoFolder.java View File

@ -45,11 +45,9 @@ public interface DaoFolder {
" FROM folder" +
" LEFT JOIN account ON account.id = folder.account" +
" LEFT JOIN message ON message.folder = folder.id AND NOT message.ui_hide" +
" WHERE folder.account = :account" +
" GROUP BY folder.id")
LiveData<List<TupleFolderEx>> liveFolders();
@Query("SELECT * FROM folder WHERE account = :account")
LiveData<List<EntityFolder>> liveFolders(long account);
LiveData<List<TupleFolderEx>> liveFolders(long account);
@Query("SELECT folder.* FROM folder WHERE folder.id = :id")
LiveData<EntityFolder> liveFolder(long id);


+ 15
- 3
app/src/main/java/eu/faircode/email/FragmentFolders.java View File

@ -46,10 +46,12 @@ public class FragmentFolders extends FragmentEx {
@Override
@Nullable
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
setSubtitle(R.string.title_list_folders);
View view = inflater.inflate(R.layout.fragment_folders, container, false);
// Get arguments
Bundle args = getArguments();
long account = (args == null ? -1 : args.getLong("account"));
// Get controls
rvFolder = view.findViewById(R.id.rvFolder);
pbWait = view.findViewById(R.id.pbWait);
@ -76,8 +78,18 @@ public class FragmentFolders extends FragmentEx {
grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE);
DB db = DB.getInstance(getContext());
// Observe account
db.account().liveAccount(account).observe(this, new Observer<EntityAccount>() {
@Override
public void onChanged(@Nullable EntityAccount account) {
setSubtitle(account.name);
}
});
// Observe folders
DB.getInstance(getContext()).folder().liveFolders().observe(this, new Observer<List<TupleFolderEx>>() {
db.folder().liveFolders(account).observe(this, new Observer<List<TupleFolderEx>>() {
@Override
public void onChanged(@Nullable List<TupleFolderEx> folders) {
adapter.set(folders);


+ 2
- 2
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -266,9 +266,9 @@ public class FragmentMessage extends FragmentEx {
bottom_navigation.setTag(message.folderType);
db.folder().liveFolders(message.account).removeObservers(FragmentMessage.this);
db.folder().liveFolders(message.account).observe(FragmentMessage.this, new Observer<List<EntityFolder>>() {
db.folder().liveFolders(message.account).observe(FragmentMessage.this, new Observer<List<TupleFolderEx>>() {
@Override
public void onChanged(@Nullable final List<EntityFolder> folders) {
public void onChanged(@Nullable final List<TupleFolderEx> folders) {
boolean hasTrash = false;
boolean hasJunk = false;
boolean hasArchive = false;


+ 0
- 1
app/src/main/res/values-af/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ar-rBH/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ar-rEG/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ar-rSA/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ar-rYE/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ar/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ca/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-cs/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-da/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-de/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Konten</string>
<string name="title_list_identities">Identitäten</string>
<string name="title_list_folders">Ordner</string>
<string name="title_edit_account">Konto bearbeiten</string>
<string name="title_edit_identity">Identität bearbeiten</string>
<string name="title_edit_folder">Ordner bearbeiten</string>


+ 0
- 1
app/src/main/res/values-el/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-en/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-es-rES/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-fi/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-fr/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-he/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-hu/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-it/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-iw/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ja/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ko/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-nb/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-nl/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-no/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-pl/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-pt-rBR/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Versão %1$s</string>
<string name="title_list_accounts">Contas</string>
<string name="title_list_identities">Identidades</string>
<string name="title_list_folders">Pastas</string>
<string name="title_edit_account">Editar conta</string>
<string name="title_edit_identity">Editar identidade</string>
<string name="title_edit_folder">Editar pasta</string>


+ 0
- 1
app/src/main/res/values-pt-rPT/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-ro/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Versiunea %1$s</string>
<string name="title_list_accounts">Conturi</string>
<string name="title_list_identities">Identități</string>
<string name="title_list_folders">Dosare</string>
<string name="title_edit_account">Editare cont</string>
<string name="title_edit_identity">Editare identitate</string>
<string name="title_edit_folder">Editare dosar</string>


+ 0
- 1
app/src/main/res/values-ru/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-sr/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-sv-rSE/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-tr/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-uk/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-vi/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-zh-rCN/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values-zh-rTW/strings.xml View File

@ -17,7 +17,6 @@
<string name="title_version">Version %1$s</string>
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>
<string name="title_edit_folder">Edit folder</string>


+ 0
- 1
app/src/main/res/values/strings.xml View File

@ -23,7 +23,6 @@
<string name="title_list_accounts">Accounts</string>
<string name="title_list_identities">Identities</string>
<string name="title_list_folders">Folders</string>
<string name="title_edit_account">Edit account</string>
<string name="title_edit_identity">Edit identity</string>


Loading…
Cancel
Save