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

TECH: (Silinsky) add dark mode screenshots support #522

Merged
merged 3 commits into from
Jun 6, 2023
Merged

Conversation

ReCursia
Copy link
Collaborator

@ReCursia ReCursia commented Jun 2, 2023

Closes #502

@CLAassistant
Copy link

CLAassistant commented Jun 2, 2023

CLA assistant check
All committers have signed the CLA.

import org.junit.runner.Description
import org.junit.runners.model.Statement

class ThemeRule internal constructor(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would narrow down the name to tell user that this rule is used to toggle dark mode, not the whole theme

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've changed

import org.junit.runners.model.Statement

class ThemeRule internal constructor(
private val changeAppTheme: Boolean,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for argument

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed

base.evaluate()
}
} finally {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to save preferences before test and restore it after instead of setting "follow system" unconditionally

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed to use UNSPECIFIED, this is default value and also used to "reset" chosen night mode in app

@ReCursia ReCursia changed the title TECH: (Silinsky) add dark mode prototype TECH: (Silinsky) add dark mode screenshots support Jun 4, 2023
@ReCursia ReCursia merged commit 878f14a into master Jun 6, 2023
@Nikitae57 Nikitae57 deleted the TECH-dark-mode branch June 6, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screenshot tests for dark\light modes
3 participants