Skip to content

Commit

Permalink
invert the if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
B0pol authored and Stypox committed Mar 18, 2021
1 parent 7f74caa commit 14648d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 8 additions & 8 deletions app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ public static int getThemeForService(final Context context, final int serviceId)
defaultTheme = R.style.BlackTheme;
} else if (selectedTheme.equals(automaticDeviceTheme)) {

if (!isDeviceDarkThemeEnabled(context)) {
// there is only one day theme
defaultTheme = R.style.LightTheme;
} else {
if (isDeviceDarkThemeEnabled(context)) {
final String selectedNightTheme = getSelectedNightThemeString(context);
if (selectedNightTheme.equals(blackTheme)) {
defaultTheme = R.style.BlackTheme;
} else {
defaultTheme = R.style.DarkTheme;
}
} else {
// there is only one day theme
defaultTheme = R.style.LightTheme;
}
}

Expand Down Expand Up @@ -213,16 +213,16 @@ public static int getSettingsThemeStyle(final Context context) {
} else if (selectedTheme.equals(darkTheme)) {
return R.style.DarkSettingsTheme;
} else if (selectedTheme.equals(automaticDeviceTheme)) {
if (!isDeviceDarkThemeEnabled(context)) {
// there is only one day theme
return R.style.LightSettingsTheme;
} else {
if (isDeviceDarkThemeEnabled(context)) {
final String selectedNightTheme = getSelectedNightThemeString(context);
if (selectedNightTheme.equals(blackTheme)) {
return R.style.BlackSettingsTheme;
} else {
return R.style.DarkSettingsTheme;
}
} else {
// there is only one day theme
return R.style.LightSettingsTheme;
}
} else {
// Fallback
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -673,5 +673,4 @@
<string name="auto_device_theme_title">Automatique (thème de l\'appareil)</string>
<string name="night_theme_summary">Choisissez votre thème nuit favori — %s</string>
<string name="select_night_theme_toast">Vous pouvez chosir votre thème nuit favori</string>
>>>>>>> b7d9cf718... use a list for night themes
</resources>

0 comments on commit 14648d1

Please sign in to comment.