Я хочу быть моим приложением в темном режиме по умолчанию.
для этого я внес изменения в values / theme.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
как я могу реализовать темную тему? У меня также есть активность с cardview. Что я должен сделать с этим макетом в перспективе темной темы?
это тот макет:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
..>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
card_view:cardCornerRadius="8dp"
card_view:cardElevation="6dp"
card_view:cardUseCompatPadding="true"
card_view:cardPreventCornerOverlap="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
>
<ImageView
android:id="@+id/imageView"
android:layout_width="100dp"
android:layout_height="100dp" />
<TextView
android:id="@+id/word"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif-condensed"
android:gravity="center"
android:text="Animation"
android:textSize="18sp"
android:textStyle="bold"
/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
панель действий и панель выше, которая превращается в темную тему, но фон изприложение все еще белое.