In the thread of Murphybro2's solution we got also the solution for androidx
https://stackoverflow.com/a/58836953
You can change the AlertDialogStyle used by your app by providing a custom Theme style
<style name="AppTheme.Settings">
<!-- This will change the opening dialogs for EditTextPreference -->
<item name="alertDialogStyle">@style/Theme.example.AlertTheme</item>
</style>
<style name="Theme.example.AlertTheme" parent="">
<item name="android:textViewStyle">@style/Theme.AlertTextStyle</item>
<item name="android:textColor">@color/pink</item>
<item name="android:editTextBackground">@color/pink</item>
<item name="android:windowMinWidthMajor">@dimen/abc_dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@dimen/abc_dialog_min_width_minor</item>
<item name="android:windowIsFloating">true</item>
</style>
<style name="Theme.AlertTextStyle" parent="Theme.example">
<item name="android:textColorPrimary">@color/gray</item>
</style>
The most important one for me was "windowIsFloating">true because else the window is stuck to the top of your screen
For me somehow only adding the extra textViewStyle helped to change the top text inside the dialog, but I think its because of my example theme.