diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java
index 3750760bf3..b050f010c4 100644
--- a/app/src/main/java/eu/faircode/email/ActivityView.java
+++ b/app/src/main/java/eu/faircode/email/ActivityView.java
@@ -102,6 +102,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
private RecyclerView rvAccount;
private ImageButton ibExpanderUnified;
private RecyclerView rvUnified;
+ private ImageButton ibExpanderFolder;
private RecyclerView rvFolder;
private RecyclerView rvMenu;
private ImageButton ibExpanderExtra;
@@ -321,11 +322,28 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
});
// Navigation folders
+ ibExpanderFolder = drawerContainer.findViewById(R.id.ibExpanderFolder);
+
rvFolder = drawerContainer.findViewById(R.id.rvFolder);
rvFolder.setLayoutManager(new LinearLayoutManager(this));
adapterNavFolder = new AdapterNavFolder(this, this);
rvFolder.setAdapter(adapterNavFolder);
+ boolean nav_folder = prefs.getBoolean("nav_folder", true);
+ ibExpanderFolder.setImageLevel(nav_folder ? 0 /* less */ : 1 /* more */);
+ rvFolder.setVisibility(nav_folder ? View.VISIBLE : View.GONE);
+
+ ibExpanderFolder.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ boolean nav_folder = !prefs.getBoolean("nav_folder", true);
+ prefs.edit().putBoolean("nav_folder", nav_folder).apply();
+ ibExpanderFolder.setImageLevel(nav_folder ? 0 /* less */ : 1 /* more */);
+ rvFolder.setVisibility(nav_folder ? View.VISIBLE : View.GONE);
+ }
+ });
+
+ // Menus
rvMenu = drawerContainer.findViewById(R.id.rvMenu);
rvMenu.setLayoutManager(new LinearLayoutManager(this));
adapterNavMenu = new AdapterNavMenu(this, this);
diff --git a/app/src/main/res/layout/include_nav.xml b/app/src/main/res/layout/include_nav.xml
index 597bd3c5a2..9e8fcffc1b 100644
--- a/app/src/main/res/layout/include_nav.xml
+++ b/app/src/main/res/layout/include_nav.xml
@@ -65,6 +65,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rvUnified" />
+
+
+ app:layout_constraintTop_toBottomOf="@id/ibExpanderFolder" />