Skip to content

Commit

Permalink
Merge pull request #6556 from seadowg/fix-sub-themes
Browse files Browse the repository at this point in the history
Fix theme view specific themes
  • Loading branch information
grzesiek2010 authored Jan 5, 2025
2 parents c427388 + 0d67890 commit 184e878
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.odk.collect.android.R
import org.odk.collect.android.activities.ActivityUtils
import org.odk.collect.android.activities.CrashHandlerActivity
import org.odk.collect.android.activities.FirstLaunchActivity
import org.odk.collect.android.application.FeatureFlags
import org.odk.collect.android.injection.DaggerUtils
import org.odk.collect.android.projects.ProjectSettingsDialog
import org.odk.collect.android.utilities.ThemeUtils
Expand Down Expand Up @@ -58,9 +57,7 @@ class MainMenuActivity : LocalizedActivity() {
val viewModelProvider = ViewModelProvider(this, viewModelFactory)
currentProjectViewModel = viewModelProvider[CurrentProjectViewModel::class.java]

if (!FeatureFlags.NO_THEME_SETTING) {
ThemeUtils(this).setDarkModeForCurrentProject()
}
ThemeUtils(this).setDarkModeForCurrentProject()

if (!currentProjectViewModel.hasCurrentProject()) {
super.onCreate(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import androidx.appcompat.app.AppCompatDelegate;

import org.odk.collect.android.R;
import org.odk.collect.android.application.FeatureFlags;
import org.odk.collect.android.injection.DaggerUtils;
import org.odk.collect.settings.SettingsProvider;
import org.odk.collect.settings.keys.ProjectKeys;
Expand Down Expand Up @@ -84,12 +85,12 @@ public int getSpinnerTimePickerDialogTheme() {
R.style.Theme_Collect_Light_Spinner_TimePicker_Dialog;
}

public int getAccountPickerTheme() {
return isDarkTheme() ? 0 : 1;
}

public boolean isSystemTheme() {
return getPrefsTheme().equals(context.getString(org.odk.collect.strings.R.string.app_theme_system));
if (FeatureFlags.NO_THEME_SETTING) {
return true;
} else {
return getPrefsTheme().equals(context.getString(org.odk.collect.strings.R.string.app_theme_system));
}
}

public boolean isDarkTheme() {
Expand Down

0 comments on commit 184e878

Please sign in to comment.