-
Notifications
You must be signed in to change notification settings - Fork 499
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 part of #4030 : Implementing dark mode to various screens. #4032
Conversation
@BenHenning I will be implementing dark mode to some layouts in this PR so I just wanted to confirm the approach by which I did it for one layout (Add profile activity) if this is good then I will be pushing more layouts similarly.
Also I had two problems with this...
<!--ACTION BAR STYLE-->
<style name="OppiaActionBar" parent="Widget.AppCompat.Light.ActionBar">
<item name="android:background">@color/oppia_action_bar_color</item>
</style> <style name="OppiaTheme" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
<item name="actionBarStyle">@style/OppiaActionBar</item>
</style> but this is not working.
vokoscreen-2021-12-13_00-00-26.mp4Please let me know if you have any suggestions for these. |
Apologies @ayush0402, this will probably take me a bit to review so I won't be able to look at it until tomorrow at the earliest. |
@ayush0402 regarding your issues:
I will be following up with high-level thoughts on the code soon, but I wanted to follow up on these points, first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ayush0402! And, apologies for the delay. I left some high-level thoughts in comments.
Overall, I think this is on the right approach but there may still be some confusion around the differences between the different color files. I also suspect you might benefit from adding a few more examples (especially layouts since this results in more component color cases which I expect is the more confusing one to figure out). Beyond that, it might be good to wait to finish the PR in its full until Rajat has a chance to review this (though that will mean waiting 1+ weeks for review). It's up to you if you want to make more progress in the meantime, just know that a lot of it might have to be redone if he has more major feedback later.
Hi. As of today, some main reviewers have taken time off for the next few weeks, so it may take a little while before we can look at this PR. We appreciate your patience while some of our team members recharge. We'll be fully returning on 4 January 2021. |
Thanks, I figured out the issue with changing colors for the "ActionBar". Actually we were not using Action Bar at all for that screen, It was using a NoActionBar variant of the theme and it was actually a custom toolbar defined under layouts/toolbar.xml which was being for various layouts. Changing its properties under layouts/toolbar.xml works for changing the color other than colorPrimary now. |
@BenHenning PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ayush0402! I didn't look too closely at the theme files since I'm not entirely sure how we're going to be managing those long-term, but the rest of the PR generally looks good (just had a few comments--PTAL).
@rt4914 how should these new colors relate to themes? Should we maybe be restricting themes to only reference color_palette colors similar to color_components?
@BenHenning PTAL. |
@BenHenning yes agreed. Themes should connect to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ayush0402! I think the latest color files look really good, and I'm eager to see the rest of the colors get migrated over throughout the rest of the project. Thanks for your patience as we figured this out--I think it's moving toward much cleaner organization.
Though to check one thing: @ayush0402 and @rt4914, is this actually finishing #4030 or is there more color migration work to do prior to dark mode being considered done? |
@BenHenning No, we still have many views/layouts to check and cover before dark mode can be considered complete. I earlier had thought of filing this issue for setting the base for the implementation and then create more issues for other layouts and maybe making them available to community for some help. But i guess I will create more PRs under the same issue and have this PR title renamed to |
@ayush0402 Yes we can do that for sure. But I think we should create one more PR first and then do that. So that the new PR can act as sample PR and also we can be sure that everything is fully correct. |
Explanation
Fix part of #4030
Link to the original PR having discussions over the decided approach : link
Summary of the approach followed in this PR :
color_defs.xml
following decided snake_case naming convention.colors_def.xml
should strictly contain actual color name irrespective of their intended use with their hex color code declaration.color_palette.xml
(day/night) splits the colors (to be used bycomponent_colors.xml
) according to chosen theme.color_palette.xml
should not contain any name tied to the intended component to be used on, rather should have generic naming of the colors.component_colors.xml
then only referencescolor_palette.xml
. It uses UI component specific names. Component colors should be shared very little outside of their respective views/fragments/activities.colors_migrating.xml
contains color declarations which are supposed to be incolor_defs.xml
but has not been renamed yet to have actual color name instead of names linked to their use and components. This is a temporary measure to make sure other 4 color files follows the convention decided for them.Note: colors declared in
component_colors.xml
andcolor_palette.xml
should not use "oppia_" prefix to avoid redundancy and must have_color
suffix. And just opposite applies tocolor_defs.xml
Link to comment by Ben on this PR summarising the approach.
Screenshots :
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then: