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

Jetpack Compose Basics tutorial doesn't mention changing app theme #247

Open
Digipom opened this issue Mar 21, 2022 · 0 comments
Open

Jetpack Compose Basics tutorial doesn't mention changing app theme #247

Digipom opened this issue Mar 21, 2022 · 0 comments
Assignees

Comments

@Digipom
Copy link

Digipom commented Mar 21, 2022

The tutorial here implicitly depends on using a day/night theme in themes.xml: https://developer.android.com/codelabs/jetpack-compose-basics

For example, themes.xml in the solution contains this code:

<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme. -->
    <style name="Theme.BasicsCodelab" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
    </style>

    <style name="Theme.BasicsCodelab.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="Theme.BasicsCodelab.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="Theme.BasicsCodelab.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

However, creating a new Compose project with Android Studio results in this theme:

<resources>

    <style name="Theme.BasicsCodelab" parent="android:Theme.Material.Light.NoActionBar">
        <item name="android:statusBarColor">@color/purple_700</item>
    </style>
</resources>

This leads to differences in expected behavior and actual behavior from following the tutorial. For example, components won't display a dark background without wrapping them in a compose Surface. The system bar also won't follow dark mode and there may also be differences with system dialogs and other components.

@JolandaVerhoef JolandaVerhoef self-assigned this Aug 16, 2022
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

No branches or pull requests

3 participants
@Digipom @JolandaVerhoef and others