fix nullability of getDarkThemeMode function

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2023-10-10 16:37:53 +02:00
parent 95453d8612
commit ff6919124a
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF
2 changed files with 8 additions and 2 deletions

View file

@ -437,7 +437,13 @@ public final class AppPreferencesImpl implements AppPreferences {
@Override
public boolean isDarkModeEnabled() {
return getDarkThemeMode() == DarkMode.DARK;
DarkMode darkMode = getDarkThemeMode();
if (darkMode != null) {
return getDarkThemeMode() == DarkMode.DARK;
} else {
return false;
}
}
@Override

View file

@ -856,7 +856,7 @@ public final class DisplayUtils {
stopShimmer(shimmerThumbnail, thumbnailView);
boolean isAutoUploadFolder = SyncedFolderProvider.isAutoUploadFolder(syncedFolderProvider, file, user);
boolean isDarkModeActive = preferences.getDarkThemeMode() == DarkMode.DARK;
boolean isDarkModeActive = preferences.isDarkModeEnabled();
Integer overlayIconId = file.getFileOverlayIconId(isAutoUploadFolder);
LayerDrawable fileIcon = MimeTypeUtil.getFileIcon(isDarkModeActive, overlayIconId, context, viewThemeUtils);