android / android/codelab-android-compose

Jetpack Compose Basics tutorial doesn't mention changing app theme

Offen
#247 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @JolandaVerhoef Auf GitHub ansehen
Vorherrschende Sprache
Kotlin
Sterne
1.7k
Forks
799
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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:

```




<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>

<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>

```

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.