I read about Android styles and themes today and tried to apply it to a list in my app as a test. The app has a list element which have TextViews added to it programmatically.
According to the docs applying a style as a theme affects child views too.
So I tried this:
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/TextAppearance.AppCompat.Small"/>
I expected that the TextView texts in the list became small, but nothing happened.
I also tried @style/TextAppearance.MaterialComponents.Headline1
, but it had no effect either.
Why is that?
I didn't change any of the style or theme settings myself. I use the default settings which Android Studio generated for the project.
Shouldn't applying a style as a theme to a view like above change something?