Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Jetpack Compose Basics tutorial doesn't mention changing app theme

Đang mở
#247 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@JolandaVerhoef đang làm issue này rồi.

Từ ngày 16/8/2022.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
Kotlin
Star
1.7k
Fork
802
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của android/codelab-android-compose

Tất cả issue của android/codelab-android-compose

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.