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

Add dark theme setting for settings screen #339

Merged

Conversation

yagipy
Copy link
Contributor

@yagipy yagipy commented Mar 10, 2021

Issue

Overview (Required)

  • Add dark theme setting for settings screen.
  • No special support is provided for devices with API level 29 or earlier.
    • I believe that the power saving mode is part of the device settings.
    • Therefore, I think "follow device settings" is sufficient, not "only in power saving mode".
    • If necessary, I will create the issue.

Problem

  • The splash screen is not referencing the in-app theme. (Device settings will be referenced).
    • I want you to check the reviews.
    • If necessary, I will create the issue.

Links

Screenshot

Before After

@yagipy yagipy force-pushed the add-dark-theme-setting-for-settings-screen branch from 6c3a3b6 to d456b6c Compare March 10, 2021 00:18
@github-actions github-actions bot temporarily deployed to deploygate-distribution March 10, 2021 00:42 Inactive
import kotlinx.coroutines.flow.StateFlow

interface SettingViewModel :
UnidirectionalViewModel<SettingViewModel.Event, SettingViewModel.Effect, SettingViewModel.State> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we have a ktlint failure here due to chars are more than 100 in a line.
Exceeded max line length (100)
You can simply break them into multiple lines to pass the GitHub checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anandwana001
Thanks, I fixed it.

@yagipy yagipy changed the title [WIP]Add dark theme setting for settings screen Add dark theme setting for settings screen Mar 10, 2021
@yagipy yagipy marked this pull request as ready for review March 10, 2021 19:07
@github-actions github-actions bot temporarily deployed to deploygate-distribution March 10, 2021 19:42 Inactive
@github-actions github-actions bot temporarily deployed to deploygate-distribution March 10, 2021 19:52 Inactive
@yagipy yagipy force-pushed the add-dark-theme-setting-for-settings-screen branch from 58765b4 to 117ccb3 Compare March 10, 2021 19:58
@github-actions github-actions bot temporarily deployed to deploygate-distribution March 10, 2021 20:05 Inactive
@yagipy yagipy force-pushed the add-dark-theme-setting-for-settings-screen branch 2 times, most recently from 7718501 to 9b74b7f Compare March 10, 2021 20:18
@github-actions github-actions bot temporarily deployed to deploygate-distribution March 10, 2021 20:18 Inactive
@yagipy yagipy force-pushed the add-dark-theme-setting-for-settings-screen branch from 9b74b7f to e54d515 Compare March 10, 2021 20:24
@github-actions github-actions bot temporarily deployed to deploygate-distribution March 10, 2021 20:26 Inactive
@github-actions github-actions bot temporarily deployed to deploygate-distribution March 10, 2021 20:31 Inactive
@takahirom
Copy link
Member

👀

Copy link
Member

@takahirom takahirom left a comment

Choose a reason for hiding this comment

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

Almost LGTM! Cool 🆒

import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.StateFlow

interface DroidKaigiAppViewModel :
Copy link
Member

Choose a reason for hiding this comment

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

Currently, I don't use the name of DroidKaigi other than the theme, so I want to use AppViewModel.

typography = typography,
shapes = shapes,
content = content
)
}
}

@Composable
private fun colorPalette(theme: Theme?): Colors {
Copy link
Member

Choose a reason for hiding this comment

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

🆒

@@ -3,4 +3,7 @@
<string name="error_network">ネットワークエラーが発生しました。もう一度お試しください。</string>
<string name="error_server">サーバーエラーが発生しました。もう一度お試しください。</string>
<string name="error_unknown">予期しないエラーが発生しました。もう一度お試しください。</string>
<string name="system">端末設定に従う</string>
Copy link
Member

Choose a reason for hiding this comment

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

🇯🇵

}

@Composable
fun Theme(
Copy link
Member

Choose a reason for hiding this comment

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

How about making it private and naming it ThemeSetting, as it can be mistaken for setting Theme? 🎨

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I've changed it that way!

@takahirom
Copy link
Member

Therefore, I think "follow device settings" is sufficient, not "only in power saving mode".

👍

The splash screen is not referencing the in-app them

Thank you! We will create issue!

@takahirom
Copy link
Member

Sorry. Please fix conflict 🙏

@yagipy
Copy link
Contributor Author

yagipy commented Mar 11, 2021

@takahirom
I fixed conflict!

We will create issue!

I created an issue!
Please check it out 🙏
#344

@yagipy yagipy requested a review from takahirom March 11, 2021 02:06
@yagipy
Copy link
Contributor Author

yagipy commented Mar 11, 2021

Sorry, the CI is down, I'll contact you after I fix it.

@yagipy
Copy link
Contributor Author

yagipy commented Mar 11, 2021

@takahirom
CI passed!
Please check it out 🙇‍♂️

@github-actions github-actions bot temporarily deployed to deploygate-distribution March 11, 2021 02:38 Inactive
Copy link
Member

@takahirom takahirom left a comment

Choose a reason for hiding this comment

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

LGTM 👍 I think this is a good sample for changing the theme in app!

@takahirom takahirom merged commit 79d67aa into DroidKaigi:main Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dark theme setting for settings screen
3 participants