mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-29 00:51:44 +01:00
Hide unsubscribed folders
This commit is contained in:
@@ -20,6 +20,8 @@ package eu.faircode.email;
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Entity;
|
||||
@@ -199,6 +201,16 @@ public class EntityFolder implements Serializable {
|
||||
return R.drawable.baseline_folder_24;
|
||||
}
|
||||
|
||||
boolean isHidden(Context context) {
|
||||
if (hide)
|
||||
return true;
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean subscriptions = prefs.getBoolean("subscriptions", false);
|
||||
|
||||
return (subscriptions && subscribed != null && !subscribed);
|
||||
}
|
||||
|
||||
String getDisplayName(Context context) {
|
||||
return (display == null ? Helper.localizeFolderName(context, name) : display);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user