mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
Fixed displaying folders of all accounts
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user