Skip to content

Commit

Permalink
[#3] - Support night mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg3410 committed Sep 5, 2022
1 parent dcd6ba1 commit db4b30b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
binding = DataBindingUtil.setContentView(this, R.layout.activity_main)

setupNavigation()
Expand Down
11 changes: 11 additions & 0 deletions GDGFinder-Starter/app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--?xml version="1.0" encoding="UTF-8"?-->
<resources>
<color name="primaryColor">#1a237e</color>
<color name="primaryLightColor">#534bae</color>
<color name="primaryDarkColor">#000051</color>
<color name="secondaryColor">#b71c1c</color>
<color name="secondaryLightColor">#f05545</color>
<color name="secondaryDarkColor">#7f0000</color>
<color name="primaryTextColor">#ffffff</color>
<color name="secondaryTextColor">#ffffff</color>
</resources>
2 changes: 1 addition & 1 deletion GDGFinder-Starter/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primaryColor</item>
<item name="colorPrimaryDark">@color/primaryDarkColor</item>
Expand Down

0 comments on commit db4b30b

Please sign in to comment.