Skip to content

Commit

Permalink
remove redundant argument
Browse files Browse the repository at this point in the history
  • Loading branch information
john-peterson committed Sep 26, 2024
1 parent 36d811e commit b6ddafd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.termux.R;
import com.termux.app.TermuxActivity;
import com.termux.shared.termux.shell.command.runner.terminal.TermuxSession;
import com.termux.shared.theme.NightMode;
import com.termux.shared.theme.ThemeUtils;
import com.termux.terminal.TerminalSession;

Expand Down Expand Up @@ -57,7 +56,7 @@ public View getView(int position, View convertView, @NonNull ViewGroup parent) {
return sessionRowView;
}

boolean shouldEnableDarkTheme = ThemeUtils.shouldEnableDarkTheme(mActivity, NightMode.getAppNightMode().getName());
boolean shouldEnableDarkTheme = ThemeUtils.shouldEnableDarkTheme(mActivity);

if (shouldEnableDarkTheme) {
sessionTitleView.setBackground(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ public static boolean isNightModeEnabled(Context context) {

/** Will return true if mode is set to {@link NightMode#TRUE}, otherwise will return true if
* mode is set to {@link NightMode#SYSTEM} and night mode is enabled by system. */
public static boolean shouldEnableDarkTheme(Context context, String name) {
if (NightMode.TRUE.getName().equals(name))
public static boolean shouldEnableDarkTheme(Context context) {
String setting = NightMode.getAppNightMode().getName();
if (NightMode.TRUE.getName().equals(setting))
return true;
else if (NightMode.FALSE.getName().equals(name))
else if (NightMode.FALSE.getName().equals(setting))
return false;
else if (NightMode.SYSTEM.getName().equals(name)) {
return isNightModeEnabled(context);
Expand Down

0 comments on commit b6ddafd

Please sign in to comment.