Merge pull request #12028 from nextcloud/bugfix/wrong-icon-overlay-colors-on-OS-theme

Fix wrong icon overlay colors on OS theme
This commit is contained in:
Andy Scherzinger 2023-10-13 16:47:55 +02:00 committed by GitHub
commit 24c522c8a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,7 @@ package com.nextcloud.client.preferences;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import com.google.gson.Gson;
import com.nextcloud.appReview.AppReviewShownModel;
@ -437,7 +438,14 @@ public final class AppPreferencesImpl implements AppPreferences {
@Override
public boolean isDarkModeEnabled() {
return getDarkThemeMode() == DarkMode.DARK;
DarkMode mode = getDarkThemeMode();
if (mode == DarkMode.SYSTEM) {
int currentNightMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
return currentNightMode == Configuration.UI_MODE_NIGHT_YES;
}
return mode == DarkMode.DARK;
}
@Override