Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix theme view specific themes #6556

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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